Repository navigation
python39: backport patch to accomodate system library changes in Big Sur - #146477
Conversation
(cherry picked from commit 9738723b2486cfe9988abbff0c873cce5cba1849)
jonringer
left a comment
There was a problem hiding this comment.
LGTM, waiting on darwin maintainer. cc @NixOS/darwin-maintainers
This should probably be backported to 21.05 and 21.11
|
Since no one's chimed in yet, didn't want to have it seem like Darwin maintainers are ignoring it. I've been running a nixpkgs-review on this for the last two days. (Only building 3 Python packages.) |
|
To test this properly, pkgs.python39 needs to be built on macOS Catalina (or older), and copied over to macOS Big Sur. I'm guessing it should work to just copy the output path ( |
I think nix-copy-closure is the most convenient way, since it ensures the entire dependency graph is copied |
|
The three packages failed to build but there's nothing in the Here's part of the output.Unfortunately, I don't know which dependencies are failing to build and I can't look into this further in a timely fashion. Looking for other @NixOS/darwin-maintainers to check this out. |
Is your Nix store content-addressed? I can build these three packages on x86_64-darwin; I haven’t enabled that feature in my config. |
|
Result of 3 packages built:
|
I've tested this and can confirm it is working.My setup: Build machine:
default.nix: let
pkgs = import (fetchTarball "https://github.com/mweinelt/nixpkgs/archive/a43a2eacb322c3799aa6eadd0061db1a3c176b78.tar.gz") {};
in pkgs.python39nix-build default.nix
nix-copy-closure --to 192.168.0.19 /nix/store/ysjpxinb0fhd9nl96z12r59sz1wpy8b0-python3-3.9.6Test machine:
$ /nix/store/ysjpxinb0fhd9nl96z12r59sz1wpy8b0-python3-3.9.6/bin/python3.9
Python 3.9.6 (default, Nov 24 2021, 22:30:15)
[Clang 7.1.0 (tags/RELEASE_710/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes.util import find_library; print(find_library('c'))
/usr/lib/libc.dylibFor comparison, we can use python39 from Nov 6th in nixpkgs: And as we can see, this patch makes find_library work for Python 3.9.6 on macOS Big Sur, which it doesn't in the version currently in nixpkgs. |
|
Regarding nix-copy-closure; is there a way to use other ssh-ports than 22? I couldn't get this to work. I tried editing And doing $ nix-copy-closure --from catalina /nix/store/ysjpxinb0fhd9nl96z12r59sz1wpy8b0-python3-3.9.6
zsh:1: command not found: nix-store
error: cannot connect to 'catalina'Doing |
jonringer
left a comment
There was a problem hiding this comment.
diff LGTM
going to trust @bergkvist review
|
Successfully created backport PR #148368 for |
This patch has been merged in python 3.9.7. python/cpython@4b55837
|
Seems like this was reverted right after being merged: 925bbec |
|
Yes, because on master we are updating past 3.9.6. However this ugprade is problematic to backport due to the loop kwarg deprecation that breaks alot of packages. |
Motivation for this change
Backports python/cpython#28053
@bergkvist Can you test this change?
Depending on when we merge #145752 I need to rebase this once more. But this should be backported to 21.11 if it indeed fixes python3.9 stuff on recent MacOS releases.
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)