Inadequate forward compatibility in derivations #10876
Labels
bug
derivation design
Issues to consider for new versions of the derivation format (major or incremental)
Describe the bug
Derivations did't have a versioning mechanism; only
requiredFeatures
can be used for making older Nixes reject derivations they're not capable of building.RFC 92 dynamic derivations work around this by intentionally breaking the first token (
Derivation
->DrvWithVersion
).This created a slot for somewhat of a version string, for which currently the only valid value is
"xp-dyn-drv"
.While it is a step in the right direction, it is still far from a solution.
Consider also that we may have multiple viable build capability implementations besides the one in this repo.
Steps To Reproduce
Consider the introduction of
unsafeDiscardReferences
. Nix versions that don't support it, will happily build such derivations, and realise outputs that have references they shouldn't.This case is particularly bad because no error is raised and outputs are assumed to be correct and immutable by all sorts of other features, so a bad output is not easy to recover from.
Expected behavior
Nix should fail when it's not capable of building a derivation with an unknown feature.
What I currently hold as the best mechanism is a set of feature labels, not unlike
requiredFeatures
, but for which it is not required to configure them in the remote builder list. We may also come to agreement on "standard" features to establish feature levels that can reasonably be expected to be implemented, reducing the number of features that need to be enabled in any given modern derivation. A feature level would simply be a feature that implies other features, including previous levels.Additional context
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: