Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[broken] cmake: fix crash on CC without libc support #187773

Merged
merged 0 commits into from
Aug 21, 2022

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Aug 21, 2022

Without this change pkgsLLVM fails to build any packages
as compiler-rt fails early in cmake:

CMake Error at ...-cmake-3.24.0/share/cmake-3.24/Modules/Platform/UnixPaths.cmake:53 (file):
  file STRINGS file
  "...-x86_64-unknown-linux-gnu-clang-wrapper-11.1.0/nix-support/orig-libc-dev"
  cannot be read.

It's a regression caused by 871cf9f "cmake: detect libc location
at runtime #181431" where we started using orig-libc-dev as a libc pointer.

During pkgsLLVM pootstrap first compiler has no libc support yet.

The change skips runtime detection if there are no libc signs.

Description of changes
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.

@trofi trofi requested review from stephank and vcunat August 21, 2022 18:05
@trofi
Copy link
Contributor Author

trofi commented Aug 21, 2022

Almost the whole world rebuild:

$ ./maintainers/scripts/rebuild-amount.sh HEAD^
Estimating rebuild amount by counting changed Hydra jobs (parallel=unset).
      1 pkgs-lib-tests
  31506 x86_64-darwin
  31838 x86_64-linux

I'll re-target staging.

@trofi trofi merged commit 358f18f into NixOS:staging-next Aug 21, 2022
@trofi trofi force-pushed the cmake-fix-non-libc-case branch from e63f062 to bafa0bd Compare August 21, 2022 18:18
@trofi
Copy link
Contributor Author

trofi commented Aug 21, 2022

Confused github by pushing wrong branch /o\ into override. Trying again as #187777

@trofi trofi changed the title cmake: fix crash on CC without libc support [broken] cmake: fix crash on CC without libc support Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant