about summary refs log tree commit diff
path: root/tvix/eval/src/warnings.rs
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-12-09T09·47+0300
committertazjin <tazjin@tvl.su>2022-12-21T13·23+0000
commit9bc1e6ef055bc1d835d258a2e21e6cfe6ae63cb9 (patch)
treef9204beae2cfb63ff47d607fb4797d519b48e1e4 /tvix/eval/src/warnings.rs
parent9d6ee5b6a69195bc1a3d5543f04998b631584076 (diff)
feat(tvix/eval): add configuration of Nix search path to public API r/5443
This is required for passing through NIX_PATH from the CLI.

Change-Id: If129df79ef9c3ffab31408adb85679909276c4f0
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7544
Reviewed-by: grfn <grfn@gws.fyi>
Autosubmit: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
Diffstat (limited to '')
-rw-r--r--tvix/eval/src/warnings.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/tvix/eval/src/warnings.rs b/tvix/eval/src/warnings.rs
index 63574b5389..eb821b2b83 100644
--- a/tvix/eval/src/warnings.rs
+++ b/tvix/eval/src/warnings.rs
@@ -12,6 +12,7 @@ pub enum WarningKind {
     UnusedBinding,
     ShadowedGlobal(&'static str),
     DeprecatedLegacyLet,
+    InvalidNixPath(String),
 
     /// Tvix internal warning for features triggered by users that are
     /// not actually implemented yet, but do not cause runtime failures.
@@ -80,6 +81,10 @@ impl EvalWarning {
                 "legacy `let` syntax used, please rewrite this as `let .. in ...`".to_string()
             }
 
+            WarningKind::InvalidNixPath(ref err) => {
+                format!("invalid NIX_PATH resulted in a parse error: {}", err)
+            }
+
             WarningKind::NotImplemented(what) => {
                 format!("feature not yet implemented in tvix: {}", what)
             }
@@ -95,6 +100,7 @@ impl EvalWarning {
             WarningKind::UnusedBinding => "W003",
             WarningKind::ShadowedGlobal(_) => "W004",
             WarningKind::DeprecatedLegacyLet => "W005",
+            WarningKind::InvalidNixPath(_) => "W006",
             WarningKind::NotImplemented(_) => "W999",
         }
     }