splicing: keep the package hash of automatically spliced specs - #52862
Open
haampie wants to merge 3 commits into
Open
splicing: keep the package hash of automatically spliced specs#52862haampie wants to merge 3 commits into
haampie wants to merge 3 commits into
Conversation
haampie
force-pushed
the
hs/fix/splice-keeps-package-hash
branch
2 times, most recently
from
August 7, 2026 13:05
561227f to
33f70f6
Compare
Contributor
|
This all looks good to me. |
A spliced node ends up concrete without a package hash, so its dag hash is computed without the package_hash field. Besides checking the package hash directly, the test compares the dag hash against a from-scratch recomputation that re-derives package hashes from the repo. Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
The intent of `clear_caches(ignore=("package_hash",))` was to preserve
the package hash of a spliced node, but the cached attribute is named
`_package_hash`, so the ignore tuple matched nothing and the hash was
cleared.
The spliced node stays concrete from the copy, and
`_finalize_concretization` assigns package hashes only to non-concrete
nodes, so the cleared hash was never restored. The node dict then lacks
the `package_hash` field, which changes the dag hash.
Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
A typo in the ignore tuple silently cleared the hash it meant to preserve; now it fails loudly. Signed-off-by: Harmen Stoppels <me@harmenstoppels.nl>
haampie
force-pushed
the
hs/fix/splice-keeps-package-hash
branch
from
August 18, 2026 07:27
33f70f6 to
9689403
Compare
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.
Spec.clear_cachesmatches itsignoreargument against hash attribute names, which for the package hash is_package_hash. The call in_resolve_collected_splicespassedpackage_hashwithout the leading underscore, so the ignore never matched and the package hash was cleared along with everything else. CompareSpec._splice_detach_and_add_dependents, which passesht.package_hash.attr.The spliced node stays concrete from the copy, and
_finalize_concretizationassigns package hashes only to non-concrete nodes, so the cleared hash was never restored. Its dag hash is then computed from a node dict that has nopackage_hashkey at all.This changes the dag hash of automatically spliced specs.
The first commit adds a failing test that demonstrates the bug. The second commit fixes the
ignorevalue. The third commit makesclear_cachesvalidate itsignorevalues to catch future typos.