tpwrules / nixos-apple-silicon

Resources to install NixOS bare metal on Apple Silicon Macs
MIT License
748 stars 74 forks source link

linux-asahi from 2023-08-25 does not build with Rust support enabled #97

Closed autrimpo closed 10 months ago

autrimpo commented 10 months ago

After today's update, I am unable to build the kernel. I am running NixOS 23.05, flake input updated just a couple of minutes ago (github:nixos/nixpkgs/fc944919f743bb22379dddf18dcb72db6cff84aa).

The kernel seems to build if I disable Rust support or use unstable.

Build log:

error: builder for '/nix/store/yg8a5k5g1zn8yysi32ial27074cciq0r-linux-6.4.0-asahi.drv' failed with exit code 1:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/b27f62ngi8b36l60zirx9djxc237xhqp-source
source root is source
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/j217pbp9pqv3z336nv6lx8fhrzdb5pmj-rust-bindgen-version.patch
patching file scripts/rust_is_available.sh
applying patch /nix/store/f3yvg9zp5lisfrfdw5szqn6v4h47nx6h-default-pagesize-16k.patch
patching file arch/arm64/Kconfig
Hunk #1 succeeded at 1197 (offset 161 lines).
applying patch /nix/store/a6jy7ivg8dljlap45ccwrx93j3bh05zb-rust-bindgen-0.63-fix.patch
patching file rust/Makefile
Hunk #1 succeeded at 321 (offset -12 lines).
applying patch /nix/store/fc3pfhi9cxzgiwdwf32w96hpl78imwis-rust-bindgen-0.65-fix.patch
patching file rust/Makefile
Hunk #1 succeeded at 301 (offset 13 lines).
applying patch /nix/store/zac8l1vmba0kzl6md10anps8ay9dn798-rust_1_71_0.patch
patching file rust/Makefile
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file rust/Makefile.rej
patching file rust/compiler_builtins.rs
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file rust/compiler_builtins.rs.rej
patching file rust/alloc/alloc.rs
Hunk #1 FAILED at 337.
1 out of 1 hunk FAILED -- saving rejects to file rust/alloc/alloc.rs.rej
patching file rust/alloc/boxed.rs
Hunk #1 FAILED at 380.
Hunk #2 FAILED at 410.
Hunk #3 FAILED at 445.
Hunk #4 FAILED at 486.
Hunk #5 FAILED at 517.
Hunk #6 FAILED at 558.
Hunk #7 FAILED at 577.
Hunk #8 FAILED at 591.
Hunk #9 FAILED at 609.
Hunk #10 FAILED at 828.
Hunk #11 FAILED at 863.
Hunk #12 FAILED at 1109.
Hunk #13 FAILED at 1121.
Hunk #14 FAILED at 1140.
Hunk #15 FAILED at 1182.
Hunk #16 FAILED at 1460.
Hunk #17 FAILED at 1898.
Hunk #18 FAILED at 1908.
18 out of 18 hunks FAILED -- saving rejects to file rust/alloc/boxed.rs.rej
patching file rust/alloc/lib.rs
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file rust/alloc/lib.rs.rej
patching file rust/alloc/vec/mod.rs
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file rust/alloc/vec/mod.rs.rej
patching file rust/kernel/allocator.rs
Hunk #1 FAILED at 26.
1 out of 1 hunk FAILED -- saving rejects to file rust/kernel/allocator.rs.rej
patching file rust/kernel/driver.rs
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file rust/kernel/driver.rs.rej

I suspect the version chosen for the Rust patch check is wrong - I attempted to skip the patch and the kernel seems to be building. I'll report later whether the compilation managed to finish.

autrimpo commented 10 months ago

Build was successful, running the new kernel now.

tpwrules commented 10 months ago

Thanks, fixed in the latest release.