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

mise use -g ruby fails when MISE_RUBY_BUILD_OPTS are set #2608

Closed
margaretgorguissian opened this issue Sep 18, 2024 · 0 comments · Fixed by #2609
Closed

mise use -g ruby fails when MISE_RUBY_BUILD_OPTS are set #2608

margaretgorguissian opened this issue Sep 18, 2024 · 0 comments · Fixed by #2609
Labels
bug Something isn't working

Comments

@margaretgorguissian
Copy link

Describe the bug
mise use -g ruby@3.3fails with a ruby-build usage error when MISE_RUBY_BUILD_OPTS are set.

To Reproduce

  1. Run export MISE_RUBY_BUILD_OPTS="--without-libyaml-dir" (or any other flag)
  2. Run mise use -g ruby@3.3 --verbose
    Program will fail with
[DEBUG] ARGS: /Users/margaretgorguissian/.local/bin/mise use -g ruby@3.3 --verbose
[DEBUG] Config {
    Config Files: [],
}
[DEBUG] Toolset (180.212µs): 
[DEBUG] install_versions: ruby@3.3
[DEBUG] ToolRequestSet.build(47.271µs): ToolRequestSet: 

[DEBUG] $ /Users/margaretgorguissian/Library/Caches/mise/ruby/ruby-build/bin/ruby-build --version
[DEBUG] GET https://api.github.com/repos/rbenv/ruby-build/releases/latest
[DEBUG] starting new connection: https://api.github.com/
[DEBUG] GET https://api.github.com/repos/rbenv/ruby-build/releases/latest 200 OK
running ruby-build
[DEBUG] $ ~/Library/Caches/mise/ruby/ruby-build/bin/ruby-build --without-libyaml-dir --verbose 3.3.5 /Users/margaretgorguissian/.local/share/mise/installs/ruby/3.3.5
ruby-build: invalid flag 'without-libyaml-dir'
Usage: ruby-build [-kpv] <definition> <prefix> [-- <configure-args...>]
       ruby-build {--list|--definitions}
       ruby-build --version
  -l, --list      List latest stable releases for each Ruby
  --definitions   List all local definitions, including outdated ones
  --version       Show version of ruby-build
  -v, --verbose   Verbose mode: forward all build output to stdout/stderr
  -p, --patch     Apply a patch from stdin before building
  -k, --keep      Do not remove source tree after installation
  -4, --ipv4      Resolve names to IPv4 addresses only
  -6, --ipv6      Resolve names to IPv6 addresses only
[ERROR] ~/Library/Caches/mise/ruby/ruby-build/bin/ruby-build failed
Error: 
   0: ~/Library/Caches/mise/ruby/ruby-build/bin/ruby-build exited with non-zero status: exit code 1

Expected behavior
I expect the ruby v3.3.5 installation to succeed, with the provided options respected.

mise doctor output

version: 2024.9.5 macos-x64 (1f0f03e 2024-09-17)
activated: yes
shims_on_path: no

build_info: 
  Target: x86_64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Tue, 17 Sep 2024 13:42:17 +0000
  Rust Version: rustc 1.81.0 (eeb90cda1 2024-09-04)
  Profile: release

shell: 
  /bin/zsh
  zsh 5.9 (x86_64-apple-darwin22.0)

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

config_files: 


backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi
  vfox

plugins: 


toolset: 


env_vars: 
  MISE_SHELL=zsh
  MISE_RUBY_BUILD_OPTS=--without-libyaml-dir

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf = true
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  disable_hints = []
  disable_tools = []
  experimental = false
  go_default_packages_file = "~/.default-go-packages"
  go_download_mirror = "https://dl.google.com/go"
  go_repo = "https://github.com/golang/go"
  go_set_gopath = false
  go_set_goroot = true
  go_skip_checksum = false
  http_timeout = 30
  jobs = 4
  legacy_version_file = true
  legacy_version_file_disable_tools = []
  libgit2 = true
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  pipx_uvx = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "~/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  use_versions_host = true
  verbose = false
  vfox = false
  yes = false
  ci = false
  debug = false
  trace = false
  log_level = "info"
  python_venv_auto_create = false

  [status]
  missing_tools = "if_other_versions_installed"
  show_env = false
  show_tools = false

No warnings found
No problems found

Additional context
My naive suspicion is that the arguments are not being added to the args array correctly here:

args.push(tv.version.clone());

As articulated in the usage message when running ruby-build, the definition and the prefix should come before any configuration arguments (ruby-build [-kpv] <definition> <prefix> [-- <configure-args...>]). However, the definition (version) and prefix are pushed onto the end of the args array, rather than being prepended. I can open a PR to fix this, but wanted to file an issue first (as recommended here) in case I am missing some context here. Thank you!

@margaretgorguissian margaretgorguissian added the bug Something isn't working label Sep 18, 2024
jdx added a commit that referenced this issue Sep 18, 2024
jdx added a commit that referenced this issue Sep 18, 2024
jdx added a commit that referenced this issue Sep 18, 2024
jdx added a commit that referenced this issue Sep 18, 2024
@jdx jdx closed this as completed in #2609 Sep 18, 2024
@jdx jdx closed this as completed in 32e326d Sep 18, 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.

1 participant