about summary refs log tree commit diff
path: root/tvix/eval
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2023-12-30T02·01+0100
committertazjin <tazjin@tvl.su>2024-01-03T13·01+0000
commit6b136dfd23c03cc61d189ad5d41dd881e45b677e (patch)
tree2d92ac61ac1dcac39fe9e540096ff91d25ee33b6 /tvix/eval
parentd5aa75bbcf5efb13a82330414e26a4a582453552 (diff)
feat(tvix/glue): emit a warning in case of bad SRI hashes r/7311
And include a test to ensure we show the warning.

Change-Id: Ib6a436dbba2592b398b54e44f15a48d1aa345099
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10470
Tested-by: BuildkiteCI
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
Diffstat (limited to 'tvix/eval')
-rw-r--r--tvix/eval/src/warnings.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/warnings.rs b/tvix/eval/src/warnings.rs
index e007d9c34f2d..f537aa913e40 100644
--- a/tvix/eval/src/warnings.rs
+++ b/tvix/eval/src/warnings.rs
@@ -18,6 +18,7 @@ pub enum WarningKind {
     EmptyInherit,
     EmptyLet,
     ShadowedOutput(String),
+    SRIHashWrongPadding,
 
     /// Tvix internal warning for features triggered by users that are
     /// not actually implemented yet, but do not cause runtime failures.
@@ -105,6 +106,7 @@ impl EvalWarning {
                 "this derivation's environment shadows the output name {}",
                 out
             ),
+            WarningKind::SRIHashWrongPadding => "SRI hash has wrong padding".to_string(),
 
             WarningKind::NotImplemented(what) => {
                 format!("feature not yet implemented in tvix: {}", what)
@@ -127,6 +129,7 @@ impl EvalWarning {
             WarningKind::EmptyInherit => "W009",
             WarningKind::EmptyLet => "W010",
             WarningKind::ShadowedOutput(_) => "W011",
+            WarningKind::SRIHashWrongPadding => "W012",
 
             WarningKind::NotImplemented(_) => "W999",
         }