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 extendee_spec for transitive dependencies on potential extendees #48025

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

becker33
Copy link
Member

fixes #48024

Only consider transitive dependencies in extendee_spec().

@spackbot-app spackbot-app bot added core PR affects Spack core functionality tests General test capability(ies) labels Dec 11, 2024
psakievich
psakievich previously approved these changes Dec 11, 2024
@haampie
Copy link
Member

haampie commented Dec 11, 2024

Is this also the time and place to fix

depends_on("python")
extends("python", when="@2:")

if I read the code correctly just having a dependency is sufficient to extend something, completely ignoring the when condition of the extends directive. I find the current test a bit "deceiving" because you could interpret it as testing "conditionally extending a dependency" but in reality it tests "extending a conditional dependency".

If that's not fixed in this PR, which is fine by me, then should we at least leave a comment noting the limitations of when / what is not tested?

@haampie
Copy link
Member

haampie commented Dec 12, 2024

generally lgtm now 👍 could still use a test to cover the case when the dependency is there but it is not extended because the when condition doesn't apply

dep
for dep in self.spec.dependencies(deptype=("link", "run"))
for d, when in self.extendees.values()
if dep.satisfies(d) and self.spec.satisfies(when)
Copy link
Member

Choose a reason for hiding this comment

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

dep.satisfies(d) is true by construction, but maybe you added this check defensively?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, added because I can imagine future changes that would make it not true by construction -- like if we allow separate concretization of run deps in the future. Agreed that it is not relevant for current specs.

Co-authored-by: Harmen Stoppels <[email protected]>
@becker33
Copy link
Member Author

generally lgtm now 👍 could still use a test to cover the case when the dependency is there but it is not extended because the when condition doesn't apply

That's covered by test_conditionally_extends_direct_dep

@psakievich
Copy link
Contributor

Are we waiting on something to merge this? @haampie sounds like all concerns are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core PR affects Spack core functionality dependencies directives extends new-version tests General test capability(ies)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package.extendee_spec does not respect conditional extends when extended package is transitively dependent
3 participants