From f707043d40d5eab45a3dd6ef688919fefbc6fb39 Mon Sep 17 00:00:00 2001 From: Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com> Date: Tue, 12 Oct 2021 18:06:28 +0200 Subject: [PATCH 1/2] Upgrade `ROOTSYS` Usage The old find-module for ROOT used to set ROOTSYS. The config mode package of ROOT does not set it. Document this in the CHANGELOG. Remove all unused places. Upgrade remaining places with newer variables. --- CHANGELOG.md | 1 + cmake/modules/WriteConfigFile.cmake | 2 +- cmake/scripts/CMakeLists.txt_roc | 4 ++-- cmake/scripts/config.csh.in | 1 - cmake/scripts/config.sh.in | 1 - cmake/scripts/generate_dictionary_root.sh.in | 1 - cmake/scripts/root_macro.sh.in | 1 - cmake/scripts/run_binary.sh.in | 2 -- cmake/scripts/set_env.sh.in | 1 - 9 files changed, 4 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1d873547a..0186c5dc03 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), * This means, that all library dependencies of the type `Core` are either not working at all, or might not work as expected. Please upgrade all of them to be like `ROOT::Core` . * This also means, that you need to add an `include(ROOTMacros)` after your `find_package2(... ROOT ...)`. * `ROOT_VERSION_NUMBER` is gone. Use `ROOT_VERSION` (which is the dotted version number) and `VERSION_GREATER`/etc now. + * `ROOTSYS` isn't any longer set. For example use ROOT targets instead. * Many CMake related tools have been externalized into [FairCMakeModules](https://github.com/FairRootGroup/FairCMakeModules) and partly rewritten diff --git a/cmake/modules/WriteConfigFile.cmake b/cmake/modules/WriteConfigFile.cmake index 333cd0da4f..533b637bbd 100644 --- a/cmake/modules/WriteConfigFile.cmake +++ b/cmake/modules/WriteConfigFile.cmake @@ -150,7 +150,7 @@ MACRO (WRITE_CONFIG_FILE filename) CONVERT_LIST_TO_STRING(${PYTHONPATH}) SET(MY_PYTHONPATH ${output}) - SET (PATH ${ROOTSYS}/bin ${PATH}) + SET (PATH ${ROOT_BINDIR} ${PATH}) UNIQUE(PATH "${PATH}") CONVERT_LIST_TO_STRING(${PATH}) Set(MY_PATH ${output}) diff --git a/cmake/scripts/CMakeLists.txt_roc b/cmake/scripts/CMakeLists.txt_roc index 65a32f5384..74109b7cab 100644 --- a/cmake/scripts/CMakeLists.txt_roc +++ b/cmake/scripts/CMakeLists.txt_roc @@ -28,7 +28,7 @@ EndIf(CMAKE_SYSTEM_NAME MATCHES Darwin) add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libRoc.so COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} - ROOTSYS=${ROOTSYS} make roclib + make roclib WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/roc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/roc/patch_okay ) @@ -43,7 +43,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libDabcRoc.so ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libDabcMbs.so ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libRocDict.rootmap COMMAND LD_LIBRARY_PATH=${ROOT_LIBRARY_DIR} - ROOTSYS=${ROOTSYS} make rocdict + make rocdict WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/roc DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/roc/lib/libDabcBase.so ) diff --git a/cmake/scripts/config.csh.in b/cmake/scripts/config.csh.in index 81586df412..4d0a8502e2 100644 --- a/cmake/scripts/config.csh.in +++ b/cmake/scripts/config.csh.in @@ -5,7 +5,6 @@ setenv System_ "@_system@" . @_EXECDIR@/check_system.csh if ( "$same_system" == "1" ) then setenv SIMPATH "@SIMPATH@" - setenv ROOTSYS "@ROOTSYS@" setenv FAIRROOTPATH "@FAIRROOTPATH@" if ( @FULL_CONFIG_FILE@ == true ) then setenv Geant4_INCLUDE_DIRS "@Geant4_INCLUDE_DIRS@" diff --git a/cmake/scripts/config.sh.in b/cmake/scripts/config.sh.in index 26df7d6bcf..5990528635 100644 --- a/cmake/scripts/config.sh.in +++ b/cmake/scripts/config.sh.in @@ -5,7 +5,6 @@ export System_="@_system@" . @_EXECDIR@/check_system.sh if [ $same_system -eq 1 ]; then export SIMPATH="@SIMPATH@" - export ROOTSYS="@ROOTSYS@" export FAIRROOTPATH="@FAIRROOTPATH@" if (@FULL_CONFIG_FILE@); then export Geant4_INCLUDE_DIRS="@Geant4_INCLUDE_DIRS@" diff --git a/cmake/scripts/generate_dictionary_root.sh.in b/cmake/scripts/generate_dictionary_root.sh.in index 679a2b668f..699a17751b 100755 --- a/cmake/scripts/generate_dictionary_root.sh.in +++ b/cmake/scripts/generate_dictionary_root.sh.in @@ -9,6 +9,5 @@ # Setup the needed environment export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@ export DYLD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@ -export ROOTSYS=@ROOTSYS@ @ROOT_CINT_EXECUTABLE@ -f @Int_DICTIONARY@ @EXTRA_DICT_PARAMETERS_STR@ -c @Int_DEF_STR@ @Int_INC_STR@ @Int_HDRS_STR@ @Int_LINKDEF@ diff --git a/cmake/scripts/root_macro.sh.in b/cmake/scripts/root_macro.sh.in index 535797a33b..1336a11c63 100644 --- a/cmake/scripts/root_macro.sh.in +++ b/cmake/scripts/root_macro.sh.in @@ -11,7 +11,6 @@ export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$DYLD_LIBRARY_PATH export PATH=@SIMPATH@/bin:$PATH:@Geant4_DIR@ -export ROOTSYS=@ROOTSYS@ export ROOTEXE=@ROOT_EXECUTABLE@ export ROOT_INCLUDE_PATH=@Geant3_INCLUDE_DIRS@:@MY_ROOT_INCLUDE_PATH@ export FAIRROOTPATH="@FAIRROOTPATH@" diff --git a/cmake/scripts/run_binary.sh.in b/cmake/scripts/run_binary.sh.in index 5dfb8eca7e..492d274449 100644 --- a/cmake/scripts/run_binary.sh.in +++ b/cmake/scripts/run_binary.sh.in @@ -1,11 +1,9 @@ #!/bin/bash #export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@ -#export ROOTSYS=@ROOTSYS@ export VMCWORKDIR=@VMCWORKDIR@ export Geant4VMC_MACRO_DIR=@Geant4VMC_MACRO_DIR@ export USE_VGM=1 -#export PATH=@ROOTSYS@/bin:$PATH #export GEANT4_LIBRARY_DIR=@GEANT4_LIBRARY_DIR@ #export Geant4_INCLUDE_DIRS=@Geant4_INCLUDE_DIRS@ diff --git a/cmake/scripts/set_env.sh.in b/cmake/scripts/set_env.sh.in index 6a7e742abd..0b443838f6 100644 --- a/cmake/scripts/set_env.sh.in +++ b/cmake/scripts/set_env.sh.in @@ -4,7 +4,6 @@ export LD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$LD_LIBRARY_PATH export DYLD_LIBRARY_PATH=@MY_LD_LIBRARY_PATH@:$DYLD_LIBRARY_PATH export PATH=@SIMPATH@/bin:$PATH:@Geant4_DIR@ -export ROOTSYS=@ROOTSYS@ export ROOTEXE=@ROOT_EXECUTABLE@ export ROOT_INCLUDE_PATH="@Geant3_INCLUDE_DIRS@:@MY_ROOT_INCLUDE_PATH@" export VMCWORKDIR=@VMCWORKDIR@ From 9665eb7e89a6edaf05baab8c5d7b84edc5ac9143 Mon Sep 17 00:00:00 2001 From: Christian Tacke <58549698+ChristianTackeGSI@users.noreply.github.com> Date: Mon, 4 Oct 2021 21:31:22 +0200 Subject: [PATCH 2/2] ci: Output CDash Links, Rerun Failed More Often * Link directly to the CDash pages after the submit * Geant3 tests are quite unstable. Try a little harder --- FairRoot_build_test.cmake | 8 +++++-- cmake/private/Testlib.cmake | 47 +++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 cmake/private/Testlib.cmake diff --git a/FairRoot_build_test.cmake b/FairRoot_build_test.cmake index f908082a07..9cd7a5ba63 100644 --- a/FairRoot_build_test.cmake +++ b/FairRoot_build_test.cmake @@ -6,6 +6,9 @@ # copied verbatim in the file "LICENSE" # ################################################################################ +list(PREPEND CMAKE_MODULE_PATH "cmake/private") +include(Testlib) + cmake_host_system_information(RESULT fqdn QUERY FQDN) set(CTEST_SOURCE_DIRECTORY .) @@ -59,7 +62,7 @@ ctest_build(FLAGS "-j${NCPUS}" TARGET install unset(repeat) if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.17) - set(repeat REPEAT UNTIL_PASS:5) + set(repeat REPEAT UNTIL_PASS:7) endif() if(_ctest_build_ret_val OR _ctest_build_num_errs) message(STATUS "Skipping tests, because build failed" @@ -74,7 +77,8 @@ else() RETURN_VALUE _ctest_test_ret_val) endif() -ctest_submit() +fairroot_ctest_submit(FINAL) +fairroot_summary_cdash() if(_ctest_test_ret_val) Message(FATAL_ERROR "Some tests failed.") diff --git a/cmake/private/Testlib.cmake b/cmake/private/Testlib.cmake new file mode 100644 index 0000000000..3543f896de --- /dev/null +++ b/cmake/private/Testlib.cmake @@ -0,0 +1,47 @@ +################################################################################ +# Copyright (C) 2020-2021 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH # +# # +# This software is distributed under the terms of the # +# GNU Lesser General Public Licence (LGPL) version 3, # +# copied verbatim in the file "LICENSE" # +################################################################################ + +function(fairroot_ctest_submit) + cmake_parse_arguments(PARSE_ARGV 0 ARGS "FINAL" "" "") + foreach(env_var IN ITEMS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY) + if("$ENV{${env_var}}" MATCHES ".*proxy.gsi[.]de.*") + set(old_${env_var} "$ENV{${env_var}}") + set(ENV{${env_var}}) + message(STATUS "safed ${env_var}: ${old_${env_var}}") + endif() + endforeach() + if(ARGS_FINAL) + ctest_submit(RETURN_VALUE _ctest_submit_ret_val + BUILD_ID cdash_build_id) + set(cdash_build_id "${cdash_build_id}" PARENT_SCOPE) + else() + ctest_submit(RETURN_VALUE _ctest_submit_ret_val) + endif() + foreach(env_var IN ITEMS http_proxy HTTP_PROXY https_proxy HTTPS_PROXY) + if(DEFINED old_${env_var}) + set(ENV{${env_var}} "${old_${env_var}}") + message(STATUS "(restored ${env_var}: $ENV{${env_var}})") + endif() + endforeach() + + if(_ctest_submit_ret_val) + message(WARNING " ctest_submit() failed. Continueing") + endif() +endfunction() + +function(fairroot_summary_cdash) + if(cdash_build_id) + message(STATUS " CDash Build Summary ..: " + "${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/buildSummary.php?buildid=${cdash_build_id}") + message(STATUS " CDash Test List ......: " + "${CTEST_DROP_METHOD}://${CTEST_DROP_SITE}/viewTest.php?buildid=${cdash_build_id}") + else() + message(STATUS " /!\\ CDash submit likely failed") + endif() + message(STATUS " ") +endfunction()