From 37a570bd407d39ca6d0f9ea26815e3df1bf7308d Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 5 May 2025 20:39:37 +0200 Subject: [PATCH] deprecate CA, dynamic, and impure derivations ca derivations are what we're really after, but dynamic derivations must also go because they depend on ca derivations. we can't easily implement dynamic derivations any other way, so we remove them too. impure derivations build on the content-addressed infrastructure in ways we cannot easily detangle, so they too must go for time being. see #815 Change-Id: If61371736dfd89cc71a1b2ae5a005757c3cb9484 (cherry picked from commit d8e2f53d075dba607a91e76cf5a7c0b22c832944) --- .../rl-next/deprecated-derivation-types.md | 16 ++++++++++++ lix/libutil/config.cc | 25 +++++++++++++++++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 doc/manual/rl-next/deprecated-derivation-types.md diff --git a/doc/manual/rl-next/deprecated-derivation-types.md b/doc/manual/rl-next/deprecated-derivation-types.md new file mode 100644 index 000000000..011c9e2bc --- /dev/null +++ b/doc/manual/rl-next/deprecated-derivation-types.md @@ -0,0 +1,16 @@ +--- +synopsis: Deprecation of CA derivations, dynamic derivations, and impure derivations +issues: [fj#815] +cls: [] +significance: significant +category: Miscellany +credits: [] +--- + +Content-addressed derivations are now deprecated and slated for removal in Lix 2.94. +We're doing this because the CA derivation system has been a known cause of problems +and inconsistencies, is unmaintained, habitually makes improving the store code very +difficult (or blocks such improvements outright), and is beset by a number of design +flaws that in our opinion cannot be fixed without a full reimplementation from zero. +Dynamic derivations and impure derivations are built on the CA derivation framework, +and owing to this they too are deprecated and slated for removal in another release. diff --git a/lix/libutil/config.cc b/lix/libutil/config.cc index 55ecdcaf7..713b1b964 100644 --- a/lix/libutil/config.cc +++ b/lix/libutil/config.cc @@ -10,6 +10,7 @@ #include "lix/libutil/strings.hh" #include "lix/libutil/config-impl.hh" +#include namespace nix { @@ -343,11 +344,31 @@ template<> std::string BaseSetting::to_string() const template<> ExperimentalFeatures BaseSetting::parse(const std::string & str, const ApplyConfigOptions & options) const { + auto warnDeprecated294 = [](std::once_flag & flag, std::string_view thing) { + std::call_once(flag, [&] { + warn( + "The %s experimental feature is deprecated and will be removed in Lix 2.94. " + "See https://git.lix.systems/lix-project/lix/issues/815 for more details.", + thing + ); + }); + }; + ExperimentalFeatures res{}; for (auto & s : tokenizeString(str)) { - if (auto thisXpFeature = parseExperimentalFeature(s); thisXpFeature) + if (auto thisXpFeature = parseExperimentalFeature(s); thisXpFeature) { + if (*thisXpFeature == Xp::CaDerivations) { + static std::once_flag warned; + warnDeprecated294(warned, s); + } else if (*thisXpFeature == Xp::DynamicDerivations) { + static std::once_flag warned; + warnDeprecated294(warned, s); + } else if (*thisXpFeature == Xp::ImpureDerivations) { + static std::once_flag warned; + warnDeprecated294(warned, s); + } res = res | thisXpFeature.value(); - else + } else warn("unknown experimental feature '%s'", s); } return res;