cmake: check if NIX_CC exists before using it#192943
cmake: check if NIX_CC exists before using it#192943lovesegfault merged 3 commits intoNixOS:stagingfrom
Conversation
13b0800 to
7bec82f
Compare
|
It seems this could fix the problem I've just encountered. When I call Things work when I set I'm not testing this PR due to high number of rebuilds :-(. |
|
I managed to test this PR. I built just cmake and verified that manual |
pkgs/development/tools/build-managers/cmake/001-search-path.diff
Outdated
Show resolved
Hide resolved
trofi
left a comment
There was a problem hiding this comment.
The fix looks good. Thank you!
|
Thanks for the patch and the reviews! I can confirm this fixes my issue on my M1 Mac! Thanks! Would it make sense to backport this to 22.05? |
|
The run-time libc detection was added after 22.05 in #181431. Here's the simpler patch currently in 22.05, which doesn't have the new checks: https://github.com/NixOS/nixpkgs/blob/nixos-22.05/pkgs/development/tools/build-managers/cmake/search-path.patch I don't think #181431 should be backported, so this shouldn't be either. Though, should we be targeting staging for this, considering the Darwin rebuilds? |
|
Yup, this needs to target |
workaround for cmake bug in nix details: NixOS/nixpkgs#192943
Description of changes
Due to the patch added by us,
cmakepackage does not work whenNIX_CCenvironment variable does not exists.When
$ENV{NIX_CC}is empty, the conditionIS_DIRECTORY AND EXISTS /nix-support/orig-libc AND EXISTS /nix-support/orig-libc-devis invalid.nixpkgs/pkgs/development/tools/build-managers/cmake/001-search-path.diff
Lines 24 to 34 in e17b079
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes