-
Notifications
You must be signed in to change notification settings - Fork 109
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
[bugfix] Do not set up Spack shell support #2424
[bugfix] Do not set up Spack shell support #2424
Conversation
Hello @giordano, Thank you for updating! Cheers! There are no PEP8 issues in this Pull Request!Do see the ReFrame Coding Style Guide Comment last updated at 2022-02-17 18:21:14 UTC |
Can I test this patch? |
6d33130
to
45a1e86
Compare
spack env create -d rfm_spack_env | ||
spack env activate -V -d rfm_spack_env | ||
spack load [email protected] | ||
eval `spack -e rfm_spack_env load --sh [email protected]` |
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.
I think this is reasonable; either you use spack env activate
, or you use spack load
, but not both, cause spack env activate --sh
also returns shell-environment variables changes for the spack-environment root specs and their transient run/link type dependencies.
so, it's either eval "$(spack -e [env name] load --sh [spec name])"
where you use the environment as a filter to pick the just-built bzip2 from the spack installs, or assuming you only have one root spec in the environment, you do eval "$(spack env activate --sh [env name])"
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.
You can also put concretize: together
instead of the default concretize: separately
in the environment, and then you can be sure that spack env activate --sh ...
always works (cant have multiple bzip2's in one env then)
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.
not sure if you can change the value spack:concretize:...
from the command line though :(
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.
Users can pass a custom environment through the self.build_system.environment
option and reframe will not auto-generate the environment if they do.
Bump 🙂 |
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.
lgtm
ok to test |
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.
Lgtm, except a small code fix.
spack env create -d rfm_spack_env | ||
spack env activate -V -d rfm_spack_env | ||
spack load [email protected] | ||
eval `spack -e rfm_spack_env load --sh [email protected]` |
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.
Users can pass a custom environment through the self.build_system.environment
option and reframe will not auto-generate the environment if they do.
Codecov Report
@@ Coverage Diff @@
## master #2424 +/- ##
==========================================
- Coverage 85.66% 85.66% -0.01%
==========================================
Files 56 56
Lines 10460 10458 -2
==========================================
- Hits 8961 8959 -2
Misses 1499 1499
Continue to review full report at Codecov.
|
I have two-fold motivations for this:
reframe/reframe/core/buildsystems.py
Line 872 in f996fab
$(spack location --spack-root)/share/spack/setup-env.sh
file on disk, so this line would fail). Also, that line caused problems in the past (see Automatic handling ofSPACK_ROOT
? #2097, now solved), and not activating the shell support just makes things more transparent.As an added bonus, this PR has a negative net diff 🙂