cachix / devenv

Fast, Declarative, Reproducible, and Composable Developer Environments
https://devenv.sh
Apache License 2.0
4.23k stars 317 forks source link

Cross compilation support #145

Open domenkozar opened 1 year ago

domenkozar commented 1 year ago

Based on the https://nix.dev/tutorials/cross-compilation#cross-compilation, integrate cross-compilation as first-class citizen.

matu3ba commented 1 year ago

This is relative simple to do with https://github.com/Cloudef/nix-zig-stdenv, but Rust doesnt like it https://github.com/ziglang/zig/issues/5320.

Things become more ugly, if you want to cross-compiling the compiler itself: https://github.com/ziglang/zig-bootstrap. nix has for this https://nix.dev/tutorials/cross-compilation, but building from source works roughly the same for every cross-compiler (unless no state of the art optimizer is involved).

There is also a way to make this work in cmake https://github.com/mrexodia/zig-cross.