Skip to content

Disable EnvironmentModifications stack tracing#26706

Merged
alalazo merged 1 commit intospack:developfrom
haampie:fix/opt-in-of-env-modification-tracing
Oct 15, 2021
Merged

Disable EnvironmentModifications stack tracing#26706
alalazo merged 1 commit intospack:developfrom
haampie:fix/opt-in-of-env-modification-tracing

Conversation

@haampie
Copy link
Copy Markdown
Member

@haampie haampie commented Oct 13, 2021

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 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.


The upside for me is that this cuts down running spack unit-test by a minute.

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.
Copy link
Copy Markdown
Member

@alalazo alalazo left a comment

Choose a reason for hiding this comment

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

LGTM. One nitpick.

@alalazo alalazo self-assigned this Oct 15, 2021
@alalazo alalazo merged commit e0fbf09 into spack:develop Oct 15, 2021
@haampie haampie deleted the fix/opt-in-of-env-modification-tracing branch October 15, 2021 08:22
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.

2 participants