qmsetup
qmsetup copied to clipboard
execute_process fails
im building qwindowkit in github actions on ubuntu-latest with gcc and ninja (cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++
)
however this part keeps erroring https://github.com/stdware/qmsetup/blob/1c82f2e09dd922b84a7807f4a360e07f141fcb10/cmake/modules/InstallPackage.cmake#L92-L100
CMake Error at DummyProject/ThirdParty/qwindowkit/qmsetup/cmake/modules/InstallPackage.cmake:108 (message):
Configure failed, check
"/home/runner/work/DummyProject/DummyProject/build/_build/qmsetup_configure.log"
qmsetup_configure.log:
Run cat /home/runner/work/DummyProject/DummyProject/build/_build/qmsetup_configure.log
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
so i went back and added some logging just before
execute_process(COMMAND ninja --version)
message("${CMAKE_COMMAND} -S ${_src_dir} -B ${_build_dir} ${_generator} ${_build_type}")
which yields
1.11.1
/usr/local/bin/cmake -S /home/runner/work/DummyProject/DummyProject/ThirdParty/qwindowkit/qmsetup -B /home/runner/work/DummyProject/DummyProject/build/_build/qmsetup -G Ninja -DCMAKE_BUILD_TYPE=Release
the full command cmake runs is:
execute_process(COMMAND /usr/local/bin/cmake -S /home/runner/work/DummyProject/DummyProject/ThirdParty/qwindowkit/qmsetup -B /home/runner/work/DummyProject/DummyProject/build/_build/qmsetup -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/home/runner/work/DummyProject/DummyProject/build/_install OUTPUT_FILE /home/runner/work/DummyProject/DummyProject/build/_build/qmsetup_configure.log ERROR_FILE /home/runner/work/DummyProject/DummyProject/build/_build/qmsetup_configure.log RESULT_VARIABLE _code WORKING_DIRECTORY /home/runner/work/DummyProject/DummyProject/ThirdParty/qwindowkit )
so both ninja is found in PATH, and the command run is perfectly fine. how is this possible? like i said, this happens only in CI, not locally
Update: It seems that switching from https://github.com/ashutoshvarma/setup-ninja to just installing ninja with apt fixes it. I have no idea how that is possible since both put ninja is path but whatever
I don't know how this happened as well. https://github.com/ashutoshvarma/setup-ninja just downloads Ninja and adds it to PATH.