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

nix fmt errors out with "warnings does not exist" #210

Open
kjeremy opened this issue Aug 8, 2024 · 4 comments
Open

nix fmt errors out with "warnings does not exist" #210

kjeremy opened this issue Aug 8, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@kjeremy
Copy link

kjeremy commented Aug 8, 2024

Describe the bug

$ nix fmt
warning: Git tree '/home/jkolb/ara/mrak-robot' is dirty
error:
       … while calling the 'head' builtin
         at /nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source/lib/attrsets.nix:522:11:
          521|         || pred here (elemAt values 1) (head values) then
          522|           head values
             |           ^
          523|         else

       … while calling the 'head' builtin
         at /nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source/lib/attrsets.nix:522:11:
          521|         || pred here (elemAt values 1) (head values) then
          522|           head values
             |           ^
          523|         else

       … while calling the 'head' builtin
         at /nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source/lib/attrsets.nix:522:11:
          521|         || pred here (elemAt values 1) (head values) then
          522|           head values
             |           ^
          523|         else

       … while calling the 'head' builtin
         at /nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source/lib/attrsets.nix:522:11:
          521|         || pred here (elemAt values 1) (head values) then
          522|           head values
             |           ^
          523|         else

       … while calling the 'head' builtin
         at /nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source/lib/attrsets.nix:522:11:
          521|         || pred here (elemAt values 1) (head values) then
          522|           head values
             |           ^
          523|         else

       … while evaluating the attribute 'config.build.wrapper'
         at /nix/store/16ik5rfzbjbl2kxpagqx5rp03hkd32qp-source/lib/modules.nix:363:9:
          362|         options = checked options;
          363|         config = checked (removeAttrs config [ "_module" ]);
             |         ^
          364|         _module = checked (config._module);

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: The option `warnings' does not exist. Definition values:
       - In `/nix/store/p3qlccgpbygl0qpjcw9j9b0dx3vpdxrn-source/programs/ruff.nix': [ ]

To Reproduce

Steps to reproduce the behavior:

  1. Add nixtree-fmt to your flake
  2. run nix fmt

Expected behavior

It should work

System information

$ nix --version
nix (Nix) 2.23.3

cat flake.lock

{
  "nodes": {
    "flake-utils": {
      "locked": {
        "lastModified": 1659877975,
        "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
        "owner": "numtide",
        "repo": "flake-utils",
        "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "flake-utils",
        "type": "github"
      }
    },
    "nix-ros": {
      "inputs": {
        "flake-utils": [
          "flake-utils"
        ],
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1664303028,
        "narHash": "sha256-7UuUEIkPxqDMDrfmFJZ/gdM6nGFpUzBWe10ss41Kofk=",
        "owner": "lopsided98",
        "repo": "nix-ros-overlay",
        "rev": "139ab5d3fa3c8327c2cf493d8b6e45b39f9714dd",
        "type": "github"
      },
      "original": {
        "owner": "lopsided98",
        "repo": "nix-ros-overlay",
        "type": "github"
      }
    },
    "nixpkgs": {
      "locked": {
        "lastModified": 1672580127,
        "narHash": "sha256-3lW3xZslREhJogoOkjeZtlBtvFMyxHku7I/9IVehhT8=",
        "owner": "NixOS",
        "repo": "nixpkgs",
        "rev": "0874168639713f547c05947c76124f78441ea46c",
        "type": "github"
      },
      "original": {
        "owner": "NixOS",
        "ref": "nixos-22.05",
        "repo": "nixpkgs",
        "type": "github"
      }
    },
    "root": {
      "inputs": {
        "flake-utils": "flake-utils",
        "nix-ros": "nix-ros",
        "nixpkgs": "nixpkgs",
        "treefmt-nix": "treefmt-nix"
      }
    },
    "treefmt-nix": {
      "inputs": {
        "nixpkgs": [
          "nixpkgs"
        ]
      },
      "locked": {
        "lastModified": 1722330636,
        "narHash": "sha256-uru7JzOa33YlSRwf9sfXpJG+UAV+bnBEYMjrzKrQZFw=",
        "owner": "numtide",
        "repo": "treefmt-nix",
        "rev": "768acdb06968e53aa1ee8de207fd955335c754b7",
        "type": "github"
      },
      "original": {
        "owner": "numtide",
        "repo": "treefmt-nix",
        "type": "github"
      }
    }
  },
  "root": "root",
  "version": 7
}

Removing inputs.nixpkgs.follows = "nixpkgs"; from my flake doesn't help.

Additional context

@kjeremy kjeremy added the bug Something isn't working label Aug 8, 2024
@zimbatm
Copy link
Member

zimbatm commented Aug 10, 2024

I suspect the issue is that nixos-22.05 is too old and doesn't support

(lib.mkRenamedOptionModule [ "programs" "ruff" "enable" ] [ "programs" "ruff" "check" ])

@kjeremy
Copy link
Author

kjeremy commented Aug 10, 2024 via email

@kjeremy
Copy link
Author

kjeremy commented Aug 12, 2024

I suspect the issue is that nixos-22.05 is too old and doesn't support

(lib.mkRenamedOptionModule [ "programs" "ruff" "enable" ] [ "programs" "ruff" "check" ])

mkRenamedOptionModule was introduced well before 22.05 so I don't think that's it.

@zimbatm
Copy link
Member

zimbatm commented Aug 15, 2024

I don't know how to reproduce the error, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants