ci/eval: re-implement compare in nix#362844
Conversation
a52d86c to
99b6127
Compare
99b6127 to
0474aa6
Compare
ci/eval/compare/default.nix
Outdated
There was a problem hiding this comment.
We could put those in the toJSON call below but it would require a rec. I don't know what is the recommended way.
0474aa6 to
4abc536
Compare
infinisil
left a comment
There was a problem hiding this comment.
As long as it works, both in GHA's and using a local nix-build ci -A eval.compare ..., this LGTM!
Oh wow, this looks fancy !
It is kind of already the case no ? Here are the definitions I went with. Note: By "item" I mean a tuple (platform, name) (ex:
At this stage, Now, where this gets slightly tricky is that we don't report those affected items directly but only their names. I.e. we need to get rid of the platform. While in most cases, a single name will only end up in a single category, our (artificial) example of Having said that, this is not too crucial because what really counts is the number of rebuilds. The definition of rebuilds is precise and consensual: where |
|
@infinisil if you are happy with it, feel free to merge this PR. |
It is up to the CI team tho I get the impression that a nix implementation is preferred. I find duckdb is pretty handy to query json files but am not sure how others feel about sql. the sql implementation emits a json file which can be use to query what to build for each platform. eg:
did you mean can see the many to 1 mapping when looking at the output of a llvm-19 upgrade https://github.com/paparodeo/nixpkgs/actions/runs/12214197953 |
Definitely.
Your implementation looks very nice indeed ! I am not too familiar with SQL and would be unable to maintain it. However if it does the job and is preferred by the CI team, I would be fine with it of course.
Yes. I have corrected my previous message, thanks.
Very true. Now I understand your many-to-one point. I think that the current implem also suffers from this issue. I don't know how crucial it is though. Of course, having an accurate solution would be better though. |
|
Nix is probably a better cultural fit looking for the contributors than sql. |
yes the current implementation also has this problem. also seemed like it missed a rebuild when the but darwin should also get a rebuild -- not sure if this PR has the same issue. the sql does the right thing given the same inputs. |
this PR seems to handle https://github.com/NixOS/nixpkgs/actions/runs/12178480057 correctly (master marks darwin as 0 builds). so that's good!. {
"attrdiff": {
"added": [
"netris"
],
"changed": [
"netris"
],
"removed": []
},
"labels": {
"darwin": "10.rebuild-darwin: 1-10",
"linux": "10.rebuild-linux: 1-10"
},
"rebuildCountByKernel": {
"darwin": 1,
"linux": 1
},
"rebuildsByKernel": {
"darwin": [
"netris"
],
"linux": [
"netris"
]
}
} |
4abc536 to
f94b4bd
Compare
|
Any further feedback/requests on this ? |
|
Doing a test run in Mic92#40. |
|
seems to be mis-labeling: https://github.com/NixOS/nixpkgs/actions/runs/12252092760 listed as "labels": {
"darwin": "10.rebuild-darwin: 101-500",
"linux": "10.rebuild-linux: 101-500"
},
"rebuildCountByKernel": {
"darwin": 11,
"linux": 12
},diff --git a/ci/eval/compare/utils.nix b/ci/eval/compare/utils.nix
index 22353499d699..2794b5eda4ec 100644
--- a/ci/eval/compare/utils.nix
+++ b/ci/eval/compare/utils.nix
@@ -113,6 +113,8 @@ rec {
"0"
else if rebuildCount <= 10 then
"1-10"
+ else if rebuildCount <= 100 then
+ "11-100"
else if rebuildCount <= 500 then
"101-500"
else if rebuildCount <= 1000 then |
Indeed, the |
Things done
This is a reimplementation in nix of the current
compare.jqlogic.Later, I will add more information in the produced JSON (so that we can use this in nixpkgs-review).
For now, this is a strict equivalent of the previous jq implementation.
There is one logic change that might be acceptable:
If a package
fooexisted, but was not available on platformaarch64-darwinand the PR makes it available for this platform, should it be listed as an added package or as a changed one ?The current implementation lists it in
changedwhile the new one consider puts it inchanged.This should not be too hard to change.
Please, feel free to criticize the implementation details and propose some refactoring.
It might lack some commenting and also variable names could be wiser.
cc @Mic92 @infinisil
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.