-
Notifications
You must be signed in to change notification settings - Fork 0
/
rust-bitcoin.rust-miniscript.check-pr.nix
47 lines (43 loc) · 1.81 KB
/
rust-bitcoin.rust-miniscript.check-pr.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{ pkgs ? import <nixpkgs> { }
, jsonConfigFile
, prNum
}:
let
overridePkgs = import <nixpkgs> {
overlays = [
(import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
];
};
oldFeatures = { rustc, ... }: [ [ "std" ] [ "std" "compiler" ] [ "std" "compiler" "trace" ] ]
++ (if builtins.isNull (builtins.match "1.41" rustc.version) then [ [ "no-std" ] [ "no-std" "compiler" "trace" ] ] else [])
++ (if utils.rustcIsNightly rustc then [ [ "std" "unstable" "compiler" ] [ "no-std" "unstable" "compiler" ] ] else []);
utils = import ./andrew-utils.nix { };
jsonConfig = utils.parseRustConfig { inherit jsonConfigFile prNum; };
fullMatrix = {
inherit prNum;
inherit (utils.standardRustMatrixFns jsonConfig)
projectName src lockFile srcName mtxName
isMainLockFile isMainWorkspace mainCargoToml workspace cargoToml
rustc # override for backports 10.x and below
# features # Must be overridden if there are any exceptional feature combinations
runClippy
runFmt
runDocs;
features = utils.featuresForSrc { needsNoStd = true; };
# for old versions pr 11.x
# features = oldFeatures;
# For 10.x and below
# rustc = [ overridePkgs.rust-bin.stable.latest.default overridePkgs.rust-bin.stable."1.41.1".default overridePkgs.rust-bin.stable."1.47.0".default overridePkgs.rust-bin.beta.latest.default overridePkgs.rust-bin.nightly."2023-06-01".default ];
};
checkData = rec {
name = "${jsonConfig.projectName}-pr-${builtins.toString prNum}";
argsMatrix = fullMatrix;
singleCheckDrv = utils.crate2nixSingleCheckDrv;
memoGeneratedCargoNix = utils.crate2nixMemoGeneratedCargoNix;
memoCalledCargoNix = utils.crate2nixMemoCalledCargoNix;
};
in
{
checkPr = utils.checkPr checkData;
checkHead = utils.checkPr checkData;
}