aboutsummaryrefslogtreecommitdiff
path: root/nix/compile.nix
diff options
context:
space:
mode:
authorAlex <alex@adnab.me>2024-02-08 22:29:25 +0000
committerAlex <alex@adnab.me>2024-02-08 22:29:25 +0000
commit8061bf5e1c250ff9234894f7a63910fedef1357b (patch)
tree46c462fa8de931ff296596921bdd4bcb9715ed19 /nix/compile.nix
parent304a89c57b1e951481cd0bf2e56582b41b6d73e4 (diff)
parent8724aabdf5463c3baedff5bfbfa9e0f71510ef96 (diff)
downloadgarage-8061bf5e1c250ff9234894f7a63910fedef1357b.tar.gz
garage-8061bf5e1c250ff9234894f7a63910fedef1357b.zip
Merge pull request 'Use only oxalica/rust-overlay toolchain and not nixpkgs' (#710) from oxalica-toolchain-only into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/710
Diffstat (limited to 'nix/compile.nix')
-rw-r--r--nix/compile.nix23
1 files changed, 1 insertions, 22 deletions
diff --git a/nix/compile.nix b/nix/compile.nix
index c51188fe..1e712710 100644
--- a/nix/compile.nix
+++ b/nix/compile.nix
@@ -19,30 +19,9 @@ let
overlays = [ cargo2nixOverlay ];
};
- /* Cargo2nix is built for rustOverlay which installs Rust from Mozilla releases.
- This is fine for 64-bit platforms, but for 32-bit platforms, we need our own Rust
- to avoid incompatibilities with time_t between different versions of musl
- (>= 1.2.0 shipped by NixOS, < 1.2.0 with which rustc was built), which lead to compilation breakage.
- So we want a Rust release that is bound to our Nix repository to avoid these problems.
- See here for more info: https://musl.libc.org/time64.html
- Because Cargo2nix does not support the Rust environment shipped by NixOS,
- we emulate the structure of the Rust object created by rustOverlay.
- In practise, rustOverlay ships rustc+cargo in a single derivation while
- NixOS ships them in separate ones. We reunite them with symlinkJoin.
- */
- toolchainOptions = if target == null || target == "x86_64-unknown-linux-musl"
- || target == "aarch64-unknown-linux-musl" then {
+ toolchainOptions = {
rustVersion = "1.73.0";
extraRustComponents = [ "clippy" ];
- } else {
- rustToolchain = pkgs.symlinkJoin {
- name = "rust-static-toolchain-${target}";
- paths = [
- pkgs.rustPlatform.rust.cargo
- pkgs.rustPlatform.rust.rustc
- # clippy not needed, it only runs on amd64
- ];
- };
};
buildEnv = (drv: