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

Go packages with capitals in the user/repo name cause issues with mise upgrade #3597

Closed
joshbode opened this issue Dec 16, 2024 · 5 comments
Closed
Labels

Comments

@joshbode
Copy link
Contributor

Describe the bug

Installing Go packages that canonically have capitals in the user/repo name cause issues with mise upgrade

To Reproduce

[tools]
"go:github.com/Crosse/sshsrv" = "master"

The install goes OK:

$ mise list | grep sshsrv
go:github.com/Crosse/sshsrv           master (missing)  ~/.config/mise/config.toml  master

$ mise install
mise go:github.com/Crosse/sshsrv@master ✓ installed

$ which sshsrv
/Users/josh/.local/share/mise/installs/go-github-com-crosse-sshsrv/master/bin/sshsrv

$ sshsrv
Usage: check the ssh man page.

(possible issue: the install name is lower-cased)

Now, when using mise upgrade:

$ mise cache clear
mise cache cleared

$ mise upgrade
go: invalid github.com import path "github.com/Crosse"
go: invalid github.com import path "github.com"
mise WARN  No versions found for go:github.com/Crosse/sshsrv
mise All tools are up to date

I've also tried to lower-case the user name (e.g. Crosse to crosse):

[tools]
"go:github.com/crosse/sshsrv" = "master"

but Go doesn't love that:

$ mise install
go: github.com/crosse/sshsrv@master: version constraints conflict:
        github.com/crosse/sshsrv@v0.0.0-20221018161127-8351473b4d66: parsing go.mod:
        module declares its path as: github.com/Crosse/sshsrv
                but was required as: github.com/crosse/sshsrv
mise ERROR go failed
go: github.com/crosse/sshsrv@master: version constraints conflict:
        github.com/crosse/sshsrv@v0.0.0-20221018161127-8351473b4d66: parsing go.mod:
        module declares its path as: github.com/Crosse/sshsrv
                but was required as: github.com/crosse/sshsrv
mise ERROR failed to install go:github.com/crosse/sshsrv@master
mise ERROR go exited with non-zero status: exit code 1
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

Expected behavior

mise upgrade shouldn't complain.

mise doctor output

mise doctor
version: 2024.12.10 macos-arm64 (2024-12-14)
activated: yes
shims_on_path: no

build_info:
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS
  Built: Sat, 14 Dec 2024 18:40:19 +0000
  Rust Version: rustc 1.83.0 (90b35a623 2024-11-26) (Homebrew)
  Profile: release

shell:
  /bin/zsh
  zsh 5.9 (arm64-apple-darwin24.0)

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

config_files:
  ~/.config/mise/config.toml

backends:
  aqua
  asdf
  cargo
  core
  gem
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins:
  jq          https://github.com/mise-plugins/asdf-jq.git#6d86d19
  poetry      https://github.com/mise-plugins/mise-poetry.git#431c335
  shellcheck  https://github.com/luizm/asdf-shellcheck.git#780d78d
  shfmt       https://github.com/luizm/asdf-shfmt.git#a42c5ff
  sops        https://github.com/mise-plugins/mise-sops#cfa3ab5
  tiny        https://github.com/mise-plugins/mise-tiny.git#c532b14
  usage       https://github.com/jdx/mise-usage.git#fe3888a

toolset:
  asdf:poetry@1.8.5
  asdf:sops@3.9.2
  cargo:lockdiff@1.1.7
  cargo:pylyzer@0.0.73
  cargo:rydesun/fennel-language-server@HEAD
  cargo:tinty@0.23.0
  core:bun@1.1.38
  core:node@23.4.0
  core:python@3.12.8
  go:github.com/Crosse/sshsrv@master
  go:github.com/aykamko/tag@1.4.0
  go:github.com/kitagry/bqls@main
  npm:fast-cli@4.0.0
  npm:gha-check-updates@1.0.8
  npm:sql-language-server@1.7.1
  npm:tslab@1.0.22
  npm:tsx@4.19.2
  pipx:tuna@0.5.11

