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
setuptools: stable file ordering for sdist #105680
setuptools: stable file ordering for sdist #105680
Conversation
We already re-pack the source distribution to make the timestamps consistent, but the result is still not entirely stable because by default tar does not sort the files in the archive deterministically. This PR makes sure the entries are sorted by name. NixOS#105502
I wonder whether we should have a setup hook for
|
I think that might be a good idea if we encounter this a few more times on the r13y journey. Right now it is the only place we've seen that being required? |
Using grep shows we use it for
We don't tar so often, however, if I would use tar in a |
Ok, then that might be warranted. :) |
Note however that adding the hook to |
You may call it "abuse", but this is definitely an extremely common usage of |
Well this is what |
I am aware of that, and it is why I mentioned it. It is also the reason why issues related to hooks are opened; many don't seem to get that
Which is why I suppose we would have to wait for the release of |
Is there any downside to sorting archives by name by default? Do people rely on file sorting in archives? That sounds a bit like a hack. |
I agree I don't expect people to rely on the ordering. I'm less sure about the mtime, though. |
SOURCE_DATE_EPOCH is not set in the nix-shell environment so we could rely on that to conditionally activate both flags. |
Then |
I like the idea of adding a gnutar setup hook, but since it appears it's not trivial to decide what that should look like exactly, perhaps we should merge this as-is and create a new issue for the more general solution? |
Hey, don't know what this PR is all about, but setuptools needs an update: https://github.com/pypa/setuptools/releases
I've updated it anyway with |
Motivation for this change
We already re-pack the source distribution to make the
timestamps consistent, but the result is still not
entirely stable because by default tar does not sort
the files in the archive deterministically. This PR
makes sure the entries are sorted by name.
#105502
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)