about summary refs log tree commit diff
path: root/tvix/cli/Cargo.toml
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-01-26T13·18+0100
committerclbot <clbot@tvl.fyi>2023-01-27T14·06+0000
commita94a1434cc2a57b330a2ad6f310573fb70e15e8a (patch)
treebb9b4c32c03252ae32e409fe9bd893de19568f21 /tvix/cli/Cargo.toml
parentbda5fc58d01d7513180da4456eb279a33f76bc1c (diff)
fix(tvix/cli): handle SRI hashes in outputHash r/5772
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
Diffstat (limited to 'tvix/cli/Cargo.toml')
-rw-r--r--tvix/cli/Cargo.toml6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/cli/Cargo.toml b/tvix/cli/Cargo.toml
index 45ed05e089..83796855b6 100644
--- a/tvix/cli/Cargo.toml
+++ b/tvix/cli/Cargo.toml
@@ -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"