Skip to content

apple-sdk: propagate the libutil library#353873

Merged
emilazy merged 18 commits intoNixOS:stagingfrom
emilazy:push-snxlqputvutn
Nov 7, 2024
Merged

apple-sdk: propagate the libutil library#353873
emilazy merged 18 commits intoNixOS:stagingfrom
emilazy:push-snxlqputvutn

Conversation

@emilazy
Copy link
Member

@emilazy emilazy commented Nov 5, 2024

The SDK provides this without headers and apparently some things try to link to it. This should help increase compatibility with the native toolchain.

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.11 Release Notes (or backporting 23.11 and 24.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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@emilazy emilazy requested a review from a team November 5, 2024 17:16
@nix-owners nix-owners bot requested review from reckenrode and toonn November 5, 2024 17:18
@reckenrode
Copy link
Contributor

This seems fine. A good test would be to build Python with darwin-libutil.patch disabled and Neovim with #346946 reverted.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Nov 5, 2024
@nix-owners nix-owners bot requested review from mweinelt and natsukium November 5, 2024 23:14
The SDK provides this without headers and apparently some things
try to link to it. This should help increase compatibility with the
native toolchain.
@github-actions github-actions bot added the 6.topic: vim Advanced text editor label Nov 6, 2024
@emilazy
Copy link
Member Author

emilazy commented Nov 6, 2024

MacVim, CPython 3.10, and CPython 3.12 build successfully. Now building the other CPythons and the other packages I’ve touched here. I looked at the source for all of them except MacVim and determined that they expected <util.h>, not <libutil.h>, as expected for packages supporting Darwin or BSD upstream. I have not tested MacVim as it requires Xcode; cc @lilyball.

There are no packages left referencing darwin.libutil except the SDK; maybe it should not really be installing libutil.h at all, since apparently nothing wants it on macOS.

@emilazy
Copy link
Member Author

emilazy commented Nov 7, 2024

I have confirmed that everything touched here builds (except macvim as stated previously, but I’m pretty sure it’s not likely to be the one package in the whole tree that actually needs this, especially given that it has since had changes to depend less on Nix stuff).

@reckenrode There are now no users of darwin.libutil that don’t use lib.getLib, because everything uses <util.h> on macOS and various BSDs. Are we sure we want to install the <libutil.h> header in that package at all? In any case, the only explicit user outside of the SDK is now libuv, which has to build with the bootstrap SDK. Let me know if you think I’ve handled it appropriately there or if there’s something nicer we could do.

@reckenrode
Copy link
Contributor

libutil.h is used by several source releases (e.g., file_cmds, shell_cmds, system_cmds, etc).

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

@emilazy
Copy link
Member Author

emilazy commented Nov 7, 2024

Ah, I didn’t think of the source release scope!

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/the-darwin-sdks-have-been-updated/55295/1

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

Labels

6.topic: python Python is a high-level, general-purpose programming language. 6.topic: vim Advanced text editor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants