Repository navigation
evaluator: read the Nix 2.34 derivation show format - #296
Conversation
NotAShelf
left a comment
There was a problem hiding this comment.
Two notes.
Also FYI: CA outputs have no path in v4, and are silently dropped now.
| #[test] | ||
| fn reads_basename_inputs_and_outputs() { | ||
| let drv = json!({ | ||
| "inputs": { "drvs": { "aaa-leaf.drv": { "outputs": ["out"] } }, "srcs": [] }, |
There was a problem hiding this comment.
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)?
|
Also just occurred to me. You moved outputs/input-drvs/paths into shared helpers but left system extraction duplicated between here and |
4666d5e to
83e9bb1
Compare
| .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) |
There was a problem hiding this comment.
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
83e9bb1 to
8ef0f97
Compare
No description provided.