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

[Linter panic] related to cache, cannot provide repro #10722

Closed
hauntsaninja opened this issue Apr 1, 2024 · 6 comments
Closed

[Linter panic] related to cache, cannot provide repro #10722

hauntsaninja opened this issue Apr 1, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@hauntsaninja
Copy link
Contributor

hauntsaninja commented Apr 1, 2024

With ruff 0.3.5

Possibly related to the "Different package root in cache" warning immediately prior.

I think I could repro deterministically, but then I wiped cache and no longer could reproduce.

warning: Different package root in cache: expected '/Users/shantanu/devoai/openai/project/REDACTED/REDACTEDPROJ', got '/Users/shantanu/devoai/openai/project/REDACTED/REDACTED/PROJ'
error: Panicked while linting project/REDACTED/REDACTEDPROJ/pyproject.toml: This indicates a bug in Ruff. If you could open an issue at:

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

...with the relevant file contents, the `pyproject.toml` settings, and the following stack trace, we'd be very appreciative!

panicked at crates/ruff/src/diagnostics.rs:198:18:
wrong package cache for file
Backtrace:    0: std::backtrace::Backtrace::force_capture
   1: <ruff::panic::PanicError as core::fmt::Display>::fmt
   2: std::panicking::rust_panic_with_hook
   3: <std::panicking::begin_panic_handler::StaticStrPayload as core::panic::PanicPayload>::take_box
   4: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
   5: _rust_begin_unwind
   6: core::panicking::panic_fmt
   7: core::option::expect_failed
   8: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
   9: <ruff::panic::PanicError as core::fmt::Display>::fmt
  10: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  11: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  12: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  13: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  14: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  15: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  16: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  17: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  18: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  19: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  20: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  21: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  22: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  23: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  24: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  25: rayon_core::registry::WorkerThread::wait_until_cold
  26: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  27: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  28: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  29: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  30: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  31: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  32: rayon_core::registry::WorkerThread::wait_until_cold
  33: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  34: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  35: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  36: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  37: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  38: rayon_core::registry::WorkerThread::wait_until_cold
  39: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  40: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  41: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  42: rayon_core::registry::WorkerThread::wait_until_cold
  43: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  44: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  45: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  46: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  47: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  48: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  49: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  50: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  51: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  52: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  53: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  54: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  55: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  56: rayon_core::registry::WorkerThread::wait_until_cold
  57: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  58: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  59: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  60: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  61: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  62: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  63: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  64: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  65: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  66: rayon_core::registry::WorkerThread::wait_until_cold
  67: <ruff::args::LogLevelArgs as clap_builder::derive::Args>::augment_args
  68: <ruff::version::VersionInfo as core::fmt::Display>::fmt
  69: <ruff::diagnostics::FixMap as core::ops::arith::AddAssign>::add_assign
  70: rayon_core::registry::WorkerThread::wait_until_cold
  71: rayon_core::registry::ThreadBuilder::run
  72: <rayon_core::unwind::AbortIfPanic as core::ops::drop::Drop>::drop
  73: <rayon_core::registry::WorkerThread as core::convert::From<rayon_core::registry::ThreadBuilder>>::from
  74: std::sys::pal::unix::thread::Thread::new
  75: __pthread_joiner_wake
@charliermarsh
Copy link
Member

Just thinking about what this could be... Do you use the namespace-packages setting?

@charliermarsh charliermarsh added the bug Something isn't working label Apr 1, 2024
@charliermarsh
Copy link
Member

(Were you upgrading from v0.3.4?)

@hauntsaninja
Copy link
Contributor Author

hauntsaninja commented Apr 1, 2024

No use of namespace-packages. I'm not sure what I was upgrading from, could have been v0.3.4, another possibility is v0.2.2?

Note I found the first line pretty interesting: warning: Different package root in cache: expected '/Users/shantanu/devoai/openai/project/REDACTED/REDACTEDPROJ', got '/Users/shantanu/devoai/openai/project/REDACTED/REDACTED/PROJ'

It looks like there was some package refactoring on our side that maybe the cache isn't resilient to

@MichaReiser
Copy link
Member

@hauntsaninja did you ever run into this again or has this been resolved?

@hauntsaninja
Copy link
Contributor Author

Ah I think I actually reported this at some other point with a clear repro and we fixed

@hauntsaninja
Copy link
Contributor Author

#12158 (comment)

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

No branches or pull requests

3 participants