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

protoc plugin install error #2287

Closed
sedubois opened this issue Jun 14, 2024 · 16 comments
Closed

protoc plugin install error #2287

sedubois opened this issue Jun 14, 2024 · 16 comments
Labels
bug Something isn't working

Comments

@sedubois
Copy link

sedubois commented Jun 14, 2024

Describe the bug
Error when installing the protoc community plugin.

To Reproduce

$ mise plugin install protoc
mise ⚠️ protoc is a community-developed plugin – https://github.com/paxosglobal/asdf-protoc
Would you like to install protoc? Yes
mise plugin:protoc cloning https://github.com/paxosglobal/asdf-protoc.git
smunmap_chunk(): invalid pointer
Aborted (core dumped)

Expected behavior
Plugin installs fine, like it does with asdf on the same machine.

mise doctor output

$ mise doctor
version: 2024.6.3 linux-arm64 (f01cc8d 2024-06-10)
activated: yes
shims_on_path: no

build_info: 
  Target: aarch64-unknown-linux-gnu
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Mon, 10 Jun 2024 15:39:56 +0000
  Rust Version: rustc 1.78.0 (9b00956e5 2024-04-29)
  Profile: release

shell: 
  /bin/bash
  GNU bash, version 5.1.16(1)-release (aarch64-unknown-linux-gnu)
  Copyright (C) 2020 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: 
  data: ~/.local/share/mise
  config: ~/.config/mise
  cache: ~/.cache/mise
  state: ~/.local/state/mise
  shims: ~/.local/share/mise/shims

config_files: 
  ~/.config/mise/config.toml
  ~/Documents/mise-demo/.tool-versions

backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
free(): invalid next size (fast)
Aborted (core dumped)

Additional context

$ mise plugin install protoc --debug --force
[DEBUG] ARGS: /home/parallels/.local/bin/mise plugin install protoc --debug --force
[DEBUG] Config {
    Config Files: [
        "~/Documents/mise-demo/.tool-versions",
        "~/.config/mise/config.toml",
    ],
}
[DEBUG] install protoc "https://github.com/paxosglobal/asdf-protoc.git"
uninstalling
removing ~/.local/share/mise/plugins/protoc
cloning https://github.com/paxosglobal/asdf-protoc.git
[DEBUG] cloning https://github.com/paxosglobal/asdf-protoc.git to /home/parallels/.local/share/mise/plugins/protoc
free(): invalid next size (fast)
Aborted (core dumped)

The operating system is Ubuntu 22.04.2 LTS, running in Parallels VM with x86_64 emulation on a mac with Apple Silicon chip.

asdf plugin add protoc and asdf install did not yield errors on the same machine.

Here is the relevant entry in .tool-versions:

protoc 25.3
@sedubois sedubois added the bug Something isn't working label Jun 14, 2024
@roele
Copy link
Contributor

roele commented Jun 14, 2024

I am unable to reproduce this neither on macOS nor on the Linux (aarch64) Dev Container but it seems to occur if i use a minimal Ubuntu Docker image. I assume this is caused by a missing system library of some sort.

@jdx
Copy link
Owner

jdx commented Jun 14, 2024

there was a similar issue around something involving page size

@roele
Copy link
Contributor

roele commented Jun 15, 2024

I assume you're referring to #2196?

@roele
Copy link
Contributor

roele commented Jun 15, 2024

The git2 crate states that it has a dependency on libgit2.

Installing libgit2-1.7 on my Ubuntu 24.04 Docker image does resolve the issue.

apt-get install libgit2-1.7

@jdx The crate mentions that libgit2 can be vendored so maybe we should enable the feature.

git2 = {version = "0.18.3", features = ["vendored-libgit2"] }

@jdx
Copy link
Owner

jdx commented Jun 15, 2024

I'm on board but maybe just for precompiled mise like we do for OpenSSL.

@roele
Copy link
Contributor

roele commented Jun 16, 2024

