Open colemickens opened 1 year ago
(I think something as simple as whatever depends on bash can cause this)
Something I don't understand -- this cross-compiled to aarch64 just fine. So, there's something I don't understand.
I tried to fix the dependencies a bit, they were still in some wrong spots from technical debt over the years.
I was able to get Helix and Bottom (btm) to cross-compile (which I consider in the same class of nice, new, Rust tools), but Zellij fails.
The flake here prefers using mold as a linker on linux systems, maybe that has some impact?
I added some very basic overlays, but they are not yet ready for cross compilation. I will refactor a bit in the coming days to make this scenario a little easier.
I pushed exposing legacyPackages to a different branch for testing purposes.
Do you mind checking this attribute?
export NIXPKGS_ALLOW_BROKEN=1; nix build github:a-kenji/zellij-nix/expose-pkgs#pkgsCross.riscv64.zellij-nightly --impure
It seems that cargo-auditable
is broken on some systems.
Flake ref:
github:a-kenji/zellij-nix/expose-pkgs
Attribute:
github:a-kenji/zellij-nix/expose-pkgs#pkgsCross.riscv64.zellij-nightly
I haven't been able to check this yet, but I can say that while bee0cae9 builds for me, tip of zellij-nix
no longer builds natively for aarch64 (eval on x86_64-linux if it matters).
Thank you for that information!
I am updating nixpkgs
in a pr currently, which might be able to alleviate this problem #224.
I re-updated, and then re-downgraded due to hitting the same error:
copying path '/nix/store/37p8gq9zijbw6pj3lpi1ckqiv18j2g62-stdenv-linux' from 'https://cache.nixos.org'...
copying path '/nix/store/71psif5fandhr1c7gk8k5n8sbdfgxa0b-make-binary-wrapper-hook' from 'https://cache.nixos.org'...
error: a 'x86_64-linux' with features {} is required to build '/nix/store/ri5ply7y35dsy4jvwblmjl8b25a52xl4-async-std-1.11.0.drv', but I am a 'aarch64-linux' with features {ben
chmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}
To remove any ambiguity, I'm building my aarch64 system, updating all inputs, building again (fails), downgrading only zellij-nix
, and then it builds successfully again.
Regarding the debug-PR, pkgsCross test:
❯ export NIXPKGS_ALLOW_BROKEN=1; nix build github:a-kenji/zellij-nix/expose-pkgs#pkgsCross.riscv64.zellij-nightly --impure
error: builder for '/nix/store/grx9rs6z53iigd1h7rslszb4dgrml12l-zellij-riscv64-unknown-linux-gnu.drv' failed with exit code 2;
last 10 log lines:
> source root is source
> Executing cargoSetupPostUnpackHook
> Finished cargoSetupPostUnpackHook
> patching sources
> updateAutotoolsGnuConfigScriptsPhase
> configuring
> building
> Executing cargoBuildHook
> ++ env CC_x86_64-unknown-linux-gnu=/nix/store/7wkshj58fcsl1f3zyi67qsxgl1p8nki1-gcc-wrapper-12.2.0/bin/cc CXX_x86_64-unknown-linux-gnu=/nix/store/7wkshj58fcsl1f3zyi67qsxgl1p8nki1-gcc-wrapper-12.2.0/bin/c++ CC_riscv64gc-unknown-linux-gnu=/nix/store/305kd960cwabaf0akamb7d280m81ka52-riscv64-unknown-linux-gnu-stage-final-gcc-wrapper-12.2.0/bin/riscv64-unknown-linux-gnu-cc CXX_riscv64gc-unknown-linux-gnu=/nix/store/305kd960cwabaf0akamb7d280m81ka52-riscv64-unknown-linux-gnu-stage-final-gcc-wrapper-12.2.0/bin/riscv64-unknown-linux-gnu-c++ cargo build -j 8 --target riscv64gc-unknown-linux-gnu --frozen --release
> /nix/store/31l1h5df5s66rzkcqbc9cxn59qm8y6sn-cargo-riscv64-unknown-linux-gnu-1.69.0/bin/.cargo-wrapped: line 2: syntax error: unexpected ")"
For full logs, run 'nix log /nix/store/grx9rs6z53iigd1h7rslszb4dgrml12l-zellij-riscv64-unknown-linux-gnu.drv'.
this was executed (eval'd+built) on the x86_64-linux
builder that I use to build all derivations. I exclusively eval from x86_64-linux, though, so this is just noted to be thorough.
Thank you for keeping on testing my changes!
I think I realized now, why my changes were working on my builder: I had binfmt
configured.
Do you mind checking the current: #222 please again? I think there is a chance that this will work now.
It should be able to be run with:
nix build github:a-kenji/zellij-nix/expose-pkgs#pkgsCross.riscv64.zellij-cross
Hmm, I'm going to give it a shot, but I guess I'm still hoping for something like Helix, where I just include helix.package = inputs.helix.outputs.packages.${pkgs.stdenv.hostPlatform.system}.helix
.
For me, this "just works", either native or cross-compiling.
This invocation makes it seem like I'll be writing conditionals into my config for "if cross compiling...". Which isn't unprecedented, but seems less ideal.
Sorry that I'm just getting back to this. I kind of forgot that I pinnned zellij-nix
a long time ago.
I'm currently still having issues with cross-eval, native-compilation.
That is, I've let zellij-nix
flake input update to latest available here.
error: a 'x86_64-linux' with features {} is required to build '/nix/store/m047p6ijhl55p149w307sjqpv558ahb3-cargo-1.67.0-x86_64-unknown-linux-gnu.tar.xz.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}
So, something during eval is incorrectly relying on the evaluation host instead of the stdenv target platform.
For now I'm probably just going to have the aarch64 machines default to using zellij
from nixpkgs, which avoids this issue. (see: https://github.com/colemickens/nixcfg/commit/4b50a6bf211f72f0be4f6fa4f3ba789d85189138)
Thank you for the answer. I have updated main in hopes to improve cross compilation support again. Do you mind to check that? I am not 100% sure it will work in every context, since I am using an overlay to get the correct toolchain.
I set my zellij config back to use the flake package for any combo of host/build platform, and re-added it to my last remaining aarch64-linux
cross-compiled host, and it still blows up quite quickly:
╭ slynux ~ 23ms
╰─▶ nix build -L /nix/store/jmzyx0n3dq57bx59qlccjrvzghyhwi5j-nixos-system-ope
nstick-23.11.20231031.0783ee1.drv^*
error: a 'aarch64-linux' with features {} is required to build '/nix/store/3wvcin7wbym4n2r51mvkirqns799yi28-async-h1-2.3.4.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test, recursive-nix}
Thank you for checking again!
I was thinking over this last night, I don't really see how this can work using the package directly, given how cross-compiling works by configuring pkgs
. Also, I realized that Helix does in fact have the same issue (I forgot I was using a similar workaround to use stable helix for my cross-compiled hosts).
However, I hit a different issue when using this as an overlay:
error: evaluation aborted with the following error message: 'Function called without required argument "rust-bin" at /nix/store/cb6rvipj9ajc3pldji5w22l1ylfyjgs2-source/flake.nix:43'
So it's acting like it doesn't have access to the rust-overlay you're using inside the flake.
Hi,
I consider
zellij
a very core tool and have it as part of my very core profile that gets deployed to all of my NixOS machines, including those that I cross-compile for.I was able to get Helix and Bottom (btm) to cross-compile (which I consider in the same class of nice, new, Rust tools), but Zellij fails.
However, zellij breaks it:
Just throwing this out for initial consideration. For all I know a native dep of Zellij is bringing this in, but I'm not sure, I know in other places folks have managed to side-step requirements for bootstrap-tools for this cross-compile scenarion.
I don't think it matters, but I'm trying to cross compile from x86_64-linux buildPlatform for a riscv64-linux hostPlatform.
NOTE: I haven't tried zellij from nixpkgs yet...