Component Library Handling Update, master branch (2019.09.04.)
This is a replacement for !517 (merged) for handling ATLINFR-3143. It goes in a completely different direction with preventing compiling/linking code against component libraries.
It does so by defining nonsensical strings as compile/link options for these libraries. In such a way that these nonsensical options would only appear for the clients of the libraries, not for the libraries themselves.
When trying to compile the CaloClusterCorrection package, whose configuration I'm fixing in athena!26327 (merged) right now, it results in the following compilation failure:
[994/1174] Building CXX object Calorimeter/CaloClusterCorr...loClusterCorrectionLib.dir/src/CaloClusterCorrection.cxx.o
FAILED: Calorimeter/CaloClusterCorrection/CMakeFiles/CaloClusterCorrectionLib.dir/src/CaloClusterCorrection.cxx.o
/cvmfs/sft.cern.ch/lcg/releases/gcc/8.3.0-cebb0/x86_64-centos7/bin/g++ -DALLOW_TOOLHANDLE_NONCONSTNESS -DATLAS_GAUDI_V21 -DCLHEP_ABS_DEFINED -DCLHEP_MAX_MIN_DEFINED -DCLHEP_SQR_DEFINED -DCaloClusterCorrectionLib_EXPORTS -DGAUDI_V20_COMPAT -DHAVE_64_BITS -DHAVE_GAUDI_PLUGINSVC -DPACKAGE_VERSION=\"CaloClusterCorrection-00-00-00\" -DPACKAGE_VERSION_UQ=CaloClusterCorrection-00-00-00 -D__IDENTIFIER_64BIT__ -I/home/krasznaa/projects/externals/athena/AtlasTest/TestTools -I/home/krasznaa/projects/externals/athena/TestPolicy -I/home/krasznaa/projects/externals/athena/Control/AthenaBaseComps -I/home/krasznaa/projects/externals/athena/Control/AthenaKernel -I/home/krasznaa/projects/externals/athena/Control/CxxUtils -I/home/krasznaa/projects/externals/athena/Control/DataModelRoot -I/home/krasznaa/projects/externals/athena/Control/StoreGate -I/home/krasznaa/projects/externals/athena/Control/AthAllocators -I/home/krasznaa/projects/externals/athena/Control/AthContainersInterfaces -I/home/krasznaa/projects/externals/athena/Control/AthContainers -I/home/krasznaa/projects/externals/athena/Control/AthLinks -I/home/krasznaa/projects/externals/athena/Control/SGTools -I/home/krasznaa/projects/externals/athena/Database/PersistentDataModel -I/home/krasznaa/projects/externals/athena/Event/xAOD/xAODEventInfo -I/home/krasznaa/projects/externals/athena/Event/xAOD/xAODCore -I/home/krasznaa/projects/externals/athena/Database/AthenaPOOL/AthenaPoolUtilities -I/home/krasznaa/projects/externals/athena/Database/AthenaPOOL/DBDataModel -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloDetDescr -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloIdentifier -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloGeoHelpers -I/home/krasznaa/projects/externals/athena/DetectorDescription/AtlasDetDescr -I/home/krasznaa/projects/externals/athena/DetectorDescription/IdDict -I/home/krasznaa/projects/externals/athena/DetectorDescription/Identifier -I/home/krasznaa/projects/externals/athena/DetectorDescription/GeoModel/GeoModelInterfaces -I/home/krasznaa/projects/externals/athena/DetectorDescription/GeoPrimitives -I/home/krasznaa/projects/externals/athena/Event/EventPrimitives -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArGeoModel/LArReadoutGeometry -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArGeoModel/LArHV -I/home/krasznaa/projects/externals/athena/Control/IOVSvc -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloUtils -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloConditions -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloCondBlobObjs -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloEvent -I/home/krasznaa/projects/externals/athena/Control/Navigation -I/home/krasznaa/projects/externals/athena/Event/EventKernel -I/home/krasznaa/projects/externals/athena/Tracking/TrkEvent/VxVertex -I/home/krasznaa/projects/externals/athena/Tracking/TrkEvent/TrkEventPrimitives -I/home/krasznaa/projects/externals/athena/Tracking/TrkEvent/TrkNeutralParameters -I/home/krasznaa/projects/externals/athena/Tracking/TrkDetDescr/TrkSurfaces -I/home/krasznaa/projects/externals/athena/Tracking/TrkDetDescr/TrkDetDescrUtils -I/home/krasznaa/projects/externals/athena/Tracking/TrkDetDescr/TrkDetElementBase -I/home/krasznaa/projects/externals/athena/Tracking/TrkEvent/TrkParametersBase -I/home/krasznaa/projects/externals/athena/Tracking/TrkEvent/TrkTrackLink -I/home/krasznaa/projects/externals/athena/Tracking/TrkEvent/TrkParameters -I/home/krasznaa/projects/externals/athena/Event/FourMom -I/home/krasznaa/projects/externals/athena/Event/NavFourMom -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArRawConditions -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArElecCalib -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArIdentifier -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArCabling -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArRecConditions -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloInterface -I/home/krasznaa/projects/externals/athena/Event/xAOD/xAODCaloEvent -I/home/krasznaa/projects/externals/athena/Event/xAOD/xAODBase -I/home/krasznaa/projects/externals/athena/Tools/PathResolver -I/home/krasznaa/projects/externals/athena/Control/AthToolSupport/AsgTools -I/home/krasznaa/projects/externals/athena/Control/xAODRootAccess -I/home/krasznaa/projects/externals/athena/Event/xAOD/xAODEventFormat -I/home/krasznaa/projects/externals/athena/Control/xAODRootAccessInterfaces -I/home/krasznaa/projects/externals/athena/Database/IOVDbDataModel -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloClusterCorrection -I/home/krasznaa/projects/externals/athena/TileCalorimeter/TileConditions -I/home/krasznaa/projects/externals/athena/TileCalorimeter/TileCalib/TileCalibBlobObjs -I/home/krasznaa/projects/externals/athena/TileCalorimeter/TileIdentifier -I/home/krasznaa/projects/externals/athena/Calorimeter/CaloRec -I/home/krasznaa/projects/externals/athena/LArCalorimeter/LArTools -I/home/krasznaa/projects/externals/athena/LumiBlock/LumiBlockComps -I/home/krasznaa/projects/externals/athena/Event/xAOD/xAODLuminosity -I/home/krasznaa/projects/externals/athena/LumiBlock/LumiCalc -I/home/krasznaa/projects/externals/athena/LumiBlock/LumiBlockData -I/home/krasznaa/projects/externals/athena/DataQuality/GoodRunsLists -I/home/krasznaa/projects/externals/athena/Control/RootUtils -I/home/krasznaa/projects/externals/athena/PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces -I/home/krasznaa/projects/externals/athena/PhysicsAnalysis/AnalysisCommon/PATInterfaces -I/home/krasznaa/projects/externals/athena/Database/CoolLumiUtilities -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-09-03T2128/GAUDI/22.0.5/InstallArea/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/ROOT/6.18.00/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-09-03T2128/AthenaExternals/22.0.5/InstallArea/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/CORAL/3_2_1/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/Boost/1.70.0/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/tbb/2019_U7/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/eigen/3.3.7/x86_64-centos7-gcc8-opt/include/eigen3 -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/COOL/3_2_1/x86_64-centos7-gcc8-opt/include -isystem /cvmfs/atlas-nightlies.cern.ch/repo/sw/master/sw/lcg/releases/LCG_96/Python/2.7.16/x86_64-centos7-gcc8-opt/include/python2.7 -fplugin=/cvmfs/atlas-nightlies.cern.ch/repo/sw/master/2019-09-03T2128/AthenaExternals/22.0.5/InstallArea/x86_64-centos7-gcc8-opt/lib/libchecker_gccplugins.so -DNDEBUG -O2 -Wall -Wno-long-long -Wno-deprecated -Wno-unused-local-typedefs -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wextra -Werror=return-type -pedantic -fPIC -pthread __MUST_NOT_COMPILE_AGAINST_TileConditions__ -std=c++17 -MD -MT Calorimeter/CaloClusterCorrection/CMakeFiles/CaloClusterCorrectionLib.dir/src/CaloClusterCorrection.cxx.o -MF Calorimeter/CaloClusterCorrection/CMakeFiles/CaloClusterCorrectionLib.dir/src/CaloClusterCorrection.cxx.o.d -o Calorimeter/CaloClusterCorrection/CMakeFiles/CaloClusterCorrectionLib.dir/src/CaloClusterCorrection.cxx.o -c /home/krasznaa/projects/externals/athena/Calorimeter/CaloClusterCorrection/src/CaloClusterCorrection.cxx
g++: error: __MUST_NOT_COMPILE_AGAINST_TileConditions__: No such file or directory
[1003/1174] Building CXX object Tracking/TrkDetDescr/TrkSu...s/CMakeFiles/TrkSurfaces.dir/src/StraightLineSurface.cxx.o
ninja: build stopped: subcommand failed.
Note that strictly speaking I would've only had to set an impossible compilation option on the library. Unless the clients do something very advanced, the compilation should never actually make it until the linking step. But still, this seemed the safest to do.
Also note that contrary to the symbol hiding, this technique will uncover absolutely all of the misconfigurations. Just to give a feeling about the current status of our nightly:
[tcsh][pcadp02]:build > grep "__MUST_NOT_LINK" build.ninja | wc -l
46
[tcsh][pcadp02]:build >
We'll have some work ahead of us...