Skip to content

Try fixing CI build

Christoph Hasse requested to merge try_fixing_ci_build into master

Trying to fix the current build failures in the CI.

The error we see is:

 CMake Error at /cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/772/stable/x86_64-centos7/lib/python2.7/site-packages/LbDevTools/data/toolchain.cmake:28 (message):
  The environment variables BINARY_TAG and LCG_VERSION mut be set for new
  style CMake projects
Call Stack (most recent call first):
  /builds/lhcb/Moore/toolchain.cmake:1 (include)
  /builds/lhcb/Moore/build.x86_64-centos7-gcc9-opt/CMakeFiles/3.16.2/CMakeSystem.cmake:6 (include)
  /builds/lhcb/Moore/build.x86_64-centos7-gcc9-opt/CMakeFiles/CMakeTmp/CMakeLists.txt:3 (project)
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error at /cvmfs/lhcb.cern.ch/lib/contrib/CMake/3.16.2/Linux-x86_64/share/cmake-3.16/Modules/CMakeTestCXXCompiler.cmake:37 (try_compile):
  Failed to configure test project build system.
Call Stack (most recent call first):
  CMakeLists.txt:12 (project)

I've fixed or rather hacked around this by adding the platform x86_64-centos7-gcc9-opt to the LbEnv call and then exporting LCG_VERSION manually.

Now why do I say "hacked"?
Well from what I understand with my limited CMake knowledge BINARY_TAG and LCG_VERSION aren't actually required since we aren't building a "new style" project here.
In /cvmfs/lhcb.cern.ch/lib/var/lib/LbEnv/772/stable/x86_64-centos7/lib/python2.7/site-packages/LbDevTools/data/toolchain.cmake this is checked by looking at whether we have a gaudi_project call in our toplevel CMakeLists.txt which we obviously have.

With some debug printing I also see that the value of GAUDI_OLD_STYLE_PROJECT in toolchain.cmake is set to YES when this is first called.
But later (see above) the same toolchain.cmake file is again included from /builds/lhcb/Moore/build.x86_64-centos7-gcc9-opt/CMakeFiles/3.16.2/CMakeSystem.cmake which is apparently called from /builds/lhcb/Moore/build.x86_64-centos7-gcc9-opt/CMakeFiles/CMakeTmp/CMakeLists.txt:3.

Somehow in this call GAUDI_OLD_STYLE_PROJECT evaluates to false.... And since I can't even figure out how to keep and look at the temporary file /builds/lhcb/Moore/build.x86_64-centos7-gcc9-opt/CMakeFiles/CMakeTmp/CMakeLists.txt this is currently where my CMake adventure ends...

But hoping that maybe @clemenci can please please please:pray: help me?

also a little reproducer, assuming one logs into a centos 7 machine without any LbLogin or LbEnv environment active:

git clone https://gitlab.cern.ch/lhcb/Moore testmoore && cd testmoore
. /cvmfs/lhcb.cern.ch/lib/LbEnv-testing.sh -c x86_64-centos7-gcc9-opt
. /cvmfs/lhcbdev.cern.ch/nightlies/lhcb-head/latest/setupSearchPath.sh
sed -i 's/USE Phys v.*/USE Phys HEAD/' CMakeLists.txt
lb-project-init
make

Merge request reports