-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
python3Packages.pip: allow setting reproducible temporary directory via NIX_PIP_INSTALL_TMPDIR #91272
Conversation
This way pip will always listen to the TMPDIR var, also when not used within a Nix build, and also for other operations. Maybe following is a better place https://github.com/pypa/pip/blob/642fb07337a084252ae43c6b596dc18e434b2807/src/pip/_internal/operations/install/wheel.py#L676. Something like |
Yeah, less code to maintain, i like it. |
even more specific name |
…ia NIX_PIP_INSTALL_TMPDIR
It seems to work as expected too, both python2 and python3. |
We compile from tar.gz, instead of using pre-built binary wheels from PyPI. (or if the dep is pure-python, use tar.gz instead of "source-only" wheel) ----- Some unorganised things below for future reference. ``` $ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory --- triple: 'x86_64-apple-darwin' binary-path: 'dist1/hid.cpython-39-darwin.so' ... ``` ``` $ nm -pa dist1/hid.cpython-39-darwin.so ``` - https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable - pypa/pip#6505 - pypa/pip#7808 (comment) - NixOS/nixpkgs#91272 - cython/cython#1576 - https://github.com/cython/cython/blob/9d2ba1611b28999663ab71657f4938b0ba92fe07/Cython/Compiler/ModuleNode.py#L913
We compile from tar.gz, instead of using pre-built binary wheels from PyPI. (or if the dep is pure-python, use tar.gz instead of "source-only" wheel) ----- Some unorganised things below for future reference. ``` $ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory --- triple: 'x86_64-apple-darwin' binary-path: 'dist1/hid.cpython-39-darwin.so' ... ``` ``` $ nm -pa dist1/hid.cpython-39-darwin.so ``` - https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable - pypa/pip#6505 - pypa/pip#7808 (comment) - NixOS/nixpkgs#91272 - cython/cython#1576 - https://github.com/cython/cython/blob/9d2ba1611b28999663ab71657f4938b0ba92fe07/Cython/Compiler/ModuleNode.py#L913
We compile from tar.gz, instead of using pre-built binary wheels from PyPI. (or if the dep is pure-python, use tar.gz instead of "source-only" wheel) ----- Some unorganised things below for future reference. ``` $ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory --- triple: 'x86_64-apple-darwin' binary-path: 'dist1/hid.cpython-39-darwin.so' ... ``` ``` $ nm -pa dist1/hid.cpython-39-darwin.so ``` - https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable - pypa/pip#6505 - pypa/pip#7808 (comment) - NixOS/nixpkgs#91272 - cython/cython#1576 - https://github.com/cython/cython/blob/9d2ba1611b28999663ab71657f4938b0ba92fe07/Cython/Compiler/ModuleNode.py#L913
We compile from tar.gz, instead of using pre-built binary wheels from PyPI. (or if the dep is pure-python, use tar.gz instead of "source-only" wheel) ----- Some unorganised things below for future reference. ``` $ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory --- triple: 'x86_64-apple-darwin' binary-path: 'dist1/hid.cpython-39-darwin.so' ... ``` ``` $ nm -pa dist1/hid.cpython-39-darwin.so ``` - https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable - pypa/pip#6505 - pypa/pip#7808 (comment) - NixOS/nixpkgs#91272 - cython/cython#1576 - https://github.com/cython/cython/blob/9d2ba1611b28999663ab71657f4938b0ba92fe07/Cython/Compiler/ModuleNode.py#L913
Motivation for this change
Another approach to #81441 as #90208 caused too many regressions.
With this patch
pip
will useNIX_PIP_INSTALL_TMPDIR
as temporary directory when defined, usual code path will be used otherwise.I've built some packages to make sure it's working:
pkgs.python2Packages.flask
pkgs.python2Packages.invoke
pkgs.python3Packages.flask
pkgs.python3Packages.invoke
pkgs.python3Packages.aiohttp
- not reproducible (most likely unrelated)pkgs.gtk-doc
nixos.iso_minimal.x86_64-linux
- not reproducible (obvious)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)