Skip to content

[Panic] new cache code causing panic in 0.0.273 #5228

@Edward-Knight

Description

@Edward-Knight

Running RUST_BACKTRACE=full ruff <file> on 0.0.273 resulted in this output:


error: `ruff` crashed. This indicates a bug in `ruff`. If you could open an issue at:

https://github.com/astral-sh/ruff/issues/new?title=%5BPanic%5D

quoting the executed command, along with the relevant file contents and `pyproject.toml` settings, we'd be very appreciative!

thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', crates/ruff_cli/src/commands/run.rs:112:65
stack backtrace:
   0:        0x102bd4718 - _rust_eh_personality
   1:        0x10260fc84 - _main
   2:        0x102baf69c - _rust_eh_personality
   3:        0x102bd6108 - _rust_eh_personality
   4:        0x102bd5d48 - _rust_eh_personality
   5:        0x102bd5a8c - _rust_eh_personality
   6:        0x102a7d280 - _main
   7:        0x102bd6a30 - _rust_eh_personality
   8:        0x102bd67f0 - _rust_eh_personality
   9:        0x102bd6784 - _rust_eh_personality
  10:        0x102bd6778 - _rust_eh_personality
  11:        0x102c5093c - __rjem_je_witnesses_cleanup
  12:        0x102c509dc - __rjem_je_witnesses_cleanup
  13:        0x102a66e84 - _main
  14:        0x102a50cf0 - _main
  15:        0x102a2e424 - _main
  16:        0x102a26708 - _main
  17:        0x102591038 - __mh_execute_header
  18:        0x10258d788 - __mh_execute_header
  19:        0x102592328 - _main

My .ruff_cache looks like this:

$ tree .ruff_cache
.ruff_cache
├── CACHEDIR.TAG
└── content

2 directories, 1 file
$ cat .ruff_cache/CACHEDIR.TAG 
Signature: 8a477f597d28d172789f06886806bc55

Unfortunately I cannot provide the file that triggered this. This was run in a project without ruff configured, although it does have a pyproject.toml. This happens using the --isolated flag as well. Running on AArch64 macOS.

Here is the code snippet:

let package_root = package.unwrap_or_else(|| path.parent().unwrap_or(path));
let cache = caches
.as_ref()
.map(|caches| caches.get(&package_root).unwrap());

Last modified in 17f1ecd.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions