flux-core,flux-sched: fix environments with external flux (#44775)

This commit is contained in:
Ian Lumsden 2024-07-31 12:36:51 -07:00 committed by GitHub
parent 5541a184d5
commit ad26dcfbfc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View File

@ -181,6 +181,12 @@ def setup_build_environment(self, env):
env.append_path("LUA_PATH", "./?.lua", separator=";")
def setup_run_environment(self, env):
# If this package is external, we expect the external provider to set things
# like LUA paths. So, we early return. If the package is not external,
# properly set these environment variables to make sure the user environment
# is configured correctly
if self.spec.external:
return
env.prepend_path(
"LUA_PATH", os.path.join(self.spec.prefix, self.lua_share_dir, "?.lua"), separator=";"
)

View File

@ -166,6 +166,12 @@ def lua_lib_dir(self):
return os.path.join("lib", "lua", str(self.lua_version))
def setup_run_environment(self, env):
# If this package is external, we expect the external provider to set
# things like LUA paths. So, we early return. If the package is not
# external, properly set these environment variables to make sure the
# user environment is configured correctly
if self.spec.external:
return
env.prepend_path(
"LUA_PATH", os.path.join(self.spec.prefix, self.lua_share_dir, "?.lua"), separator=";"
)