fix(tvix/cli): handle SRI hashes in outputHash
Instead of being called with `md5`, `sha1`, `sha256` or `sha512`, `fetchurl.nix` (from corepkgs / `<nix`) can also be called with a `hash` attribute, being an SRI hash. In that case, `builtin.derivation` is called with `outputHashAlgo` being an empty string, and `outputHash` being an SRI hash string. In other cases, an SRI hash is passed as outputHash, but outputHashAlgo is set too. Nix does modify these values in (single, fixed) output specification it serializes to ATerm, but keeps it unharmed in `env`. Move this into a construct_output_hash helper function, that can be tested better in isolation. Change-Id: Id9d716a119664c44ea7747540399966752e20187 Reviewed-on: https://cl.tvl.fyi/c/depot/+/7933 Reviewed-by: tazjin <tazjin@tvl.su> Autosubmit: flokli <flokli@flokli.de> Tested-by: BuildkiteCI
This commit is contained in:
parent
bda5fc58d0
commit
a94a1434cc
5 changed files with 573 additions and 38 deletions
|
|
@ -12,6 +12,12 @@ tvix-eval = { path = "../eval" }
|
|||
tvix-derivation = { path = "../derivation" }
|
||||
rustyline = "10.0.0"
|
||||
clap = { version = "4.0", features = ["derive", "env"] }
|
||||
tvix-store-bin = { path = "../store" }
|
||||
dirs = "4.0.0"
|
||||
smol_str = "0.1"
|
||||
aho-corasick = "0.7"
|
||||
ssri = "7.0.0"
|
||||
data-encoding = "2.3.3"
|
||||
|
||||
[dev-dependencies]
|
||||
test-case = "2.2.2"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue