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;