The stdenvNoCC environment on Darwin depends on a full LLVM toolchain and clang compiler. Consequently, stdenvNoCC has a large closure size on Darwin: 1.09GiB vs. 71MiB on Linux (determined using nix-tree nixpkgs#stdenvNoCC on both platforms).
Steps To Reproduce
Run one of the following:
nix-tree nixpkgs#stdenvNoCC
nix why-depends nixpkgs#stdenvNoCC nixpkgs#llvmPackages.clang-unwrapped
Expected behavior
stdenvNoCC should not pull in a compiler, resulting in a smaller closure size than currently reported by nix-tree. Specifically, nix why-depends should show it not to depend on clang-unwrapped.
Additional context
The culprit appears to be that the setup script of stdenvNoCC contains the store path of the Apple SDK in the variable defaultBuildInputs. This pulls in the entire build toolchain. Unfortunately, I do not understand the creation process of stdenv well enough to see how to test getting rid of this. I’d think that if a compiler-less stdenv is requested, the SDK would not be needed?
Metadata
- system:
"x86_64-darwin"
- host os:
Darwin 24.2.0, macOS 15.2
- multi-user?:
yes
- sandbox:
no
- version:
nix-env (Nix) 2.24.10
- nixpkgs:
/nix/store/4c6wr0gvjr2azsng4vi8a9j1y1yzai4y-source
Note for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.
The
stdenvNoCCenvironment on Darwin depends on a full LLVM toolchain and clang compiler. Consequently,stdenvNoCChas a large closure size on Darwin: 1.09GiB vs. 71MiB on Linux (determined usingnix-tree nixpkgs#stdenvNoCCon both platforms).Steps To Reproduce
Run one of the following:
nix-tree nixpkgs#stdenvNoCCnix why-depends nixpkgs#stdenvNoCC nixpkgs#llvmPackages.clang-unwrappedExpected behavior
stdenvNoCCshould not pull in a compiler, resulting in a smaller closure size than currently reported bynix-tree. Specifically,nix why-dependsshould show it not to depend onclang-unwrapped.Additional context
The culprit appears to be that the
setupscript ofstdenvNoCCcontains the store path of the Apple SDK in the variabledefaultBuildInputs. This pulls in the entire build toolchain. Unfortunately, I do not understand the creation process ofstdenvwell enough to see how to test getting rid of this. I’d think that if a compiler-lessstdenvis requested, the SDK would not be needed?Metadata
"x86_64-darwin"Darwin 24.2.0, macOS 15.2yesnonix-env (Nix) 2.24.10/nix/store/4c6wr0gvjr2azsng4vi8a9j1y1yzai4y-sourceNote for maintainers: Please tag this issue in your PR.
Add a 👍 reaction to issues you find important.