Skip to content

Export Sanitizer Fixes, master branch (2023.07.03.)

Made the sanitizers work with missing externals, addressing ATLINFR-4990.

Previously under "just the wrong" circumstances a "-NOTFOUND" external could result in the export sanitizer scripts erroneously trimming the CMake-generated targets files. With the now introduced string comparisons this should not happen anymore.

For the bug to happen, the missing external had to appear like the following in the auto-generated file:

set_target_properties(Athena::Hijing_iLib PROPERTIES
  INTERFACE_COMPILE_DEFINITIONS "CLHEP_MAX_MIN_DEFINED;CLHEP_ABS_DEFINED;CLHEP_SQR_DEFINED"
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/src/Generators/Hijing_i;/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--dev4LCG_Athena_x86_64-el9-gcc13-opt/2023-07-02T0730/AthenaExternals/24.0.8/InstallArea/x86_64-el9-gcc13-opt/lib/CLHEP-2.4.1.3/../../include"
  INTERFACE_LINK_LIBRARIES "HIJING_LIBRARIES-NOTFOUND;/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--dev4LCG_Athena_x86_64-el9-gcc13-opt/2023-07-02T0730/AthenaExternals/24.0.8/InstallArea/x86_64-el9-gcc13-opt/lib/libCLHEP.so;Athena::GeneratorFortranCommonLib;Athena::GeneratorModulesLib;Athena::StoreGateLib"
  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "/cvmfs/atlas-nightlies.cern.ch/repo/sw/master--dev4LCG_Athena_x86_64-el9-gcc13-opt/2023-07-02T0730/AthenaExternals/24.0.8/InstallArea/x86_64-el9-gcc13-opt/lib/CLHEP-2.4.1.3/../../include"
)

I.e. the -NOTFOUND string had to appear right before a semicolon. If it was in some other place, like:

set_target_properties(Athena::AthOnnxruntimeServiceLib PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/src/Control/AthOnnxruntimeService;/mnt/hdd1/krasznaa/projects/gcc13/athena/Control/AthOnnxruntimeService/ONNXRUNTIME_INCLUDE_DIR-NOTFOUND"
  INTERFACE_LINK_LIBRARIES "Athena::AsgServicesLib"
  INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "/mnt/hdd1/krasznaa/projects/gcc13/athena/Control/AthOnnxruntimeService/ONNXRUNTIME_INCLUDE_DIR-NOTFOUND"
)

, that would not trigger the issue.

This is why this remained hidden for so long. 😦 Because it wasn't enough for an external to be missing, "just the wrong" external had to be missing for the bug to appear... 🤔

Merge request reports