forked from pypa/pip
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
reproducible directories for pip builds
Currently, pip randomly assigns directory names when it builds Python sdists into bdists. This can result in randomized file paths being embedded into the build output (usually in debug symbols, but potentially in other places). The ideal solution would be to trim the front (random part) of the file path off, leaving the remaining (deterministic) part to embed in the binary. Doing so would require reaching deep into the configuration of whatever compiler/linker pip happens to be using (e.g. gcc, clang, rustc, etc.). This option, on the other hand, doesn't require modifying the internals of Python packages. In this patch we make it so that pip's randomly assigned directory paths are instead generated from a deterministic counter. Doing so requires exclusive access to TMPDIR, because otherwise other programs (likely other executions of `pip`) will attempt to create directories of the same name. For that reason, the feature only activates when SOURCE_DATE_EPOCH is set. For more discussion (and prior art) in this area, see: * https://github.com/NixOS/nixpkgs/pull/102222/files * pypa#6505
- Loading branch information
1 parent
c53d88c
commit 7551ec0
Showing
5 changed files
with
54 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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