Disable EnvironmentModifications stack tracing#26706
Merged
alalazo merged 1 commit intospack:developfrom Oct 15, 2021
Merged
Conversation
Currently Spack keeps track of the origin in the code of any modification to the environment variables. This is very slow. In fact it's enabled unconditionally even in code paths where the origin of the modification is never queried. The only place where we inspect the origins of environment modifications is before we start a build, IF there's an override of the type `e.set(...)` after incremental changes like `e.append_path(..)`, which is a "suspicious" change. This is very rare though. If an override like this ever happens, it might mean a package is broken. If that leads to build errors, we can just ask the user to run `spack -d install ...` and check the warnings issued by Spack to find the origins of the problem.
Closed
alalazo
approved these changes
Oct 15, 2021
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.
TL;DR only track EnvironmentModifications origins under --debug.
Currently Spack keeps track of the origin in the code of any
modification to the environment variables. This is very slow. In fact
it's enabled unconditionally even in code paths where the origin of the
modification is never queried.
The only place where we inspect the origins of environment modifications
is before we start a build, IF there's an override of the type
e.set(...)after incremental changes likee.append_path(..), whichis a "suspicious" change.
This is very rare though.
If an override like this ever happens, it might mean a package is
broken. If that leads to build errors, we can just ask the user to run
spack -d install ...and check the warnings issued by Spack to findthe origins of the problem.
The upside for me is that this cuts down running spack unit-test by a minute.