Skip to content

Adding an attribute to a locked input is a breaking change #8940

@roberth

Description

@roberth

Describe the bug

#5385 added the dirtyRev attribute, which is rejected by Nix versions < 2.16.

A similar situation will arise whenever previously unknown attributes are added to the lock.

On the one hand this error seems redundant because of narHash. However, it may be unclear how the attributes should be treated.

Steps To Reproduce

  1. Lock a dirty input with Nix 2.17
  2. Evaluate again with Nix <= 2.16
  3. error: unsupported Git input attribute 'dirtyRev'

Expected behavior

dirtyRev and the other attribute are just ignore? Not sure.

nix-env --version output

Additional context

Maybe it should be breaking because of

This is unfortunate.
Should the lock file have an field that's open for extension? For metadata that must not affect the value of the fetched file system objects, but is added to the returned attributes.
This might be a flake level thing instead of a fetcher level thing, although libfetchers is responsible for getting that metadata. Maybe in-between? libfetchers provides a meta attr in which such attributes are nested. So not a flake thing after all, but still something that's easily discerned by the libfetchers user.

Of course in some cases breaking is the only sensible thing to do, though it will require everyone to upgrade their Nix.

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfetchingNetworking with the outside (non-Nix) world, input lockingflakes
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions