This is so that users can use either Rust's json5 crate (and they would disable serde-hex in amd-apcb) or just Rust's serde_json crate (and they would enable the feature serde-hex in amd-apcb).
The new feature is the support of the json5 crate.
JSON5 is a superset of JSON. JSON5 still evaluate fine when interpreted as Javascript, but cannot be loaded by Javascript's JSON.parse.
The advantages of JSON5 useful to us are:
Native hex literals are allowed
Trailing comma in lists is allowed
Comments are allowed
Note that this PR doesn't make it mandatory to use json5 in any way.
The intent is also to leave SerdeHex* structs private as an implementation detail, so whether or not the feature serde-hex is enabled should not affect the API in any way, except for Serde traits.
amd-host-image-builder, if unchanged except for the updated amd-apcb reference, would have to enable the feature serde-hex.
(A JSON5-aware amd-host-image-builder has been written and PR will be forthcoming)
This is so that users can use either Rust's
json5
crate (and they would disableserde-hex
inamd-apcb
) or just Rust'sserde_json
crate (and they would enable the featureserde-hex
inamd-apcb
).The new feature is the support of the
json5
crate.JSON5 is a superset of JSON. JSON5 still evaluate fine when interpreted as Javascript, but cannot be loaded by Javascript's
JSON.parse
.The advantages of JSON5 useful to us are:
Note that this PR doesn't make it mandatory to use
json5
in any way.The intent is also to leave
SerdeHex*
structs private as an implementation detail, so whether or not the featureserde-hex
is enabled should not affect the API in any way, except for Serde traits.amd-host-image-builder, if unchanged except for the updated amd-apcb reference, would have to enable the feature
serde-hex
.(A JSON5-aware amd-host-image-builder has been written and PR will be forthcoming)