• X xray-16
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 216
    • Задачи 216
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 31
    • Запросы на слияние 31
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • OpenXRay
  • xray-16
  • Запросы на слияние
  • !798

Try to fix resource linking

  • Ревью изменений

  • Скачать
  • Почтовые патчи
  • Простое отличие
Слиты xottab-duty запросил слияние github/fork/OPNA2608/fix/786 в dev Май 12, 2021
  • Обзор 5
  • Коммиты 1
  • Конвейеры 0
  • Изменения 2

Created by: OPNA2608

Fixes #786 (closed).

Problems:

  • CMake supports setting an installation prefix, but the convenience resource linking ignores it and hardcodes /usr/share instead
  • The resource linking uses lstat to determine if a link already exists. lstat gives details about the link itself, not what it links to - stat will follow symlinks to give details about their targets. It can happen that the link target stops existing at some point (e.g. reinstallation to new directory) which leads to invalid symlinks. These can produce cryptic errors for users.

Solutions:

  1. Hardcode the CMake data prefix's (CMAKE_INSTALL_DATAROOTDIR) absolute path variant instead of /usr/share. Its default value is share relative to CMAKE_INSTALL_PREFIX, so it should evaluate to the same path with the default prefix of OpenXRay.
  2. Use stat instead of lstat to determine if a link is needed. If stat fails, start preparing the resource linking. We then check lstat next to determine if an invalid link already exists (link path exists, but what it links to doesn't) - unlink it if it does. Lastly we make a new link to the resource.
Ответственный
Назначить
Проверяющие
Запросить ревью
Оценка трудозатрат
Исходная ветка: github/fork/OPNA2608/fix/786