Skip to content

Revert "linux: simplify toolchain selection"#389485

Closed
blitz wants to merge 1 commit intoNixOS:stagingfrom
blitz:llvm-kernel
Closed

Revert "linux: simplify toolchain selection"#389485
blitz wants to merge 1 commit intoNixOS:stagingfrom
blitz:llvm-kernel

Conversation

@blitz
Copy link
Contributor

@blitz blitz commented Mar 13, 2025

This reverts commit 70cc251.

The reverted commit actually pulls in GCC for kernel builds in pkgsLLVM again. sigh Let's accept defeat here and specify everything manually again. This is a partial revert of apparently broken improvements in #344665.

An easy way to test this is:

build -j2 -A pkgsLLVM.linux_latest.configfile && grep CC_IS result

This should always say CLANG and not GCC.

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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

This reverts commit 70cc251.

This commit actually pulls in GCC for kernel builds in pkgsLLVM.
*sigh* Let's accept defeat here and specify everything manually again.

An easy way to test this is:

build -j2 -A pkgsLLVM.linux_latest.configfile && grep CC_IS result

This should always say CLANG and _not_ GCC.
@github-actions github-actions bot added 6.topic: kernel The Linux kernel 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels Mar 13, 2025
@blitz blitz marked this pull request as ready for review March 14, 2025 14:00
@blitz
Copy link
Contributor Author

blitz commented Mar 14, 2025

Mmh. That's too many rebuilds for nixpkgs-review (HTTP 422 Unprocessable Entity, Mic92/nixpkgs-review#280). What's the proper way of figuring out whether I broke something?

@blitz blitz requested review from K900, RossComputerGuy and alyssais and removed request for alyssais March 14, 2025 14:01
@K900
Copy link
Contributor

K900 commented Mar 14, 2025

Just build the kernels themselves, modules shouldn't break with this kind of thing.

@blitz
Copy link
Contributor Author

blitz commented Mar 15, 2025

Kerne;s built using GCC are fine. I found one issue building pkgsLLVM.linux_6_12:

┃        >   BINDGEN rust/bindings/bindings_generated.rs
┃        > Unable to generate bindings: clang diagnosed error: error: argument unused during compilation: '-nostdlibinc' [-Wunused-command-line-argument]
┃        > make[3]: *** [../rust/Makefile:298: rust/bindings/bindings_generated.rs] Error 1
┃        > make[3]: *** Deleting file 'rust/bindings/bindings_generated.rs'
┃        > make[2]: *** [/build/linux-6.12.18/Makefile:1210: prepare] Error 2
┃        > make[1]: *** [/build/linux-6.12.18/Makefile:224: __sub-make] Error 2
┃        > make[1]: Leaving directory '/build/linux-6.12.18/build'
┃        > make: *** [Makefile:224: __sub-make] Error 2

This is weird, because -Werror is not set:

# CONFIG_WERROR is not set

@blitz
Copy link
Contributor Author

blitz commented Mar 15, 2025

Ah, this is cursed. Using rust-bindgen-unwrapped the build continues, but the unwrapped bindgen breaks the configfile build.

@blitz
Copy link
Contributor Author

blitz commented Mar 16, 2025

Mhh. This is more complicated than I thought. I'll come back with a better PR.

@blitz blitz closed this Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: kernel The Linux kernel 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants