-
Notifications
You must be signed in to change notification settings - Fork 293
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
base: main
Are you sure you want to change the base?
Conversation
… has been changed
let serialized = serde_json::to_vec(&project_model) | ||
.map_err(GlobHashError::ProjectModelSerialization)?; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
52ad017
to
e15cb56
Compare
There was a problem hiding this 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>, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.