diff --git a/lix/legacy/nix-build.cc b/lix/legacy/nix-build.cc index 9f3d5b02c..dcf4e811f 100644 --- a/lix/legacy/nix-build.cc +++ b/lix/legacy/nix-build.cc @@ -405,12 +405,6 @@ static void main_nix_build(AsyncIoRoot & aio, std::string programName, Strings a shell = store->printStorePath(shellDrvOutputs.at("out").value()) + "/bin/bash"; } - if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) { - auto resolvedDrv = aio.blockOn(drv.tryResolve(*store)); - assert(resolvedDrv && "Successfully resolved the derivation"); - drv = *resolvedDrv; - } - // Set the environment. auto env = getEnv(); diff --git a/lix/nix/app.cc b/lix/nix/app.cc index 4acb49675..1aaf4997f 100644 --- a/lix/nix/app.cc +++ b/lix/nix/app.cc @@ -11,46 +11,6 @@ namespace nix { -/** - * Return the rewrites that are needed to resolve a string whose context is - * included in `dependencies`. - */ -StringPairs resolveRewrites( - Store & store, - const std::vector & dependencies) -{ - StringPairs res; - if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) { - for (auto & dep : dependencies) { - if (auto drvDep = std::get_if(&dep.path)) { - for (auto & [ outputName, outputPath ] : drvDep->outputs) { - res.emplace( - DownstreamPlaceholder::fromSingleDerivedPathBuilt( - SingleDerivedPath::Built { - .drvPath = makeConstantStorePath(drvDep->drvPath.path), - .output = outputName, - }).render(), - store.printStorePath(outputPath) - ); - } - } - } - } - return res; -} - -/** - * Resolve the given string assuming the given context. - */ -std::string resolveString( - Store & store, - const std::string & toResolve, - const std::vector & dependencies) -{ - auto rewrites = resolveRewrites(store, dependencies); - return rewriteStrings(toResolve, rewrites); -} - UnresolvedApp InstallableValue::toApp(EvalState & state) { auto cursor = getCursor(state); @@ -136,8 +96,7 @@ App UnresolvedApp::resolve(EvalState & state, ref evalStore, ref s installableContext.push_back( make_ref(store, DerivedPath { ctxElt })); - auto builtContext = Installable::build(state, evalStore, store, Realise::Outputs, installableContext); - res.program = resolveString(*store, unresolved.program, builtContext); + Installable::build(state, evalStore, store, Realise::Outputs, installableContext); if (!store->isInStore(res.program)) throw Error("app program '%s' is not in the Nix store", res.program); diff --git a/lix/nix/develop.cc b/lix/nix/develop.cc index bb107d51c..90a14ba47 100644 --- a/lix/nix/develop.cc +++ b/lix/nix/develop.cc @@ -235,26 +235,19 @@ try { drv.name += "-env"; drv.env.emplace("name", drv.name); drv.inputSrcs.insert(std::move(getEnvShPath)); - if (experimentalFeatureSettings.isEnabled(Xp::CaDerivations)) { - for (auto & output : drv.outputs) { - output.second = DerivationOutput::Deferred {}, - drv.env[output.first] = hashPlaceholder(output.first); - } - } else { - for (auto & output : drv.outputs) { - output.second = DerivationOutput::Deferred { }; - drv.env[output.first] = ""; - } - auto hashesModulo = TRY_AWAIT(hashDerivationModulo(*evalStore, drv, true)); + for (auto & output : drv.outputs) { + output.second = DerivationOutput::Deferred { }; + drv.env[output.first] = ""; + } + auto hashesModulo = TRY_AWAIT(hashDerivationModulo(*evalStore, drv, true)); - for (auto & output : drv.outputs) { - Hash h = hashesModulo.hashes.at(output.first); - auto outPath = store->makeOutputPath(output.first, h, drv.name); - output.second = DerivationOutput::InputAddressed { - .path = outPath, - }; - drv.env[output.first] = store->printStorePath(outPath); - } + for (auto & output : drv.outputs) { + Hash h = hashesModulo.hashes.at(output.first); + auto outPath = store->makeOutputPath(output.first, h, drv.name); + output.second = DerivationOutput::InputAddressed { + .path = outPath, + }; + drv.env[output.first] = store->printStorePath(outPath); } auto shellDrvPath = TRY_AWAIT(writeDerivation(*evalStore, drv)); diff --git a/lix/nix/realisation.cc b/lix/nix/realisation.cc index 164b5e6c6..8151b7860 100644 --- a/lix/nix/realisation.cc +++ b/lix/nix/realisation.cc @@ -45,37 +45,7 @@ struct CmdRealisationInfo : BuiltPathsCommand, MixJSON void run(ref store, BuiltPaths && paths) override { - experimentalFeatureSettings.require(Xp::CaDerivations); - RealisedPath::Set realisations; - - for (auto & builtPath : paths) { - auto theseRealisations = aio().blockOn(builtPath.toRealisedPaths(*store)); - realisations.insert(theseRealisations.begin(), theseRealisations.end()); - } - - if (json) { - JSON res = JSON::array(); - for (auto & path : realisations) { - JSON currentPath; - if (auto realisation = std::get_if(&path.raw)) - currentPath = realisation->toJSON(); - else - currentPath["opaquePath"] = store->printStorePath(path.path()); - - res.push_back(currentPath); - } - logger->cout("%s", res); - } - else { - for (auto & path : realisations) { - if (auto realisation = std::get_if(&path.raw)) { - logger->cout("%s %s", - realisation->id.to_string(), - store->printStorePath(realisation->outPath)); - } else - logger->cout("%s", store->printStorePath(path.path())); - } - } + throw UnimplementedError("CA derivations are no longer supported"); } }; diff --git a/subprojects/nix-eval-jobs/src/drv.cc b/subprojects/nix-eval-jobs/src/drv.cc index 2d39c14a7..8821ee976 100644 --- a/subprojects/nix-eval-jobs/src/drv.cc +++ b/subprojects/nix-eval-jobs/src/drv.cc @@ -50,19 +50,10 @@ Drv::Drv(std::string &attrPath, nix::EvalState &state, nix::DrvInfo &drvInfo, auto localStore = state.ctx.store.try_cast_shared(); try { - // CA derivations do not have static output paths, so we have to - // defensively not query output paths in case we encounter one. for (auto &[outputName, optOutputPath] : - drvInfo.queryOutputs(state, !nix::experimentalFeatureSettings.isEnabled( - nix::Xp::CaDerivations))) { - if (optOutputPath) { - outputs[outputName] = - localStore->printStorePath(*optOutputPath); - } else { - assert(nix::experimentalFeatureSettings.isEnabled( - nix::Xp::CaDerivations)); - outputs[outputName] = std::nullopt; - } + drvInfo.queryOutputs(state, true)) { + assert(optOutputPath); + outputs[outputName] = localStore->printStorePath(*optOutputPath); } } catch (const std::exception &e) { // NOLINT(lix-foreign-exceptions) state.ctx.errors.make(