Skip to content

cling: fix build on macOS#415831

Merged
afh merged 1 commit intoNixOS:masterfrom
codedownio:cling-fix-macos
Jun 13, 2025
Merged

cling: fix build on macOS#415831
afh merged 1 commit intoNixOS:masterfrom
codedownio:cling-fix-macos

Conversation

@thomasjm
Copy link
Copy Markdown
Contributor

I noticed that the Cling build (and general functionality) was broken on macOS. This is because on macOS, we use libc++ rather than glibc. The latter is self-contained, so it works on Linux without additional includes. But on macOS, we need to add the system includes from the apple-sdk package so it can find files like stdlib.h.

I also inlined some flags and changed the formatting to make it easier to see what's going on. Linux should be unaffected by this change.

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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, pkgs/README.md, maintainers/README.md and other contributing documentation in corresponding paths.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Jun 11, 2025
@thomasjm thomasjm requested review from veprbl and wegank June 11, 2025 11:48
@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. labels Jun 11, 2025
@afh
Copy link
Copy Markdown
Member

afh commented Jun 12, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 415831


aarch64-darwin

✅ 1 package built:
  • cling

Copy link
Copy Markdown
Member

@veprbl veprbl left a comment

Choose a reason for hiding this comment

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

Looks reasonable.

@thomasjm
Copy link
Copy Markdown
Contributor Author

I see that the formatter check isn't happy with what I've done with the flags, but I'd like to keep it as-is if possible since the readability this way is so much better.

@veprbl
Copy link
Copy Markdown
Member

veprbl commented Jun 13, 2025

I would apply the patch. There is not a way to preserve your manual formatting long term, it will eventually be reformatted by someone else.

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 13, 2025
@thomasjm
Copy link
Copy Markdown
Contributor Author

All right, done

@afh afh merged commit ec4c48d into NixOS:master Jun 13, 2025
15 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 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