Python: merge expressions of interpreters#53123
Conversation
889b1c8 to
7e13a16
Compare
e09dcd7 to
baf965e
Compare
5fa8ca8 to
4a8932b
Compare
|
I will have a look at cross-compiling once the conflict is resolved. |
|
@Mic92 not sure whether to trust this function: |
92428dc to
9aed1fb
Compare
|
@FRidh what's wrong with the output? Afaik we build with gcc for musl. |
pkgs/development/interpreters/python/build-python-package-setuptools.nix
Outdated
Show resolved
Hide resolved
|
yes, I mixed host and build up when I wrote that. |
pkgs/development/interpreters/python/build-python-package-setuptools.nix
Outdated
Show resolved
Hide resolved
|
Very glad this is happening! I started something like the once, but it appears I lost it haha. |
999bbb6 to
f82cc80
Compare
e4eca87 to
99faaf7
Compare
Ericson2314
left a comment
There was a problem hiding this comment.
It's looking really good!
There was a problem hiding this comment.
Bootstrapped pip is used at build time and so should be a nativeBuildInput.
There was a problem hiding this comment.
Alternatively, since you use it explicitly below, maybe it doesn't need to be any sort of imput.
There was a problem hiding this comment.
Good catch. I don't think we actually need it as a build input. We call it already from the store path, and Python packages should never call or import from pip. Doesn't mean they won't do it though...
There was a problem hiding this comment.
So, we do need it as *buildInput. While it is indeed supposed to be nativeBuildInput, putting it there breaks cross-compilation for me, likely because at the moment something wrong is happening yet it looks alright. I'll keep this issue for another day.
There was a problem hiding this comment.
N.B. this is fine, but won't need it once bootstrapped-pip is a nativeBuildInput.
There was a problem hiding this comment.
In future autoPatchelfHook could make this process easier and less error-prone.
Each time a new major/minor version of CPython was released, a new expression would be written, typically copied from the previous release. Often fixes are only made in the current/latest release. By merging the expressions it's more likely that modifications end up in all versions, as is likely intended. This commit introduces one expression for Python 3, and another for 2.7. These two may also be merged, but it will result in a lot of extra conditionals making the expression harder to follow. A common passthru is introduced for CPython and PyPy. python 2.7: use common passthru
This commit merges the two expressions in a single one, using the passthru function that is shared with CPython.
This changeset allows for cross-compilation of Python packages. Packages built with buildPythonPackage are not allowed to refer to the build machine. Executables that have shebangs will refer to the host.
Drop `python.majorVersion`. For Python language version, use `python.pythonVersion`. For implementation version, use `python.sourceVersion`. Some expressions were broken. Those that were identified were fixed. fixup major
These interpreters are prebuilt by upstream and patched using patchelf. They are primarily added for testing purposes and development on the non-prebuilt PyPy interpreters as it can speed up translation significantly.
python.majorVersionattributeThings done
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)