From b8b05d4da44abc3703e6b13dce78aa1d356d35d8 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sun, 11 May 2025 22:50:32 +0200 Subject: [PATCH] libexpr: remove dynamic derivation eval support Change-Id: I8bbdaa280f634bafd5abd7034a605564f45978c0 --- lix/libexpr/builtins/outputOf.md | 23 ----------------------- lix/libexpr/meson.build | 1 - lix/libexpr/primops.cc | 15 --------------- lix/nix/main.cc | 3 +-- 4 files changed, 1 insertion(+), 41 deletions(-) delete mode 100644 lix/libexpr/builtins/outputOf.md diff --git a/lix/libexpr/builtins/outputOf.md b/lix/libexpr/builtins/outputOf.md deleted file mode 100644 index 905e5d328..000000000 --- a/lix/libexpr/builtins/outputOf.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -name: outputOf -args: [derivation-reference, output-name] -experimentalFeature: dynamic-derivations ---- -Return the output path of a derivation, literally or using a placeholder if needed. - -If the derivation has a statically-known output path (i.e. the derivation output is input-addressed, or fixed content-addressed), the output path will just be returned. -But if the derivation is content-addressed or if the derivation is itself not-statically produced (i.e. is the output of another derivation), a placeholder will be returned instead. - -*`derivation reference`* must be a string that may contain a regular store path to a derivation, or may be a placeholder reference. If the derivation is produced by a derivation, you must explicitly select `drv.outPath`. -This primop can be chained arbitrarily deeply. -For instance, - -```nix -builtins.outputOf - (builtins.outputOf myDrv "out) - "out" -``` - -will return a placeholder for the output of the output of `myDrv`. - -This primop corresponds to the `^` sigil for derivable paths, e.g. as part of installable syntax on the command line. diff --git a/lix/libexpr/meson.build b/lix/libexpr/meson.build index 9b029e562..f0f5618bc 100644 --- a/lix/libexpr/meson.build +++ b/lix/libexpr/meson.build @@ -115,7 +115,6 @@ builtin_definitions = files( 'builtins/mapAttrs.md', 'builtins/match.md', 'builtins/mul.md', - 'builtins/outputOf.md', 'builtins/parseDrvName.md', 'builtins/parseFlakeRef.md', 'builtins/partition.md', diff --git a/lix/libexpr/primops.cc b/lix/libexpr/primops.cc index 0a133f89d..a477706d3 100644 --- a/lix/libexpr/primops.cc +++ b/lix/libexpr/primops.cc @@ -1390,21 +1390,6 @@ static void prim_readDir(EvalState & state, Value * * args, Value & v) v.mkAttrs(attrs); } -/* Extend single element string context with another output. */ -static void prim_outputOf(EvalState & state, Value * * args, Value & v) -{ - SingleDerivedPath drvPath = state.coerceToSingleDerivedPath(noPos, *args[0], "while evaluating the first argument to builtins.outputOf"); - - OutputNameView outputName = state.forceStringNoCtx(*args[1], noPos, "while evaluating the second argument to builtins.outputOf"); - - state.mkSingleDerivedPathString( - SingleDerivedPath::Built { - .drvPath = make_ref(drvPath), - .output = std::string { outputName }, - }, - v); -} - /************************************************************* * Creating files *************************************************************/ diff --git a/lix/nix/main.cc b/lix/nix/main.cc index 819da09bb..dbe57e80e 100644 --- a/lix/nix/main.cc +++ b/lix/nix/main.cc @@ -516,8 +516,7 @@ void mainWrapped(AsyncIoRoot & aio, int argc, char * * argv) if (argc == 2 && std::string(argv[1]) == "__dump-language") { experimentalFeatureSettings.experimentalFeatures.override(ExperimentalFeatures{} | Xp::Flakes - | Xp::FetchClosure - | Xp::DynamicDerivations); + | Xp::FetchClosure); evalSettings.pureEval.override(false); Evaluator state(aio, {}, aio.blockOn(openStore("dummy://"))); auto res = JSON::object();