macos sip: apply on macos only, dont store LD_LIBRARY_PATH (#38687)

This commit is contained in:
Harmen Stoppels
2023-07-04 10:54:13 +02:00
committed by GitHub
parent e9dc6dc96c
commit 08f23f4802
3 changed files with 23 additions and 18 deletions

View File

@@ -27,12 +27,9 @@
# avoids the need to come up with a user-friendly naming scheme for
# spack module files.
########################################################################
# Store LD_LIBRARY_PATH variables from spack shell function
# Store DYLD_* variables from spack shell function
# This is necessary because MacOS System Integrity Protection clears
# variables that affect dyld on process start.
if ( ${?LD_LIBRARY_PATH} ) then
setenv SPACK_LD_LIBRARY_PATH $LD_LIBRARY_PATH
endif
if ( ${?DYLD_LIBRARY_PATH} ) then
setenv SPACK_DYLD_LIBRARY_PATH $DYLD_LIBRARY_PATH
endif

View File

@@ -47,10 +47,10 @@ export _sp_initializing=true
_spack_shell_wrapper() {
# Store LD_LIBRARY_PATH variables from spack shell function
# Store DYLD_* variables from spack shell function
# This is necessary because MacOS System Integrity Protection clears
# variables that affect dyld on process start.
for var in LD_LIBRARY_PATH DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH; do
for var in DYLD_LIBRARY_PATH DYLD_FALLBACK_LIBRARY_PATH; do
eval "if [ -n \"\${${var}-}\" ]; then export SPACK_$var=\${${var}}; fi"
done