Skip to content

nix path-info --json output changed #13413

Closed
@flokli

Description

@flokli

Describe the bug

It looks like the output of nix path-info --json did change accidentially (?)

With Nix 2.3 (and current Lix), it looks like this:

[{"path":"/nix/store/j7j8pwi5l7yw2aag07m2jz9saamhjx78-ncdu-2.8.2","valid":false}]

Current Nix shows it like this:

{"/nix/store/j7j8pwi5l7yw2aag07m2jz9saamhjx78-ncdu-2.8.2":null}

I didn't find any mention in the release notes of this breaking change.

The Nix 2.23 release notes mention a change in the JSON to not omit empty keys, but instead show them as nil, but this seems to be unrelated, there was never a mention of restructuring this output from using path: to using the path itself as a key.

My gut feeling is this broke in a random refactor an there was no test to catch it, but I didn't bisect yet.

Steps To Reproduce

Run nix path-info --json on a path, doesn't matter if valid or not. The format has moved to become a dict with the store paths as keys, where previously it was a list of dicts with a path key.

Expected behavior

Metadata

Additional context

Checklist


Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions