Skip to content

Retain the "direct" attribute of deps in "when" context manager#51256

Closed
alalazo wants to merge 1 commit intospack:developfrom
alalazo:bugfix/when-context-direct-dep
Closed

Retain the "direct" attribute of deps in "when" context manager#51256
alalazo wants to merge 1 commit intospack:developfrom
alalazo:bugfix/when-context-direct-dep

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Sep 1, 2025

refers #51248

The value of the "direct" attribute of dependencies is currently lost in "when" context managers. This PR fixes the issue and adds unit tests to prevent regressions

Currently, we can't use plain Spec.constrain in directives, since that function triggers lookup of the repository being constructed to resolve virtual dependencies. I'll check if that logic can be simplified in a following PR, and keep this one just for the bug fix.

fixes spack#51248

The value of the "direct" attribute of dependencies
is currently lost in "when" context managers.

This PR fixes the issue and adds unit tests to prevent
regressions

Signed-off-by: Massimiliano Culpo <[email protected]>
@alalazo alalazo added bugfix Something wasn't working, here's a fix v1.0.2 PRs / Bug fixes to backport for v1.0.2 labels Sep 1, 2025
@alalazo alalazo mentioned this pull request Sep 1, 2025
26 tasks
@haampie
Copy link
Copy Markdown
Member

haampie commented Sep 1, 2025

This does not close 51248

@alalazo
Copy link
Copy Markdown
Member Author

alalazo commented Sep 1, 2025

Changed to "refers to" 51248, but unclear to me if #51248 (comment) is relevant or why it was closed as outdated.

@alalazo alalazo closed this Sep 2, 2025
@alalazo alalazo deleted the bugfix/when-context-direct-dep branch September 2, 2025 08:01
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 v1.0.2 PRs / Bug fixes to backport for v1.0.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants