How do I pass LSST_LIBRARY_PATH or DYLD_LIBRARY_PATH through scons through assertExecutable to a bash script?
I’d like to do the below (as part of lsst_ci). This works in a py.test environment, but DYLD_LIBRARY_PATH nor LSST_LIBRARY_PATH are passed through to the underlying bash script.
I know that this is a SIP issue. I’m asking for a solution.
executable_dir = os.path.join(
lsst.utils.getPackageDir("VALIDATE_DRP"),
"examples")
class ExampleObsTestCase(lsst.utils.tests.ExecutablesTestCase):
"""Test an example obs_ processing run."""
def testObsCfhtQuick(self):
"""Test obs_cfht"""
self.assertExecutable("runCfhtQuickTest.sh",
root_dir=executable_dir,
msg="CFHT Quick Test failed")
def testObsDecamQuick(self):
"""Test obs_decam"""
self.assertExecutable("runDecamQuickTest.sh",
root_dir=executable_dir,
msg="DECam Quick Test failed")
if __name__ == "__main__":
lsst.utils.tests.init()
unittest.main()
def libraryLoaderEnvironment():
libpathstr = ""
# If we have an OS X with System Integrity Protection enabled or similar we need
# to pass through DYLD_LIBRARY_PATH to the external command.
pass_through_var = libraryPathPassThrough()
if pass_through_var is not None:
for varname in (pass_through_var, "LSST_LIBRARY_PATH"):
if varname in os.environ:
libpathstr = '{}="{}"'.format(pass_through_var, os.environ[varname])
break
return libpathstr
Should this be changed to always providing both on Darwin?