upgrade Nix toolchain #400

Merged
lx merged 10 commits from upgrade-toolchain into main 2022-10-18 14:16:53 +00:00
4 changed files with 34 additions and 37 deletions
Showing only changes of commit e89e047c5a - Show all commits

View file

@ -43,10 +43,13 @@ in {
target = "x86_64-unknown-linux-musl";
features = [
"garage/bundled-libs"
"garage/sled"
"garage/k2v"
"garage/sled"
"garage/lmdb"
"garage/sqlite"
"garage_db/sled"
"garage_db/lmdb"
"garage_db/sqlite"
];
});
};

View file

@ -8,12 +8,12 @@ rec {
#sha256 = "1xy9zpypqfxs5gcq5dcla4bfkhxmh5nzn9dyqkr03lqycm9wg5cr";
# NixOS 22.05
url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/22.05.zip";
sha256 = "0d643wp3l77hv2pmg2fi7vyxn4rwy0iyr8djcw1h5x72315ck9ik";
#url = "https://github.com/NixOS/nixpkgs/archive/refs/tags/22.05.zip";
#sha256 = "0d643wp3l77hv2pmg2fi7vyxn4rwy0iyr8djcw1h5x72315ck9ik";
# As of 2022-10-13
#url = "https://github.com/NixOS/nixpkgs/archive/a3073c49bc0163fea6a121c276f526837672b555.zip";
#sha256 = "1bz632psfbpmicyzjb8b4265y50shylccvfm6ry6mgnv5hvz324s";
url = "https://github.com/NixOS/nixpkgs/archive/a3073c49bc0163fea6a121c276f526837672b555.zip";
sha256 = "1bz632psfbpmicyzjb8b4265y50shylccvfm6ry6mgnv5hvz324s";
};
cargo2nixSrc = fetchGit {
# As of 2022-10-14: (TODO)

View file

@ -13,9 +13,10 @@ let
log = v: builtins.trace v v;
pkgs = import pkgsSrc {
inherit system;
inherit system;
crossSystem = {
config = target;
isStatic = true;
};
overlays = [ cargo2nixOverlay ];
};
@ -30,26 +31,22 @@ let
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.
*/
/*
rustToolchain = {
rustc = pkgs.symlinkJoin {
name = "rust-channel";
paths = [
pkgs.rustPlatform.rust.cargo
pkgs.rustPlatform.rust.rustc
];
};
clippy = pkgs.symlinkJoin {
name = "clippy-channel";
paths = [
pkgs.rustPlatform.rust.cargo
pkgs.rustPlatform.rust.rustc
pkgs.clippy
];
};
}.${compiler};
*/
toolchainOptions =
if target == "x86_64-unknown-linux-musl" || target == "aarch64-unknown-linux-musl" then {
rustVersion = "1.63.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: {
rustc = drv.setBuildEnv;
@ -57,7 +54,7 @@ let
${drv.setBuildEnv or "" }
echo
echo --- BUILDING WITH CLIPPY ---
echo
echo
export NIX_RUST_BUILD_FLAGS="''${NIX_RUST_BUILD_FLAGS} --deny warnings"
export RUSTC="''${CLIPPY_DRIVER}"
@ -215,12 +212,7 @@ let
else target;
in
pkgs.rustBuilder.makePackageSet {
pkgs.rustBuilder.makePackageSet ({
inherit release packageFun packageOverrides codegenOpts rootFeatures;
#inherit rustToolchain;
rustVersion = "1.63.0";
target = rustTarget;
extraRustComponents = [ "clippy" ];
}
} // toolchainOptions)

View file

@ -6,14 +6,17 @@ with import ./common.nix;
let
platforms = [
"x86_64-unknown-linux-musl"
#"x86_64-unknown-linux-musl"
"i686-unknown-linux-musl"
"aarch64-unknown-linux-musl"
#"aarch64-unknown-linux-musl"
"armv6l-unknown-linux-musleabihf"
];
pkgsList = builtins.map (target: import pkgsSrc {
inherit system;
crossSystem = { config = target; };
crossSystem = {
config = target;
isStatic = true;
};
overlays = [ cargo2nixOverlay ];
}) platforms;
pkgsHost = import pkgsSrc {};
@ -25,7 +28,6 @@ in
lib.flatten (builtins.map (pkgs: [
pkgs.rustPlatform.rust.rustc
pkgs.rustPlatform.rust.cargo
pkgs.clippy
pkgs.buildPackages.stdenv.cc
]) pkgsList) ++ [
kaniko