Skip to content

fix: only trigger rebuild when relevant parts of the package manifest changed #3966

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

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

Hofer-Julian
Copy link
Contributor

@Hofer-Julian Hofer-Julian commented Jun 17, 2025

Fixes #3123

CI will only be green after prefix-dev/pixi-build-testsuite#8 is merged and vice versa.

I suggest to first merge the testsuite PR and restart CI for this one and merge it if CI is green.

@Hofer-Julian Hofer-Julian marked this pull request as ready for review June 18, 2025 13:36
Comment on lines +86 to +87
let serialized = serde_json::to_vec(&project_model)
.map_err(GlobHashError::ProjectModelSerialization)?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is pretty weird, but I couldn't find a way to just pass an object implementing Hash to Sha256.
And just hashing with the default hasher also seems like a bad idea, since it's not stable across Rust releases.

I'd appreciate better ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

We could use xxh3 hash which implements Hasher and seems stable enough and is much faster.

@Hofer-Julian Hofer-Julian force-pushed the feature/pix-396-only-trigger-rebuild-when-relevant-parts-of-the-package branch from 52ad017 to e15cb56 Compare June 18, 2025 13:44
@Hofer-Julian Hofer-Julian requested a review from baszalmstra June 18, 2025 14:09
Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

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

Nicely done! I have some comments but this is definitely in the right direction!

@@ -20,18 +22,28 @@ pub struct GlobHashKey {
root: PathBuf,
/// The glob patterns.
globs: BTreeSet<String>,
/// The project model.
project_model: Option<ProjectModelV1>,
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like quite a waste to have an owned type here. Perhaps we can use a generic lifetime?

Copy link
Contributor

Choose a reason for hiding this comment

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

Im not entirely happy that we have this type in here. Previously this type was very standalone and now we tie it to pixi_build_types.

Maybe we should extract computing the actual hash (including the project model) somewhere else.

If we refactor computing the hash by using the Hash trait, we can make it more extensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only trigger rebuild when relevant parts of the package manifest has been changed
2 participants