-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
buildPython*: support fixed-point attributes #271387
base: master
Are you sure you want to change the base?
Conversation
input-remapper part looks good, you'll probably get a merge conflict if #249777 gets merged first |
Thank you for reviewing.
That one is easy to resolve. No worries. |
Is this automatically done because the wrapper are shared or required extra codes changes? If it is the latter I am inclined to not add it to stronger underline the EOL status of python 2. |
@@ -26,6 +26,23 @@ | |||
, eggInstallHook | |||
}: | |||
|
|||
let |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure about this but we could we just not add support for python 2 to move it closer to removal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still relevant because it is used by pypy2.pkgs.buildPython*
. and that PyPy says that they will continue to support PyPy 2, as RPython (the language they use to implement the PyPy interpreter) is essentially a Python 2 subset.
pkgs/by-name/py/pyspread/package.nix
Outdated
inherit (finalAttrs) version; | ||
hash = "sha256-vbBu/dMXQf14F7qWvyHX5T8/AkjeZhaQt1eQ6Nidpsc="; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like this pattern, when only changing version it silently makes the FOD none reproducible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like fetchpypi doesn't let you pass in anything that sends up in the source derivation's name
inherit url sha256 hash; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In xrootd.passthru.tests.test-xrdcp
, I pass a version
to the FOD that consists of <xrootd version from finalAttrs>-<xrootd drv hash from finalAttrs>
to make it rebuilds everytime xrootd
gets rebuild.
The version
trick might also be suitable for source FODs. However, for vendoring FODs, it could be a waste of time and space to rebuild when the vendorHash remains the same.
The ultimate solution might be a mechanism to generate automatic passthru.tests
for all the FOD passed into stdenv.mkDerivaiton
. Automatically-generated passthru.tests
test cases could also be a way to run ShellCheck against build commands (#21166).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case of fetchPypi
, the outPath
changes when version
changes. The FOD package will be rebuild even when hash
isn't changed.
eb79c07
to
e942382
Compare
913d18b
to
523affa
Compare
Restructure the derivation to prepare for - fixed-point arguments support - overridePythonAttrs deprecation
Fix `makeOverridablePythonPackage` in python-package-base.nix and unshadow `buildPython*.override`. This makes it possible to override the dependencies of buildPython*. E.g., `buildPythonPackage.override { unzip = unzip-custom; }` returns a derived version of `buildPythonPackage` with the `unzip` package overridden with `unzip-custom`.
Test with pip, which is less likely to fail. Modularize the transforming function and testing function. Co-authored-by: Sandro <[email protected]>
Make it possible to mix overridePythonAttrs and overrideAttrs, i.e. ((<pkg>.overrideAttrs (_: { foo = "a"; })).overridePythonAttrs (_: { })).foo now works
523affa
to
bfc715d
Compare
bfc715d
to
b91155b
Compare
b91155b
to
78cf1c5
Compare
Description of changes
This PR enables the fixed-point arguments support in
buildPythonPackage
andbuildPythonApplication
for Python 2 and 3 with slight modification againstmk-python-derivation.nix
with no rebuilds.Prerequisites:
<pkg>.overridePythonAttrs
work after<pkg>.overrideAttrs
#267296stdenv
customization through(buildPython*.override { inherit stdenv; })
#271762overridePythonAttrs
deprecation #375921I will rebase this feature branch once the dependent PRs merge. The diff will be greatly shortened then.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Priorities
Add a 👍 reaction to pull requests you find important.