As mentioned in git2 crate some systems still require the system version of libgit2 even with vendored libgit2 . Setting the environment variable LIBGIT2_NO_VENDOR=1 resolves the issue in this case.

@chadlwilson
Copy link
Contributor

As mentioned in git2 crate some systems still require the system version of libgit2 even with vendored libgit2 . Setting the environment variable LIBGIT2_NO_VENDOR=1 resolves the issue in this case.

I'm not sure I understand what you are talking about here, but on Ubuntu 24.04 apt-get install libgit2-1.7 with or without LIBGIT2_NO_VENDOR=1 on a mise use didn't help stop it crashing.

docker run -t ubuntu:24.04 bash -c 'apt-get update && apt-get -y install curl libgit2-1.7 && (curl https://mise.jdx.dev/install.sh | sh) && LIBGIT2_NO_VENDOR=1 /root/.local/bin/mise use --global --debug -vv [email protected]'

@jdx
Copy link
Owner

jdx commented Jul 3, 2024

I suggest cargo install mise as a workaround

@chadlwilson
Copy link
Contributor

chadlwilson commented Jul 3, 2024

I suggest cargo install mise as a workaround

error: cannot install package `mise 2024.6.6`, it requires rustc 1.76.0 or newer, while the currently active rustc version is 1.75.0

Additionally, I don't really want to install a 668MB toolchain (estimate from just adding cargo) while trying to use mise within a container to install other tools.

Will go back to an earlier version for now.

chadlwilson added a commit to gocd-contrib/gocd-oss-cookbooks that referenced this issue Jul 3, 2024
Don't understand the workarounds, so will pin on a version which works without hassle.

jdx/mise#2196
jdx/mise#2287
@roele
Copy link
Contributor

roele commented Jul 3, 2024

@chadlwilson You might be right, when i was trying to get to the core of this issue the mentioned environment variable helped. But it seems that this issue is more random than anything else. Subsequent runs sometimes succeed and sometimes fail randomly regardless of libgit2-1.7 or LIBGIT2_NO_VENDOR. At this point, what seems certain is that its an issue with the git2 crate.

@jdx
Copy link
Owner

jdx commented Jul 3, 2024

maybe we'd have better luck with gitoxide

switching to git2 made for massive performance boosts in the places we use it so I really would like to keep it over shelling out to git like we did before.

@roele
Copy link
Contributor

roele commented Jul 7, 2024

There is a newer version of git2 available (see #2300) which bumps to libgit2-sys-1.8.1 which might or might not address some issues. Unfortunately the dependency on built also using git2 currently prevents us from updating. I prepared a PR to bump the git2 version in built at lukaslueg/built#69.

@roele
Copy link
Contributor

roele commented Jul 7, 2024

I also had a quick look at gitoxide but is seems it's far from feature complete and checkouts of specific revisions as used by SPM (Swift Package Manager) backend for example are not supported yet.

@roele
Copy link
Contributor

roele commented Jul 8, 2024

@chadlwilson If you have a way to verify, i would be interested to know if the issue still occurs with version 2024.7.1 (now that #2357 is merged).

I personally ran a couple manual tests on a Debian Docker container and did not encounter it anymore.

@chadlwilson
Copy link
Contributor

chadlwilson commented Jul 8, 2024

Thanks @roele - this seems to have done the trick!

https://github.com/gocd-contrib/gocd-oss-cookbooks/actions/runs/9844334610/job/27192502084 (this is building an arm64 CentOS Stream 9 image with mise installed on a native arm64 Linux GHA runner - failing due to an unrelated Node issue but not crashing now)

@chadlwilson
Copy link
Contributor

I also cannot replicate anything via arm64 containers on my Apple Silicon machine with 2024.7.1, which I could 95% reliably replicate before, so I think it's reasonably safe to say this has nailed both this and #2196 ?

@jdx jdx closed this as completed Jul 17, 2024
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

Successfully merging a pull request may close this issue.

4 participants