Skip to content

apple-source-releases: always use python3Minimal#306697

Merged
toonn merged 1 commit intoNixOS:stagingfrom
reckenrode:apple-oss-python
May 6, 2024
Merged

apple-source-releases: always use python3Minimal#306697
toonn merged 1 commit intoNixOS:stagingfrom
reckenrode:apple-oss-python

Conversation

@reckenrode
Copy link
Contributor

Description of changes

Using python3Minimal avoids infinite recursions in the stdenv bootstrap on x86_64-darwin when building Python with configd support.

Build was tested on my ld64 branch. Primary issue is ensuring evaluation, which can be tested with nix-instantiate.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.05 Release Notes (or backporting 23.05 and 23.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. label Apr 25, 2024
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Apr 25, 2024
Using python3Minimal avoids infinite recursions in the stdenv bootstrap on x86_64-darwin when building Python with configd support.
@reckenrode
Copy link
Contributor Author

The force push uses buildPackages.python3Minimal, which is needed for Darwin cross-compilation.

@toonn
Copy link
Contributor

toonn commented May 1, 2024

This was previously achieved by passing in python3Minimal from the bootstrap, no? What's the motivation for changing it around? In principle it's nice for the packages in the final package set to all depend on the same Python rather than have some depend on the minimal version.

@reckenrode
Copy link
Contributor Author

This was previously achieved by passing in python3Minimal from the bootstrap, no? What's the motivation for changing it around? In principle it's nice for the packages in the final package set to all depend on the same Python rather than have some depend on the minimal version.

Meson needs a fairly functional Python, and it simplifies things not having to do a ton of overrides to do enable that. Otherwise, I’d have to be doing overrides of configd, xnu, etc to use python3Minimal.

@toonn
Copy link
Contributor

toonn commented May 2, 2024

I'm actually fine with overriding it for all the source releases rather than the ones that strictly need it but it would be slightly nicer not to end up with pretty much always needing two copies of Python in the store.

Would it be hard to switch to non-minimal Python after bootstrapping?

@reckenrode
Copy link
Contributor Author

I'm actually fine with overriding it for all the source releases rather than the ones that strictly need it but it would be slightly nicer not to end up with pretty much always needing two copies of Python in the store.

Wouldn’t it only be pulled into the store as a build-time dependency?

Would it be hard to switch to non-minimal Python after bootstrapping?

The way the source releases are implemented in darwin-packages.nix doesn’t expose a way to override Python for all of the packages. They’re only exposed individually. It may be something to consider for the SDK refactor. There’s going to need to be a way to override the source-release packages in bulk anyway. Maybe the bootstrap could reuse that.

Copy link
Contributor

@toonn toonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, tested a couple things still build fine on both Darwins.

Not my favorite solution but it shouldn't be blocked on my account if it'll allow further progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants