Skip to content
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

[22.05] go_1_18: Use apple_sdk_11_0.callPackage #194999

Merged

Conversation

risicle
Copy link
Contributor

@risicle risicle commented Oct 7, 2022

Description of changes

This is a cherry-pick of a commit from #179622 to allow us to merge #191885 without breaking cosign on darwin x86_64.

In short, go 1.18 doesn't really work properly with the old sdk we use for darwin x86_64. go_1_18 is not the default golang version for 22.05, so the ramifications of this should hopefully be limited.

The only packages that fail to build on my machine with this patch are clash and python3Packages.jupyter-repo2docker, which both fail for me without the patch too (machine too slow?)

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.05 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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Go 1.18 requires a newer SDK than the one we build from sources. As a
workaround we're making use of the SDK we're using for aarch64-darwin.
This means Go 1.18 will not work on any Darwin systems that don't have
forwards-compatible SDK versions with the particular package in
question. We might need to mark Go packages broken based on the macOS
version rather than just the platform and architecture.

Until we find a better solution, Go packages will need to make sure to
get all their (Darwin) system dependencies from the `apple_sdk_11_0`,
this includes dependencies of build tools like `xcbuild`.

For convenience `darwin.apple_sdk_11_0` has a `callPackage` attribute
which provides the correct `stdenv` and `xcbuild` attributes as
arguments. This function can be expanded to substitute other necessary
arguments when they come up.

(cherry picked from commit 00336e2)
@ofborg ofborg bot added 10.rebuild-darwin: 11-100 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux labels Oct 7, 2022
@risicle risicle requested review from toonn and reckenrode October 7, 2022 22:58
@risicle risicle marked this pull request as ready for review October 8, 2022 10:19
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.

Are the changes reckenrode made to apple_sdk_11_0 already in 22.05 to enable this? I assume they are since you report the builds worked.

@risicle
Copy link
Contributor Author

risicle commented Oct 8, 2022

Yes, #194145

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

Copy link
Contributor

@reckenrode reckenrode left a comment

Choose a reason for hiding this comment

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

LGTM as well.

@risicle risicle merged commit 6a5a3bb into NixOS:release-22.05 Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 11-100 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.

3 participants