Separate setting build environment and run environment in packages#11115
Merged
becker33 merged 11 commits intospack:developfrom Oct 17, 2019
Merged
Separate setting build environment and run environment in packages#11115becker33 merged 11 commits intospack:developfrom
becker33 merged 11 commits intospack:developfrom
Conversation
Member
Author
|
I added this PR as a draft to collect opinions on splitting the two methods before proceeding with docs and tests. If you don't have major concerns on what's being done here we can use the PR also to improve the APIs in |
becker33
requested changes
Apr 9, 2019
Member
becker33
left a comment
There was a problem hiding this comment.
I didn't do a particularly deep review, just the one comment for now.
I think this is probably a good direction to be moving in.
Member
|
No deep review yet, but this is a much cleaner, less confusing direction than the current state of affairs. I'm in favor! |
6060f2b to
74034f3
Compare
Member
Author
|
Ready for a review from my side. The description at the top should be up to date. Unit tests have been added and docs updated. |
This was referenced Oct 11, 2019
Before this commit the `*_environment` methods were setting modifications to both the build-time and run-time environment simultaneously. This might cause issues as the two environments inherently rely on different preconditions: 1. The build-time environment is set before building a package, thus the package prefix doesn't exist and can't be inspected 2. The run-time environment instead is set assuming the target package has been already installed Here we split each of these functions into two: one setting the build-time environment, one the run-time. We also adopt a fallback strategy that inspects for old methods and executes them as before, but prints a deprecation warning to tty. This permits to port packages to use the new methods in a distributed way, rather than having to modify all the packages at once.
Also, emit a debug warning to avoid polluting messages on tty.
Marked the test xfail for now as we have a lot of packages in that state.
This test can be used any time we deprecate a method call to ensure that during the first modification of the package we update also the deprecated calls.
becker33
approved these changes
Oct 17, 2019
This was referenced Oct 25, 2019
Merged
Merged
This was referenced Oct 28, 2019
jrmadsen
pushed a commit
to jrmadsen/spack
that referenced
this pull request
Oct 30, 2019
…pack#11115) * Methods setting the environment now do it separately for build and run Before this commit the `*_environment` methods were setting modifications to both the build-time and run-time environment simultaneously. This might cause issues as the two environments inherently rely on different preconditions: 1. The build-time environment is set before building a package, thus the package prefix doesn't exist and can't be inspected 2. The run-time environment instead is set assuming the target package has been already installed Here we split each of these functions into two: one setting the build-time environment, one the run-time. We also adopt a fallback strategy that inspects for old methods and executes them as before, but prints a deprecation warning to tty. This permits to port packages to use the new methods in a distributed way, rather than having to modify all the packages at once. * Added a test that fails if any package uses the old API Marked the test xfail for now as we have a lot of packages in that state. * Added a test to check that a package modified by a PR is up to date This test can be used any time we deprecate a method call to ensure that during the first modification of the package we update also the deprecated calls. * Updated documentation
Closed
olesenm
added a commit
to olesenm/spack
that referenced
this pull request
Nov 8, 2019
- build: no special treatment - already addressed in the spack-Allwmake script - run: use environment from the OpenFOAM etc/bashrc
olesenm
added a commit
to olesenm/spack
that referenced
this pull request
Nov 8, 2019
- build: no special treatment - already addressed in the spack-Allwmake script - run: use environment from the OpenFOAM etc/bashrc
adamjstewart
pushed a commit
that referenced
this pull request
Nov 8, 2019
ax3l
added a commit
to psychocoderHPC/spack
that referenced
this pull request
Nov 25, 2019
adamjstewart
pushed a commit
that referenced
this pull request
Nov 25, 2019
* add package [email protected] add CUDA 10.2 support * CudaPackage: Add 10.2 Conflicts * CUDA: Modernize Run Environment See #11115
jasonfenglu
added a commit
to jasonfenglu/spack
that referenced
this pull request
Mar 24, 2020
jasonfenglu
added a commit
to jasonfenglu/spack
that referenced
this pull request
Mar 26, 2020
fangohr
added a commit
to fangohr/oommf-in-spack
that referenced
this pull request
Sep 30, 2021
split setup_environment (see spack/spack#11115)
fangohr
added a commit
to fangohr/oommf-in-spack
that referenced
this pull request
Sep 30, 2021
split setup_environment (see spack/spack#11115)
3 tasks
alalazo
added a commit
to alalazo/spack
that referenced
this pull request
Mar 11, 2022
fixes spack#29446 The new setup_*_environment functions have been falling back to calling the old functions and warn the user since spack#11115. This commit removes the fallback behavior and any use of: - setup_environment - setup_dependent_environment in the codebase
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #6143
fixes #2016
refers to #2016 (comment)
As a package maintainer I want different methods to specify the build-time environment and the run-time environment of a package, so that I will know exactly which are the preconditions of the method that is being called.
Rationale
Currently each package can override two methods:
to modify its build or run environment, or those of a dependent. This has a fundamental issue in that the same method will be called at different times, and will have different preconditions depending when it's called:
This in turn might cause issues like #6143 or #2016 (comment). In this PR we split each of the two methods above, e.g. :
so that it will be clear which are the preconditions of each method call.
Description
This PR splits each
*_environmentmethod inspack.package.PackageBaseinto two: one that will be called for the build-time environment and one that wil be called for the run-time. As there are a lot of packages overriding these callbacks the default implementation is such to mimic the legacy behavior, and emit a deprecation warning totty.debug, e.g.:Additional information
setup_environmentinto two methodssetup_dependent_environmentinto two methodsxfail(it will be useful when all packages are ported, in case of people doing PR based on old behavior)