python3Packages.msgspec: fix src hash#416464
Merged
wolfgangwalther merged 1 commit intoNixOS:stagingfrom Sep 11, 2025
Merged
Conversation
ced6cc0 to
adfdfe3
Compare
The source hash changes because they use `$Format:%d$` in their code, and GitHub can substitute this with different things in different times, see NixOS#84312. In this case, the diff looks like this: ``` diff -ur /nix/store/v2yfg05q83i154bdi2s96g21zi079rgi-source/msgspec/_version.py /nix/store/94zddrfms1ikx61i0plxnqdd3gavfdzr-source/msgspec/_version.py --- /nix/store/v2yfg05q83i154bdi2s96g21zi079rgi-source/msgspec/_version.py 1970-01-01 00:00:01.000000000 +0000 +++ /nix/store/94zddrfms1ikx61i0plxnqdd3gavfdzr-source/msgspec/_version.py 1970-01-01 00:00:01.000000000 +0000 @@ -24,7 +24,7 @@ # setup.py/versioneer.py will grep for the variable names, so they must # each be defined on a line of their own. _version.py will just call # get_keywords(). - git_refnames = " (HEAD -> main, tag: 0.19.0)" + git_refnames = " (tag: 0.19.0)" git_full = "dd965dce22e5278d4935bea923441ecde31b5325" git_date = "2024-12-27 11:06:58 -0600" keywords = {"refnames": git_refnames, "full": git_full, "date": git_date} ``` Fix the hash and add a comment explaining the situation.
78ade22 to
e72eda8
Compare
Contributor
|
Re-running CI due to a odd failure fixed in #416448 (the fix wasn't on staging earlier, yet) |
8 tasks
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
YorikSar
added a commit
to tweag/nixpkgs
that referenced
this pull request
Jul 21, 2025
Add a hook that would fix a common issue with projects using Versioneer
on GitHub: when GitHub runs analog of `git archive` to generate an
archive from a tag, it subsitutes `$Format:%d$` with `(HEAD -> main,
tag: the_tag)` when the tag points to the latest commit, but when more
commits are added, it becomes `(tag: the_tag)`, which changes source
hash.
Packages that are either automatically or manually updated early, get
source with this `HEAD -> main` part and so their sources are not
reproducible more often.
Adding this hook to projects that use Versioneer will remove this
`HEAD -> main` part of the description string and make the source
reproducible. Here's how it would look, for example:
src = fetchFromGitHub {
owner = "ANCPLabOldenburg";
repo = "ancp-bids";
tag = version;
hash = "sha256-vmw8SAikvbaHnPOthBQxTbyvDwnnZwCOV97aUogIgxw=";
nativeBuildInputs = [ fixVersioneerSourcesHook ];
};
I ran into this issue when preparing
NixOS#416464, the general case of this
issue is described in NixOS#84312.
Erethon
approved these changes
Sep 10, 2025
Contributor
Erethon
left a comment
There was a problem hiding this comment.
I ran into this myself, this fixes it and LGTM, thank you.
Contributor
|
Successfully created backport PR for |
1 task
Member
|
Man, using |
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.
The source hash changes because they use
$Format:%d$in their code, and GitHub can substitute this with different things in different times, see #84312.In this case, the diff looks like this:
Fix the hash and add a comment explaining the situation.
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usageAdd a 👍 reaction to pull requests you find important.