path:
  ~/.local/share/mise/installs/bun/1.1.38/bin
  ~/.local/share/mise/installs/node/23.4.0/bin
  ~/.local/share/mise/installs/poetry/1.8.5/bin
  ~/.local/share/mise/installs/python/3.12.8/bin
  ~/.local/share/mise/installs/sops/3.9.2/bin
  ~/.local/share/mise/installs/pipx-tuna/0.5.11/bin
  ~/.local/share/mise/installs/cargo-lockdiff/1.1.7/bin
  ~/.local/share/mise/installs/cargo-pylyzer/0.0.73/bin
  ~/.local/share/mise/installs/cargo-rydesun-fennel-language-server/HEAD/bin
  ~/.local/share/mise/installs/cargo-tinty/0.23.0/bin
  ~/.local/share/mise/installs/npm-fast-cli/4.0.0/bin
  ~/.local/share/mise/installs/npm-gha-check-updates/1.0.8/bin
  ~/.local/share/mise/installs/npm-sql-language-server/1.7.1/bin
  ~/.local/share/mise/installs/npm-tslab/1.0.22/bin
  ~/.local/share/mise/installs/npm-tsx/4.19.2/bin
  ~/.local/share/mise/installs/go-github-com-aykamko-tag/1.4.0/bin
  ~/.local/share/mise/installs/go-github-com-kitagry-bqls/main/bin
  ~/.local/share/mise/installs/go-github-com-crosse-sshsrv/master/bin
  ~/.local/share/cargo/bin
  ~/.local/share/go/bin
  ~/.local/share/pipx/bin
  ~/.local/bin
  ~/.local/state/nix/profile/bin
  ~/.local/state/nix/profile/sbin
  /nix/var/nix/profiles/default/bin
  /opt/homebrew/bin
  /opt/homebrew/sbin
  /usr/local/bin
  /usr/bin
  /usr/sbin
  /bin
  /sbin
  /System/Cryptexes/App/usr/bin
  /Library/Apple/usr/bin

env_vars:
  MISE_SHELL=zsh

settings:
  disable_hints           ["outdated_bump"]     ~/.config/mise/config.toml
  experimental            true                  ~/.config/mise/config.toml
  jobs                    8                     ~/.config/mise/config.toml
  legacy_version_file     false                 ~/.config/mise/config.toml
  not_found_auto_install  false                 ~/.config/mise/config.toml
  pipx.uvx                true                  ~/.config/mise/config.toml
  python_compile          true                  ~/.config/mise/config.toml
  status.show_env         false                 ~/.config/mise/config.toml
  status.show_tools       false                 ~/.config/mise/config.toml
  trusted_config_paths    ["~/repos/checkmate"] ~/.config/mise/config.toml
mise WARN  mise version 2024.12.11 available

1 problem found:

1. new mise version 2024.12.11 available, currently on 2024.12.10
@joshbode joshbode added the bug label Dec 16, 2024
@jdx
Copy link
Owner

jdx commented Dec 16, 2024

I don't think it's the capital, I think mise up doesn't handle versions that don't change like that

@jdx
Copy link
Owner

jdx commented Dec 19, 2024

looking at this again, versions that don't change like that just aren't going to work in mise up

@jdx jdx closed this as not planned Won't fix, can't repro, duplicate, stale Dec 19, 2024
@joshbode
Copy link
Contributor Author

yep - I see what's going on - not sure why no Versions is returned by go list, even though there is a v1.0 tag in the repo...

$ go list -m -versions -json github.com/Crosse/sshsrv
{
        "Path": "github.com/Crosse/sshsrv"
}

here's one that works:

$ go list -m -versions -json github.com/kitagry/bqls
{
        "Path": "github.com/kitagry/bqls",
        "Versions": [
                "v0.0.3",
                "v0.1.0",
                "v0.2.0",
                "v0.2.1",
                "v0.2.2"
        ]
}

@joshbode
Copy link
Contributor Author

Oh, it's probably because it's only v1.0 rather than v1.0.0 - I'll let the repo owner know :)

@joshbode
Copy link
Contributor Author

OK - adding an actual semantic version resolved the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants