Skip to content

evaluator: read the Nix 2.34 derivation show format - #296

Merged
amaanq merged 1 commit into
mainfrom
drv-show-format
Oct 16, 2026
Merged

amaanq merged 1 commit into
mainfrom
drv-show-format

Conversation

@amaanq

@amaanq amaanq commented Oct 14, 2026

Copy link
Copy Markdown
Member

No description provided.

@amaanq
amaanq added this pull request to stack #298 October 14, 2026 05:46

@NotAShelf NotAShelf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two notes.

Also FYI: CA outputs have no path in v4, and are silently dropped now.

Comment thread crates/nix/src/derivation.rs Outdated
#[test]
fn reads_basename_inputs_and_outputs() {
let drv = json!({
"inputs": { "drvs": { "aaa-leaf.drv": { "outputs": ["out"] } }, "srcs": [] },

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputs.drvs values are plain arrays of output names, e.g., "66lkh.....d-curl.drv": ["dev"]. The {"outputs": [...]} here only appears for the experimental dynamic-outputs variant (and then also carries dynamicOutputs).

I think the code is actually indifference since values are passed through as Value but this fixture is a little misleading.

Could we fix it to ["out"] (or make it the dynamic-outputs object with dynamicOutputs explicitly, if that variant was intentional)?

Comment thread crates/nix/src/derivation.rs Outdated
@NotAShelf

Copy link
Copy Markdown
Member

Also just occurred to me. You moved outputs/input-drvs/paths into shared helpers but left system extraction duplicated between here and parse_derivation_show in nix.rs. Could pull it into circus_nix::derivation too, for consistency. Up to you.

Comment on lines +188 to +196
.filter_map(|(name, output)| {
output
.get("path")
.or_else(|| output.get("outPath"))
.and_then(serde_json::Value::as_str)
.map(|path| (name.clone(), store_path(store_dir, path)))
})
.collect::<HashMap<_, _>>();
(!outputs.is_empty()).then_some(outputs)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only accepts path or outPath but Nix 2.34 seems to also omit these fields for ordinary FODs, not just floating CA derivs. For example, an actual FOD produced:

{
  "derivations": {
    "difmpadv2zdrx2zjx93b7hz4j0bdlb4w-circus-review-fixed.drv": {
      "args": [
        "-c",
        "echo fixed > $out"
      ],
      "builder": "/bin/sh",
      "env": {
        "builder": "/bin/sh",
        "name": "circus-review-fixed",
        "out": "/nix/store/xxsm4d3ygbv8c7f7il5djgz5xfc8w2b3-circus-review-fixed",
        "outputHash": "992a93455c71fedd36ac9bbc439952c041cf61445958472af479269b8d873513",
        "outputHashAlgo": "sha256",
        "outputHashMode": "recursive",
        "system": "x86_64-linux"
      },
      "inputs": {
        "drvs": {},
        "srcs": []
      },
      "name": "circus-review-fixed",
      "outputs": {
        "out": {
          "hash": "sha256-mSqTRVxx/t02rJu8Q5lSwEHPYURZWEcq9Hkmm42HNRM=",
          "method": "nar"
        }
      },
      "system": "x86_64-linux",
      "version": 4
    }
  },
  "version": 4
}

Its output path was already known and present in env.out, but your helper actually returned None.

tl;dr: your previous CA-output note therefore applies more broadly than the new "floating content-addressed outputs" comment suggests. Fixed-output paths should be recovered separately from genuinely unknown floating outputs. I'm not going to treat this as a blocker exactly, but it is a gap. You can address it now, or, we can merge this and you can address it afterwards.5

@amaanq
amaanq merged commit e09efc6 into main Oct 16, 2026
27 checks passed
@amaanq
amaanq deleted the drv-show-format branch October 16, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants