I am using nixOS
and I have a flake.nix. I use pre-commit
to run ruff
.
my pre-commit config:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: ruff
alias: autoformat
args: [--fix]
Now when committing .py
files I get this error:
[Errno 2] No such file or directory: '/home/{username}/.cache/pre-commit/repoo90awvpu/py_env-python3.11/bin/ruff'
But the file exists! I checked it. My ls
command (with a full path) gives me:
.rwxr-xr-x 23M {username} 28 Mär 00:26 /home/{username}/.cache/pre-commit/repoo90awvpu/py_env-python3.11/bin/ruff
file outputs:
> file ruff
ruff: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=5703233b90c05154cbdd5c3f44975b02579aad23, for GNU/Linux 2.6.32, stripped
Does anyone know why I get the error, that my file does not exists, when it actually exists and is executable.
ls
command? Try thels
with the full pathname as given in the error message from the commit.ls
with the full pathname.{username}
contain any unusual characters, or is any part of that path a symlink?xunil
. There is no symlink.file -L /lib64/ld-linux-x86-64.so.2
?