Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/eval.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ jobs:
MATRIX_SYSTEM: ${{ matrix.system }}
run: |
nix-build nixpkgs/untrusted/ci --arg nixpkgs ./nixpkgs/untrusted-pinned -A eval.diff \
--arg beforeDir "$(readlink ./target)" \
--arg afterDir "$(readlink ./merged)" \
--arg beforeDir ./target \
--arg afterDir ./merged \
--argstr evalSystem "$MATRIX_SYSTEM" \
--out-link diff

Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:

# Use the target branch to get accurate maintainer info
nix-build nixpkgs/trusted/ci --arg nixpkgs ./nixpkgs/trusted-pinned -A eval.compare \
--arg combinedDir "$(realpath ./combined)" \
--arg combinedDir ./combined \
--arg touchedFilesJson ./touched-files.json \
--argstr githubAuthorId "$AUTHOR_ID" \
--out-link comparison
Expand Down
4 changes: 2 additions & 2 deletions ci/eval/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ Note that 16GB memory is the recommended minimum, while with less than 8GB memor
To compare two commits locally, first run the following on the baseline commit:

```
BASELINE=$(nix-build ci -A eval.baseline --no-out-link)
nix-build ci -A eval.baseline --out-link baseline
```

Then, on the commit with your changes:

```
nix-build ci -A eval.full --arg baseline $BASELINE
nix-build ci -A eval.full --arg baseline ./baseline
```

Keep in mind to otherwise pass the same set of arguments for both commands (`evalSystems`, `quickTest`, `chunkSize`).
Expand Down
8 changes: 5 additions & 3 deletions ci/eval/compare/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
byName ? false,
}:
let
combined = builtins.storePath combinedDir;

/*
Derivation that computes which packages are affected (added, changed or removed) between two revisions of nixpkgs.
Note: "platforms" are "x86_64-linux", "aarch64-darwin", ...
Expand Down Expand Up @@ -75,7 +77,7 @@ let
# Attrs
# - keys: "added", "changed", "removed" and "rebuilds"
# - values: lists of `packagePlatformPath`s
diffAttrs = builtins.fromJSON (builtins.readFile "${combinedDir}/combined-diff.json");
diffAttrs = builtins.fromJSON (builtins.readFile "${combined}/combined-diff.json");

changedPackagePlatformAttrs = convertToPackagePlatformAttrs diffAttrs.changed;
rebuildsPackagePlatformAttrs = convertToPackagePlatformAttrs diffAttrs.rebuilds;
Expand Down Expand Up @@ -139,8 +141,8 @@ runCommand "compare"
maintainers = builtins.toJSON maintainers;
passAsFile = [ "maintainers" ];
env = {
BEFORE_DIR = "${combinedDir}/before";
AFTER_DIR = "${combinedDir}/after";
BEFORE_DIR = "${combined}/before";
AFTER_DIR = "${combined}/after";
};
}
''
Expand Down
11 changes: 7 additions & 4 deletions ci/eval/diff.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
}:

let
before = builtins.storePath beforeDir;
after = builtins.storePath afterDir;

/*
Computes the key difference between two attrs

Expand Down Expand Up @@ -64,15 +67,15 @@ let
in
builtins.fromJSON data;

beforeAttrs = getAttrs beforeDir;
afterAttrs = getAttrs afterDir;
beforeAttrs = getAttrs before;
afterAttrs = getAttrs after;
diffAttrs = diff beforeAttrs afterAttrs;
diffJson = writeText "diff.json" (builtins.toJSON diffAttrs);
in
runCommand "diff" { } ''
mkdir -p $out/${evalSystem}

cp -r ${beforeDir} $out/before
cp -r ${afterDir} $out/after
cp -r ${before} $out/before
cp -r ${after} $out/after
cp ${diffJson} $out/${evalSystem}/diff.json
''
Loading