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

Adding the new locked = false for cargo backend breaks toml parsing #3189

Closed
kemitix opened this issue Nov 24, 2024 · 0 comments · Fixed by #3191
Closed

Adding the new locked = false for cargo backend breaks toml parsing #3189

kemitix opened this issue Nov 24, 2024 · 0 comments · Fixed by #3191
Labels

Comments

@kemitix
Copy link

kemitix commented Nov 24, 2024

Describe the bug

Attempting to use the new syntax for the Cargo backend breaks the parsing of the config.toml file.

When I add the following line to my ~/.config/mise/config.toml file:

"cargo:https://github.com/getzola/zola" = { version = "tag:v0.19.2", locked = false }

I get the following appearing on my terminal (with RUST_BACKTRACE=1) as soon as I save the file:

The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: src/config/config_file/mise_toml.rs:911

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 8 frames hidden ⋮
   9: core::panicking::panic::hee236ca94fc05047
      at <unknown source file>:<unknown line>
  10: core::option::unwrap_failed::h187ebe480b20e6be
      at <unknown source file>:<unknown line>
  11: <serde_ignored::Wrap<X,F> as serde::de::Visitor>::visit_map::h6ebc2cbccb96e275
      at <unknown source file>:<unknown line>
  12: <serde_ignored::Wrap<X,F> as serde::de::Visitor>::visit_map::hd33798b69dd3c011
      at <unknown source file>:<unknown line>
  13: <serde_ignored::TrackedSeed<X,F> as serde::de::DeserializeSeed>::deserialize::h5a2b56a77e2fa841
      at <unknown source file>:<unknown line>
  14: <serde_ignored::Wrap<X,F> as serde::de::Visitor>::visit_map::hfdd4698c8ef49a9a
      at <unknown source file>:<unknown line>
  15: mise::config::config_file::mise_toml::MiseToml::from_str::h3261fb613966d014
      at <unknown source file>:<unknown line>
  16: mise::config::config_file::parse::h2057d2b646b2f386
      at <unknown source file>:<unknown line>
  17: rayon::iter::plumbing::bridge_producer_consumer::helper::hdcab646e6fbd6de5
      at <unknown source file>:<unknown line>
  18: mise::config::Config::load::h2af3f4bdea0c9f96
      at <unknown source file>:<unknown line>
  19: mise::config::Config::try_get::h48cffc6362e85717
      at <unknown source file>:<unknown line>
  20: mise::cli::Commands::run::h776eb396efd13402
      at <unknown source file>:<unknown line>
  21: mise::cli::Cli::run::h1ed7258a01c9acdd
      at <unknown source file>:<unknown line>
  22: mise::main::h0e38fb67b673adfe
      at <unknown source file>:<unknown line>
  23: std::sys::backtrace::__rust_begin_short_backtrace::hfb24e4426ad7ce5d
      at <unknown source file>:<unknown line>
  24: _main<unknown>
      at <unknown source file>:<unknown line>

To Reproduce

  1. Add the following line to my ~/.config/mise/config.toml file: "cargo:https://github.com/getzola/zola" = { version = "tag:v0.19.2", locked = false }

Expected behavior

No error to appear.

mise doctor output

version: 2024.11.28 macos-arm64 (f88950e 2024-11-24)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Sun, 24 Nov 2024 15:46:27 +0000
  Rust Version: rustc 1.82.0 (f6e511eec 2024-10-15)
  Profile: release

shell:
  /opt/homebrew/bin/bash
  GNU bash, version 5.2.26(1)-release (aarch64-apple-darwin23.2.0)
  Copyright (C) 2022 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

  This is free software; you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

dirs:
  cache: ~/Library/Caches/mise
  config: ~/.config/mise
  data: ~/.local/share/mise
  shims: ~/.local/share/mise/shims
  state: ~/.local/state/mise
The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: src/config/config_file/mise_toml.rs:911

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
The application panicked (crashed).
Message:  called `Option::unwrap()` on a `None` value
Location: src/config/config_file/mise_toml.rs:911

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.

Additional context

Confirm that this problem only appears when the new syntax is used.

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