Skip to content
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

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Feb 10, 2022

I have two-fold motivations for this:

  1. I'm trying to use reframe with spack build system on a system where activating shell support seems to screw something up
  2. not enabling shell support lets us skip the line
    cmds = ['. "$(spack location --spack-root)/share/spack/setup-env.sh"']
    which is very useful when using https://github.com/eth-cscs/spack-batteries-included/ with the single squashfs file (there is no material $(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 of SPACK_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 🙂

@pep8speaks
Copy link

pep8speaks commented Feb 10, 2022

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

@jenkins-cscs
Copy link
Collaborator

Can I test this patch?

@giordano giordano force-pushed the mg/spack-no-shell-support branch from 6d33130 to 45a1e86 Compare February 10, 2022 17:22
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]`
Copy link

@haampie haampie Feb 11, 2022

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])"

Copy link

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)

Copy link

@haampie haampie Feb 11, 2022

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 :(

Copy link
Contributor

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.

@giordano
Copy link
Contributor Author

Bump 🙂

Copy link
Contributor

@victorusu victorusu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@vkarak vkarak added this to the ReFrame Sprint 22.02.1 milestone Feb 16, 2022
@vkarak
Copy link
Contributor

vkarak commented Feb 16, 2022

ok to test

Copy link
Contributor

@vkarak vkarak left a 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]`
Copy link
Contributor

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-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

Merging #2424 (4de4c58) into master (910e739) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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              
Impacted Files Coverage Δ
reframe/core/buildsystems.py 96.20% <100.00%> (-0.03%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 910e739...4de4c58. Read the comment docs.

@vkarak vkarak merged commit 44d1d02 into reframe-hpc:master Feb 17, 2022
@giordano giordano deleted the mg/spack-no-shell-support branch March 7, 2022 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants