Closed liskin closed 3 weeks ago
hmm I thought I fixed this but it didn't work
Yeah I was just writing a comment to say so. Now mise upgrade --bump ubi:rust-analyzer/rust-analyzer
does nothing at all, and mise upgrade --interactive --bump
prints
mise upgrade rust-analyzer/rust-analyzer 2024-09-16 -> 2024-09-30 (~/.config/mise/config.toml)
and only then proceeds to do nothing at all. :-)
I think the issue is that for some reason the bump
field of OutdatedInfo
is None
and the tool_request
field specifies the old version for the packages that get removed:
[
OutdatedInfo {
name: "astral-sh/uv",
tool_request: Version { backend: BackendArg("ubi:astral-sh/uv"), version: "0.4.19", options: {} },
tool_version: ToolVersion { request: Version { backend: BackendArg("ubi:astral-sh/uv"), version: "0.4.18", options: {} }, backend: BackendArg("ubi:astral-sh/uv"), version: "0.4.18" },
requested: "0.4.18",
current: Some("0.4.18"),
bump: Some("0.4.19"),
latest: "0.4.19",
source: MiseToml("/home/tomi/.config/mise/config.toml")
},
OutdatedInfo {
name: "cargo-bins/cargo-binstall",
tool_request: Version { backend: BackendArg("ubi:cargo-bins/cargo-binstall"), version: "v1.10.6", options: {} },
tool_version: ToolVersion { request: Version { backend: BackendArg("ubi:cargo-bins/cargo-binstall"), version: "v1.10.6", options: {} }, backend: BackendArg("ubi:cargo-bins/cargo-binstall"), version: "v1.10.6" },
requested: "v1.10.6",
current: Some("v1.10.6"),
bump: None,
latest: "v1.10.7",
source: MiseToml("/home/tomi/.config/mise/config.toml")
},
…
]
Even the --dry-run
output makes no sense:
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall liskin/foursquare-swarm-ical@172e1d0336fdab568ab6b5ed505a06daafa5078c
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall liskin/strava-gear@6883fefc8a8f0a2e5144f271480e406a33540417
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall liskin/strava-offline@1abe986b2d1ba6a300954df6ff648d88bead6c80
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall kubernetes-sigs/kind@v0.22.0
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall tilt-dev/ctlptl@v0.8.32
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall tilt-dev/tilt@v0.33.19
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall astral-sh/uv@0.4.18
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:117] mise Would uninstall cargo-bins/cargo-binstall@v1.10.6
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install liskin/foursquare-swarm-ical@v1.0.3
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install liskin/strava-gear@v1.1.0
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install liskin/strava-offline@1.1.0
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install kubernetes-sigs/kind@v0.24.0
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install tilt-dev/ctlptl@v0.8.34
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install tilt-dev/tilt@v0.33.20
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install astral-sh/uv@0.4.19
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:120] mise Would install cargo-bins/cargo-binstall@v1.10.7
[INFO] (1) mise::cli::upgrade: [src/cli/upgrade.rs:123] mise Would bump astral-sh/uv@0.4.19 in ~/.config/mise/config.toml
Out of all of these, only uv
will get correctly bumped. For all the others, ts.install_versions(config, new_versions, &mpr, &opts)
will simply attempt to reinstall the old version (no-op), and then the version gets removed. The "would install" lines incorrectly claim that the new version will get installed, which is just not true.
So yeah I think src/cli/upgrade.rs
does need an update — the dry_run
logic clearly doesn't match what's actually going to happen. BUT also the logic that generates the tool_requests and bumps needs to be fixed.
Right, check_semver_bump
in src/toolset/mod.rs
as it's currently written only handles versions that parse as Ideal(SemVer { major: 0, minor: 4, patch: 18, pre_rel: None, meta: None })
, but "v1.10.6" parses as General(Version { epoch: None, chunks: Chunks([Alphanum("v1"), Numeric(10), Numeric(6)]), release: None, meta: None })
so chunkify
just returns an empty vec.
An easy workaround/fix would be to check if MISE_PIN=1
and if yes skip check_semver_bump
and just do the bump whenever new != old. It'd still be broken for people who want to specify partial versions, but at least the pinning usecase would be unblocked.
Describe the bug The new
upgrade --bump
functionality behaves strangely onubi:rust-analyzer/rust-analyzer
— it offers the upgrade when run with--interactive
, but doesn't bump the version in the config file, and only removes the old version without installing the new one.To Reproduce
Expected behavior I expected the pinned version in ~/.config/mise/config.toml to be bumped (as it is for all other tools) and the new version to be installed (likewise).
mise doctor
output(but I've reproduced the issue in a clean debian:testing docker container with just
apt install curl
,curl … | sh
for both ubi and mise, andmise settings set experimental true
)Additional context