feat(tvix/eval): implement unsafeDiscardOutputDependency

This builtin only transforms any `NixContextElement::Derivation` into the trivial `NixContextElement::Plain`.

This is a forgetful functor on derivation-deep context strings.

The test coverage of this change is done in cl/11264.

Change-Id: Icd00778c97766be6db8a6bdabaa59e9724353ec5
Signed-off-by: Ryan Lahfa <tvl@lahfa.xyz>
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11262
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
Ryan Lahfa 2024-03-25 01:01:16 +01:00 committed by raitobezarius
parent 94185f7560
commit 8bccc9dca9
3 changed files with 43 additions and 7 deletions

View file

@ -48,6 +48,12 @@ impl From<NixContextElement> for NixContext {
}
}
impl From<HashSet<NixContextElement>> for NixContext {
fn from(value: HashSet<NixContextElement>) -> Self {
Self(value)
}
}
impl NixContext {
/// Creates an empty context that can be populated
/// and passed to form a contextful [NixString], albeit