-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exportReferencesGraph
started including a valid: true
field
#10485
Labels
Comments
Potentially caused by #9242 |
That PR description even mentions the stability in structured attrs:
|
New output has a "valid" field. {
"closureSize": 2216152,
"narHash": "sha256:0z1mdik09afiskvxjzcxl60sq0rzvh7lx6a7hxs2q1s379r6n1n5",
"narSize": 358784,
"path": "/nix/store/w4djxksksd1p8m054k537plqnif5858k-libidn2-2.3.4",
"references": [
"/nix/store/4r64z7v5l40pg6r0hd169bcs85c8c42b-libunistring-1.1",
"/nix/store/w4djxksksd1p8m054k537plqnif5858k-libidn2-2.3.4"
],
"valid": true
} Perhaps just: diff --git a/src/libstore/parsed-derivations.cc b/src/libstore/parsed-derivations.cc
index 72f45143d..09801919f 100644
--- a/src/libstore/parsed-derivations.cc
+++ b/src/libstore/parsed-derivations.cc
@@ -151,8 +151,6 @@ static nlohmann::json pathInfoToJSON(
// Add the path to the object whose metadata we are including.
jsonPath["path"] = store.printStorePath(storePath);
- jsonPath["valid"] = true;
-
jsonPath["closureSize"] = ({
uint64_t totalNarSize = 0;
StorePathSet closure; |
@Ericson2314 did #9242 resolve this? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
I started writing some types for the reference graph structure that Nix emits when its
exportReferencesGraph
feature is used.I initially included the
valid
boolean (which seems to be always true).I then triggered the build on another machine running an older version of Nix (2.3), and my parsing code failed, as the
valid
field was not present.While probably not too much code relies on this, and instead looks at individual fields it knows to be present, we should produce the same JSON across versions. It'd be good if this output stays consistent across versions, and the additional field in there gets removed again.
Steps To Reproduce
Build
stdenv.mkDerivation { name = "hello"; __structuredAttrs = true; exportReferencesGraph.blub = [ pkgs.hello ]; nativeBuildInputs = [pkgs.jq]; buildCommand = "jq -rc .blub $NIX_ATTRS_JSON_FILE > $out"; }
on a machine with current Nix, and on one with Nix 2.3. Observe how the resulting output differs and the Nix version used is observable through that.Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: