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

Fix #12228: make environments and --config-scope work #14608

Merged

Conversation

ChristianTackeGSI
Copy link
Member

@ChristianTackeGSI ChristianTackeGSI commented Jan 23, 2020

fixes #12228

The issue has all the relevant details. Basically an activated environment and --config-scope do not work together.

The fix is by Tim Fuller @tjfulle who gets all the credit for analyzing the problem and suggesting this fix.

The fix looks reasonable to me, so I decided to create a PR from it.

@tjfulle
Copy link
Contributor

tjfulle commented Jan 23, 2020

Thanks @ChristianTackeGSI , I've been swamped with other work and stopped using spack environments for several reasons, so this issue fell down my priority list.

@ChristianTackeGSI
Copy link
Member Author

It looks like I should create some unit tests?

I have looked into calling main() from inside test cases.
I need some HELP by the core developers to create those tests.

@alalazo alalazo added bugfix Something wasn't working, here's a fix environments labels Feb 4, 2020
@alalazo
Copy link
Member

alalazo commented Feb 4, 2020

It looks like I should create some unit tests? [ ... ] I need some HELP by the core developers to create those tests.

You can have a look at tests in the lib/spack/spack/test/cmd/env.py module. Feel free to ping if something is not clear.

@ChristianTackeGSI
Copy link
Member Author

@alalazo
Well, the code in question is more about command line parameter handling in main() then really about environments. And I haven't seen any tests about main() really.

@adamjstewart
Copy link
Member

@alalazo any more suggestions on testing this?

spack#12228
  --config-scope incompatible with environments

The issue has all the relevant details.
Basicly an activated environment and --config-scope do not
work together.

The fix is by Tim Fuller @tjfulle who gets all the credit
for analyzing the problem and suggesting this fix.

The fix looks reasonable to me, so I decided to create a
PR from it.
@scheibelp
Copy link
Member

Close/reopen to restart tests

@scheibelp scheibelp closed this Jul 20, 2020
@scheibelp scheibelp reopened this Jul 20, 2020
@scheibelp scheibelp merged commit bd23691 into spack:develop Jul 20, 2020
@scheibelp
Copy link
Member

Thanks @ChristianTackeGSI and @tjfulle for working on this!

@ChristianTackeGSI ChristianTackeGSI deleted the pr/12228-fix-env-and-config-scope branch July 21, 2020 16:24
@ChristianTackeGSI
Copy link
Member Author

Thanks @scheibelp ! :-)

dennisklein pushed a commit to FairRootGroup/spack that referenced this pull request Aug 10, 2020
…pack#14608)

Spack did not support usage of the `--config-scope` option in
combination with an environment: In `lib/spack/spack/main.py`,
`spack.config.command_line_scopes` is set equal to any config scopes
passed by the `--config-scope` option. However, this is done after
activating an environment. In the process of activating an environment,
the `spack.config.config` singleton is instantiated, so later setting of
`spack.config.command_line_scopes` is ignored.

This commit sets command line scopes before activating an environment to
ensure that they are included in the configuration.

Co-authored-by: Tim Fuller <tjfulle@sandia.gov>
dennisklein pushed a commit to FairRootGroup/spack that referenced this pull request Aug 20, 2020
…pack#14608)

Spack did not support usage of the `--config-scope` option in
combination with an environment: In `lib/spack/spack/main.py`,
`spack.config.command_line_scopes` is set equal to any config scopes
passed by the `--config-scope` option. However, this is done after
activating an environment. In the process of activating an environment,
the `spack.config.config` singleton is instantiated, so later setting of
`spack.config.command_line_scopes` is ignored.

This commit sets command line scopes before activating an environment to
ensure that they are included in the configuration.

Co-authored-by: Tim Fuller <tjfulle@sandia.gov>
Jordan474 pushed a commit to Jordan474/spack that referenced this pull request Feb 10, 2021
…pack#14608)

Spack did not support usage of the `--config-scope` option in
combination with an environment: In `lib/spack/spack/main.py`,
`spack.config.command_line_scopes` is set equal to any config scopes
passed by the `--config-scope` option. However, this is done after
activating an environment. In the process of activating an environment,
the `spack.config.config` singleton is instantiated, so later setting of
`spack.config.command_line_scopes` is ignored.

This commit sets command line scopes before activating an environment to
ensure that they are included in the configuration.

Co-authored-by: Tim Fuller <tjfulle@sandia.gov>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Something wasn't working, here's a fix environments
Projects
None yet
Development

Successfully merging this pull request may close these issues.

--config-scope incompatible with environments
5 participants