Skip to content

xcbuild: various improvements#185969

Merged
zowoq merged 3 commits intoNixOS:stagingfrom
stephank:feat/xcbuild-misc
Aug 14, 2022
Merged

xcbuild: various improvements#185969
zowoq merged 3 commits intoNixOS:stagingfrom
stephank:feat/xcbuild-misc

Conversation

@stephank
Copy link
Contributor

Description of changes

These tweaks specifically target LLVM compiler-rt, which I need to modify for Darwin.

The LLVM build tries to call xcrun but we currently don't make it available and ignore the errors. That's disabling critical functionality however. A change in this PR makes xcrun available separately, which is just a bunch of files and shell scripts. That makes it much easier to put it in the closure of stdenv on Darwin.

The other change is to actually check the -sdk flag if passed. The LLVM build calls xcrun multiple times to detect different SDKs, but it should only succeed for the target platform.

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.

Sometimes, builds only call xcrun for very basic detection. This exposes
a `xcbuild.xcrun` that has a significantly simpler closure. (It's just
some files and shell scripts.)
@stephank stephank requested a review from matthewbauer as a code owner August 10, 2022 19:53
@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: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Aug 10, 2022
Copy link
Member

@matthewbauer matthewbauer left a comment

Choose a reason for hiding this comment

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

Looks good to me. Haven't tested it or anything, but I think the tests are somewhat comprehensive.

@stephank
Copy link
Contributor Author

Hmm, should I target staging for this? It doesn't touch stdenv, but I didn't realize it'd be 5001+. 🙃

@matthewbauer
Copy link
Member

Hmm, should I target staging for this? It doesn't touch stdenv, but I didn't realize it'd be 5001+. 🙃

I think it's fine to go to master. IIRC it's not a lot more than 5000.

@zowoq
Copy link
Contributor

zowoq commented Aug 10, 2022

Almost 17000 rebuilds across both darwin platforms, this should go to staging.

@stephank stephank changed the base branch from master to staging August 11, 2022 05:09
@stephank
Copy link
Contributor Author

I updated the base branch to staging.

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 11, 2022
@zowoq zowoq merged commit f53a48b into NixOS:staging Aug 14, 2022
@stephank stephank deleted the feat/xcbuild-misc branch September 7, 2022 17:05
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-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants