Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inadequate forward compatibility in derivations #10876

Open
roberth opened this issue Jun 9, 2024 · 0 comments
Open

Inadequate forward compatibility in derivations #10876

roberth opened this issue Jun 9, 2024 · 0 comments
Labels
bug derivation design Issues to consider for new versions of the derivation format (major or incremental)

Comments

@roberth
Copy link
Member

roberth commented Jun 9, 2024

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.

@roberth roberth added bug derivation design Issues to consider for new versions of the derivation format (major or incremental) labels Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug derivation design Issues to consider for new versions of the derivation format (major or incremental)
Projects
None yet
Development

No branches or pull requests

1 participant