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

mise panics when encounter a regex in .terrfarom-version #1727

Closed
erickguan opened this issue Mar 1, 2024 · 0 comments · Fixed by #2105
Closed

mise panics when encounter a regex in .terrfarom-version #1727

erickguan opened this issue Mar 1, 2024 · 0 comments · Fixed by #2105
Labels

Comments

@erickguan
Copy link
Contributor

I am happy to contribute code if you are willing to give a few pointers too. In general, I should pick up things fast.

Describe the bug
Regex version request crashes mise.

To Reproduce
My environment:

  • macOS 14.2.1 (23C71)
  • zsh 5.9 (arm-apple-darwin22.1.0)
  1. mise plugin add tfenv https://github.com/carlduevel/asdf-tfenv.git
  2. mise install terraform (1.7.4 when I was working with terraform my macOS)
  3. mise use terraform@1.7.4

Expected behavior
mise:

  • reports unsupported request version
  • allows regex

tfenv supports a range of formats. But it is better to consider them as another topic.

mise doctor output

mise doctor
version: 2024.2.19 macos-arm64 (2024-02-28)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Wed, 28 Feb 2024 05:54:30 +0000
  Rust Version: rustc 1.76.0 (07dca489a 2024-02-04) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin23.0)

dirs:
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/Library/Caches/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

Additional context
Backtrace

Warning: mise 2024.2.19 already installed
The application panicked (crashed).
Message:  invalid tool version request: latest:^1.4
Location: src/toolset/tool_version_request.rs:46

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1: backtrace::capture::Backtrace::new::h210667bc8c9adf07
      at <unknown source file>:<unknown line>
   2: color_eyre::config::PanicHook::panic_report::hf232496a32ac5d5a
      at <unknown source file>:<unknown line>
   3: color_eyre::config::PanicHook::into_panic_hook::{{closure}}::hb69c2f6912e4be4c
      at <unknown source file>:<unknown line>
   4: std::panicking::rust_panic_with_hook::hd4ada112570991e5
      at <unknown source file>:<unknown line>
   5: std::panicking::begin_panic_handler::{{closure}}::h3f2b6a80c2b7e617
      at <unknown source file>:<unknown line>
   6: std::sys_common::backtrace::__rust_end_short_backtrace::hc0b94e2951df3fae
      at <unknown source file>:<unknown line>
   7: _rust_begin_unwind<unknown>
      at <unknown source file>:<unknown line>
   8: core::panicking::panic_fmt::h0ed3af01737be6a9
      at <unknown source file>:<unknown line>
   9: mise::toolset::tool_version_request::ToolVersionRequest::new::h31c41d767e200a19
      at <unknown source file>:<unknown line>
  10: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once::h1643c9fc0058bab1
      at <unknown source file>:<unknown line>
  11: rayon::iter::plumbing::bridge_producer_consumer::helper::he9cdb1261258194f
      at <unknown source file>:<unknown line>
  12: rayon_core::join::join_context::{{closure}}::h9f5870cb882943f2
      at <unknown source file>:<unknown line>
  13: rayon::iter::plumbing::bridge_producer_consumer::helper::he9cdb1261258194f
      at <unknown source file>:<unknown line>
  14: rayon_core::join::join_context::{{closure}}::h9f5870cb882943f2.10598<unknown>
      at <unknown source file>:<unknown line>
  15: <rayon_core::job::StackJob<L,F,R> as rayon_core::job::Job>::execute::h9a7f80be48491457
      at <unknown source file>:<unknown line>
  16: rayon_core::registry::WorkerThread::wait_until_cold::h96e24dbdc72467c2
      at <unknown source file>:<unknown line>
  17: std::sys_common::backtrace::__rust_begin_short_backtrace::hf45b5ddc4496a83b
      at <unknown source file>:<unknown line>
  18: core::ops::function::FnOnce::call_once{{vtable.shim}}::ha9c313f21c934d86
      at <unknown source file>:<unknown line>
  19: std::sys::unix::thread::Thread::new::thread_start::h828b647d1d3902a3
      at <unknown source file>:<unknown line>
  20: __pthread_joiner_wake<unknown>
      at <unknown source file>:<unknown line>

Run with COLORBT_SHOW_HIDDEN=1 environment variable to disable frame filtering.

Offending version file

cat .terraform-version
# latest:^1.4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant