Skip to content

Commit

Permalink
chore(nix): add packages to verify MSRV
Browse files Browse the repository at this point in the history
  • Loading branch information
EHfive committed Jan 24, 2025
1 parent 28326ca commit a82259a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
max-parallel: 4
matrix:
preset: [static, ipv6_static]
preset: [static, ipv6_static, verify_msrv_static]
arch: [x86_64, aarch64]

runs-on: ubuntu-latest
Expand Down
17 changes: 16 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
overlays = [ rust-overlay.overlays.default ];
};

defaultPackage = defaultPackage' pkgs;
defaultPackage = defaultPackage' (
(import nixpkgs) {
inherit system;
}
);
crossPackage = { ... }@args: crossPackage' ({ inherit pkgs; } // args);
in
{
Expand All @@ -67,6 +71,17 @@
default = defaultPackage;
ipv6 = defaultPackage;

verify_msrv_static-x86_64-unknown-linux-musl = crossPackage {
crossPkgs = pkgs.pkgsCross.musl64;
enableStatic = true;
rustVersion = "1.80.0";
};
verify_msrv_static-aarch64-unknown-linux-musl = crossPackage {
crossPkgs = pkgs.pkgsCross.aarch64-multiplatform-musl;
enableStatic = true;
rustVersion = "1.80.0";
};

static-x86_64-unknown-linux-musl = crossPackage {
crossPkgs = pkgs.pkgsCross.musl64;
enableStatic = true;
Expand Down
3 changes: 2 additions & 1 deletion nix/cross-package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
targetTriple ? crossPkgs.hostPlatform.config,
enableStatic ? false,
enableIpv6 ? false,
rustVersion ? "latest"
}:
let
inherit (pkgs) lib system;
targetUnderscore = lib.replaceStrings [ "-" ] [ "_" ] targetTriple;
targetUnderscoreUpper = lib.toUpper targetUnderscore;

toolchain = pkgs.rust-bin.stable.latest.minimal.override {
toolchain = pkgs.rust-bin.stable.${rustVersion}.minimal.override {
targets = [ targetTriple ];
};

Expand Down

0 comments on commit a82259a

Please sign in to comment.