We use a git-based version numbering system for out embedded application (tag plus commit hash).
Having updated our configuration files to match the latest Torizon IDE extension template for the latest version (3.6.0) I found that the entries in CMakeLists.txt to extract the version string from git now no longer work.
find_package(Git REQUIRED)
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --long
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
OUTPUT_VARIABLE PROJECT_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set( OUTPUT_NAME ${PROJECT_NAME}_${PROJECT_VERSION} )
This is a Qt C++ widgets- based project.
The problem seems to be with git’s handling of the directory as it is mounted in the container. In the VSCode output window I see
fatal: detected dubious ownership in repository at '/home/torizon/app'
To add an exception for this directory, call:
git config --global --add safe.directory /home/torizon/app
even though I have issued the command (and restarted the VSCode folder).
When git is run in the container from CMake, is it run as the “torizon” user ?
Or maybe I should add the mounted project directory to safe.directory ?