Make the JSON format for derivation use basename store paths#13980
Make the JSON format for derivation use basename store paths#13980roberth merged 1 commit intoNixOS:masterfrom
Conversation
1c8d301 to
aba1dee
Compare
|
A question remaining is whether we should have In today's context (stores always have single store dir) this would be pure denormaliation -- bad. But there is no reason that e.g. binary caches have a single store dir --- in that case including the store dir would actually be meaningful. If we include the store dir, we can have parse the old format in a self-contained way, but it would still be "uncompositional" in these formats, so I recommend not doing that. Perhaps a better thing we can do is include the output path for fixed-output derivations, and for which we need a store dir to calculate that path. If you see the code, you can see I removed it for now. That said, the path for fixed-output derivations is (given a store dir) pure denormalization also, and one would image e.g. a |
| [&](const DerivationOutput::InputAddressed & doi) { res["path"] = doi.path; }, | ||
| [&](const DerivationOutput::CAFixed & dof) { | ||
| res["path"] = store.printStorePath(dof.path(store, drvName, outputName)); | ||
| // res["path"] = dof.path(store, drvName, outputName); |
There was a problem hiding this comment.
Removed path for fixed-output-derivations (see comment above for details)
| #if 0 | ||
| if (dof.path(store, drvName, outputName) != static_cast<StorePath>(valueAt(json, "path"))) | ||
| throw Error("Path doesn't match derivation output"); | ||
| #endif |
There was a problem hiding this comment.
Removed path for fixed-output-derivations (see comment above for details)
aba1dee to
d8131e7
Compare
d8131e7 to
037e12c
Compare
src/libstore-tests/data/derivation/ca/advanced-attributes-structured-attrs.json
Show resolved
Hide resolved
See NixOS#13570 for details --- the idea is that included the store dir in store paths makes systematic JSON parting with e.g. Serde, Aeson, nlohmann, or similiar harder. After talking to Eelco, we are changing the `Derivation` format right away because not only is `nix derivation` technically experimental, we think it is also less widely used in practice than, say, `nix path-info`. Progress on NixOS#13570
037e12c to
9d7229a
Compare
roberth
left a comment
There was a problem hiding this comment.
Great to have a version number
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation
See #13570 for details --- the idea is that included the store dir in store paths makes systematic JSON parting with e.g. Serde, Aeson, nlohmann, or similiar harder.
After talking to Eelco, we are changing the
Derivationformat right away because not only isnix derivationtechnically experimental, we think it is also less widely used in practice than, say,nix path-info.Context
Progress on #13570
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.