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

Failed to create cache file #9478

Closed
nick-rackauckas opened this issue Jan 11, 2024 · 5 comments · Fixed by #9480
Closed

Failed to create cache file #9478

nick-rackauckas opened this issue Jan 11, 2024 · 5 comments · Fixed by #9480

Comments

@nick-rackauckas
Copy link

Ever since upgrading to version 0.1.12, seeing this error when trying to run ruff check. Works when downgrading to 0.1.11.

ruff failed
  Cause: Failed to create cache file '<path-to-dir>/.ruff_cache/0.1.12/16676361985305082552'
  Cause: No such file or directory (os error 2)
@charliermarsh
Copy link
Member

Ah sorry, this must be me -- fixing now.

@charliermarsh
Copy link
Member

Can you tell me any more about your project setup? Do you use a single pyproject.toml file at the root? Do you use --config to pass a pyproject.toml?

@nick-rackauckas
Copy link
Author

Can you tell me any more about your project setup? Do you use a single pyproject.toml file at the root? Do you use --config to pass a pyproject.toml?

A single pyproject.toml at the root

@charliermarsh
Copy link
Member

I'm able to reproduce this by trying to lint a file outside of the current working directory (which also doesn't have a pyproject.toml file above it):

❯ ruff check ../foo.py
ruff failed
  Cause: Failed to create cache file '/Users/crmarsh/workspace/ruff/.ruff_cache/0.1.12/14778054398178272117'
  Cause: No such file or directory (os error 2)

charliermarsh added a commit that referenced this issue Jan 12, 2024
## Summary

Regression from
https://github.com/astral-sh/ruff/pull/9453/files#diff-80a9c2637c432502a7075c792cc60db92282dd786999a78bfa9bb6f025afab35L482.

Closes #9478.

## Test Plan

```
rm -rf .ruff_cache
cargo run -p ruff_cli -- check ../foo.py
```

Failed prior to this PR; passes afterwards. The file must be outside of
the current working directory, and must not have a `pyproject.toml` in
any parent directory.
@axiangcoding
Copy link

same issue. looking forward to release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants