-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Description
Currently, we include the store directories in store paths in JSON. This makes for nice-looking JSON that is easy for humans to manipulate.
However, it comes at a cost in that it breaks almost all JSON frameworks somewhat: the store dir is not actually part of the store path data type, and so it must be smuggled in somehow. We work around it with ad-hoc code in C++, but in other languages the expectation is for JSON to be very "regularly" defined, e.g. with traits/type classes, and so forcing things to be ad-hoc carries a higher costs.
Here are some options:
-
Just don't include a store dir any more. The JSON would like like e.g.
"0nxvi9r5ymdlr2p24rjj9qzyms72zld1-bash-interactive-5.2p37" -
Parse any store dir. As long as the path ends with the store object file name, and isn't something like
/nix/store/0nxvi9r5ymdlr2p24rjj9qzyms72zld1-bash-interactive-5.2p37/bin/bash, we can just peal off all leading directories and just parse its "basename". but in the to-JSON direction, we still need to come up with a store directory out of thin error. That breaks the languages infrastructure. -
In fancier languages, do the moral equivalent of
StorePath<"/Nix/Store">, which allows us to smuggle in the store dir at compile time. This works, but leaves less fancy languages in the lurch. It replaces one source of intimidating complexity with another. -
Just do nothing, because we care more about the human case than the machine case.
-
Hash -
DerivedPath/ deriving path- schema: JSON Schema for
DerivedPath#14344 - Better JSON for wildcard Make
OutputsSpec::AllJSON be"*"not["*"]#14528
- schema: JSON Schema for
-
Realisation/ build trace entry -
ValidPathInfo- schema
- tests
- some formal spec Convert store path info JSON docs to formal JSON Schema, and test #14399
- Make
cafields structural, not string Modifications to the JSON formats forDerivationandValidPathInfo#14493 - Make hashes structured More store object info json cleanup #14502
- instances Make
ValidPathInfo,NarInfoJSON instances, but don't yet use in the CLI #14503 - Make store paths not include store dir in CLI too
-
Derivation- schema
- tests
- Group
inputSrcsandinputDrvstogether asinputs.{srcs,drvs}Modifications to the JSON formats forDerivationandValidPathInfo#14493 - Better version error for JSON derivation decoding #14501
-
DerivationOptions- schema JSON Schema for
DerivationOptions#14507 - tests
- JSON for existing tests FIx
DerivationOptionsJSON and clean up unit tests #14471 - Extend test suite to cover more cases Test output checks referring to other outputs #14505
- JSON for existing tests FIx
- Parse more up-font, into
StorePath,DerivingPath, etc. Parse deriving paths inDerivationOptions#14506 - Include
DerivationOptionsinDerivationStoreDerivationOptioninsteadDerivation, put in JSON format #10760
- schema JSON Schema for
-
BuildResult- schema
- tests
- Ensure complete coverage vis-a-vis binrary protocols JSON alongside binary proto serialization test data #14504