Merge pull request 'use mold linker when invoking cargo manually (not in nix build scripts)' (#646) from mold-linker into main

Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/646
pull/655/head
Alex 7 months ago
commit a5e8ffeb63
  1. 3
      .cargo/config.toml
  2. 5
      flake.nix
  3. 21
      shell.nix

@ -0,0 +1,3 @@
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

@ -48,6 +48,9 @@
pkgsSrc = nixpkgs;
cargo2nixOverlay = cargo2nix.overlays.default;
release = false;
}).workspaceShell { packages = [ pkgs.rustfmt ]; };
}).workspaceShell { packages = with pkgs; [
rustfmt
mold
]; };
});
}

@ -15,16 +15,17 @@ in {
# --- Rust Shell ---
# Use it to compile Garage
rust = pkgs.mkShell {
nativeBuildInputs = [
#pkgs.rustPlatform.rust.rustc
pkgs.rustPlatform.rust.cargo
#pkgs.clippy
pkgs.rustfmt
#pkgs.perl
#pkgs.protobuf
#pkgs.pkg-config
#pkgs.openssl
pkgs.file
nativeBuildInputs = with pkgs; [
#rustPlatform.rust.rustc
rustPlatform.rust.cargo
mold
#clippy
rustfmt
#perl
#protobuf
#pkg-config
#openssl
file
#cargo2nix.packages.x86_64-linux.cargo2nix
];
};

Loading…
Cancel
Save