jdx / mise

dev tools, env vars, task runner
https://mise.jdx.dev
MIT License
8.03k stars 210 forks source link

protoc plugin install error #2287

Open sedubois opened 2 weeks ago

sedubois commented 2 weeks ago

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
roele commented 2 weeks ago

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 commented 2 weeks ago

there was a similar issue around something involving page size

roele commented 2 weeks ago

I assume you're referring to #2196?

roele commented 2 weeks ago

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 commented 2 weeks ago

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

roele commented 2 weeks ago

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.