-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flux-core and flux-sched: disables environment variable setting for externally found Flux #44775
base: develop
Are you sure you want to change the base?
Conversation
This LGTM, but I don't think I know enough about spack to fully review this one. @vsoch might be a better candidate for reivew. For externally found packages, does spack really use the environment provided by the spack package? Shouldn't it just ignore the spack package for external packages, since they are coming from the default environment? (I'm wondering if we're doing something else wrong in the flux packages that caused this bug) |
Also, I'm not sure if the spack project has any guidelines for commit messages, but I'd suggest shorting the commit subjects here and adding something to the body, e.g.
|
This change is saying that if flux is provided as an external, it's up to the external provider to set the LUA paths, which I think is logical. The issue is that adding it as an external is going to look for spec with lua, and that likely is not present if lua was only a dependent for flux. It would still not work to add it, because it might be an actual mismatch in version. My only critique might be to check for external and just return early, e.g.,: # If flux-X is provided as an external, the developer is responsible for the
# install of LUA and setting these paths.
if self.spec.external:
return and then not indent the rest of the function. It would also be good to add a comment above that, explaining the logic for a future package.py reader. |
0688842
to
b9bb71a
Compare
Nice! I'd just squash to two commits for each package, since the second commit undoes most of the first. Thanks for doing this! |
Adds a conditional that skips environment variable setting (e.g., LUA_PATH, LUA_CPATH) when flux-core is externally installed. Also, adds comments describing why we do this
Adds a conditional that skips environment variable setting (e.g., LUA_PATH, LUA_CPATH) when flux-core is externally installed. Also, adds comments describing whey we do this
b9bb71a
to
af1d5f4
Compare
@grondo just squashed the commits |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks!
While trying to test a Spack package I am currently developing for a new benchmark in Benchpark, I found that environments where Flux is found externally (i.e.,
flux-core
in thepackages
section ofspack.yaml
) will fail to install. When digging into this issue, I found that the root of the problem was the use ofself.spec["lua"]
to set environment variables (e.g.,LUA_PATH
andLUA_CPATH
) in thesetup_run_environment
function of theflux-core
package. So, this issue I ran into is essentially a variant of #9149.However, in the case of
flux-core
, this issue can be easily fixed by adding a conditional that disables the code usingself.spec["lua"]
whenflux-core
is external. Additionally, since the environment variables set insetup_run_environment
should already by set for an external install, this change could avoid possible corner cases that might have popped up when using an external install of Flux (e.g., the system-wide install on Corona, which is where I encountered this issue).Finally, I also noticed the same logic regarding
self.spec["lua"]
and environment variables in theflux-sched
package, so I've also applied this fix to that package.