From 2b4ad47c16dc0fb114be0fd03526ffb871aa1875 Mon Sep 17 00:00:00 2001 From: Linus Heckemann Date: Thu, 1 Jun 2023 21:21:23 +0200 Subject: fix(tvix/eval): emit only warnings on shadowed outputs Unfortunately, nixpkgs has at least one case[1] where the out environment variable is shadowed -- though it doesn't cause a problem, since it's shadowed with the correct value, odd as this may be! [1]: https://github.com/NixOS/nixpkgs/blob/c7c298471676ac1c7789ab3c424fbcebecaa6791/pkgs/development/python-modules/pybind11/default.nix#L19 Change-Id: Ibf6790d2484dc9cce8e424feeb5886664d498dc3 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8696 Autosubmit: tazjin Reviewed-by: tazjin Tested-by: BuildkiteCI --- tvix/cli/src/derivation.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tvix/cli/src/derivation.rs') diff --git a/tvix/cli/src/derivation.rs b/tvix/cli/src/derivation.rs index cf15ebbb0d..fa246cc74f 100644 --- a/tvix/cli/src/derivation.rs +++ b/tvix/cli/src/derivation.rs @@ -5,8 +5,8 @@ use std::cell::RefCell; use std::collections::{btree_map, BTreeSet}; use std::rc::Rc; use tvix_eval::builtin_macros::builtins; -use tvix_eval::generators::{self, GenCo}; -use tvix_eval::{AddContext, CoercionKind, ErrorKind, NixAttrs, NixList, Value}; +use tvix_eval::generators::{self, emit_warning_kind, GenCo}; +use tvix_eval::{AddContext, CoercionKind, ErrorKind, NixAttrs, NixList, Value, WarningKind}; use crate::errors::Error; use crate::known_paths::{KnownPaths, PathKind, PathName}; @@ -327,7 +327,7 @@ mod derivation_builtins { .insert(output.to_string(), String::new()) .is_some() { - return Err(Error::ShadowedOutput(output.to_string()).into()); + emit_warning_kind(&co, WarningKind::ShadowedOutput(output.to_string())).await; } } -- cgit 1.4.1