-
Notifications
You must be signed in to change notification settings - Fork 0
/
rust-bitcoin.rust-bitcoincore-rpc.check-pr.nix
47 lines (45 loc) · 1.72 KB
/
rust-bitcoin.rust-bitcoincore-rpc.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
47
{ pkgs ? import <nixpkgs> { }
, jsonConfigFile
, prNum
}:
let
utils = import ./andrew-utils.nix { };
jsonConfig = utils.parseRustConfig { inherit jsonConfigFile prNum; };
fullMatrix = {
# Much of this was disabled 2024-06-10
inherit prNum;
inherit (utils.standardRustMatrixFns jsonConfig)
projectName src rustc lockFile srcName mtxName
isMainLockFile isMainWorkspace mainCargoToml workspace cargoToml
features; # Must be overridden if there are any exceptional feature combinations
#runClippy # doesn't work in rust-bitcoincore-rpc
#runFmt; # doesn't work in rust-bitcoincore-rpc
#runDocs; # doesn't work in rust-bitcoincore-rpc
runClippy = false;
runFmt = false;
runDocs = false;
extraTestPostRun = { workspace, ... }: if workspace == "integration_test"
then ''
export PATH=${pkgs.psmisc}/bin:${pkgs.valgrind}/bin:$PATH # for killall
sed -i 's/cargo run/valgrind .\/target\/debug\/integration_test/' run.sh
sed -i 's/bitcoind/"$BITCOIND_EXE"/' run.sh
# Disable the integration test. Seems not to work even with bitcoin as far back as 0.21.
# Gives "wallet verification failed" errors which are not transient
# or related to a Nix environment. They are just indicative of the tests
# having rotted.
#./run.sh
''
else "";
};
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;
}