setuptools: stable file ordering for sdist

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.

https://github.com/NixOS/nixpkgs/issues/105502
This commit is contained in:
Arnout Engelen 2020-12-02 11:11:28 +01:00 committed by Frederik Rietdijk
parent b46c670ed9
commit 17c840055e

View File

@ -38,7 +38,7 @@ let
# Here we untar the sdist and retar it in order to control the timestamps # Here we untar the sdist and retar it in order to control the timestamps
# of all the files included # of all the files included
tar -xzf dist/${pname}-${version}.post0.tar.gz -C dist/ tar -xzf dist/${pname}-${version}.post0.tar.gz -C dist/
tar -czf dist/${name} -C dist/ --mtime="@$SOURCE_DATE_EPOCH" ${pname}-${version}.post0 tar -czf dist/${name} -C dist/ --mtime="@$SOURCE_DATE_EPOCH" --sort=name ${pname}-${version}.post0
''; '';
installPhase = '' installPhase = ''