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 wipe RUBYLIB value when working with RubyMine #2380

Closed
DmitryPogrebnoy opened this issue Jul 16, 2024 · 0 comments · Fixed by #2387
Closed

Mise wipe RUBYLIB value when working with RubyMine #2380

DmitryPogrebnoy opened this issue Jul 16, 2024 · 0 comments · Fixed by #2387
Labels
bug Something isn't working

Comments

@DmitryPogrebnoy
Copy link

DmitryPogrebnoy commented Jul 16, 2024

Describe the bug
There is a bug with RubyMine and Mise - RUBY-32547.
RubyMine patches RUBYLIB env variable when running tests. But it doesn't work with Mise, because Mise wipes RUBYLIB in the method get_pristine_env (src/env.rs:300), after applying remove RUBYLIB patch.

To Reproduce

  1. Install RubyMine (2024.1 or later, even EAP versions).
  2. Install mise 2024.7.1.
  3. Run RubyMine from terminal using bash script.
  4. Use sample rails project from the ticket RUBY-32547.
  5. Run tests in users_controller_test.rb.

Get an exception like:

/bin/bash -c "export PATH=$PATH:/home/karinamokleva/.local/bin && /home/karinamokleva/.local/bin/mise exec --quiet ruby@3.3.0 -- /home/karinamokleva/.local/share/mise/installs/ruby/3.3.0/bin/ruby -x /home/karinamokleva/RubymineProjects/test_2024.1.1_preview_rails33/bin/bundle exec /home/karinamokleva/.local/share/mise/installs/ruby/3.3.0/bin/ruby -Itest /home/karinamokleva/Downloads/RubyMine-242.10148/plugins/ruby/rb/testing/runner/tunit_or_minitest_in_folder_runner.rb"
Testing started at 10:33 π.μ. ...
/home/karinamokleva/.local/share/mise/installs/ruby/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `require': cannot load such file -- teamcity/utils/runner_utils (LoadError)
	from /home/karinamokleva/.local/share/mise/installs/ruby/3.3.0/lib/ruby/3.3.0/bundled_gems.rb:74:in `block (2 levels) in replace_require'
	from /home/karinamokleva/Downloads/RubyMine-242.10148/plugins/ruby/rb/testing/runner/tunit_or_minitest_in_folder_runner.rb:13:in `<main>'

Process finished with exit code 1

Expected behavior
Tests run successfully.

mise doctor output

version: 2024.7.3 macos-arm64 (5d74b6b 2024-07-14)
activated: yes
shims_on_path: no

build_info: 
  Target: aarch64-apple-darwin
  Features: DEFAULT, NATIVE_TLS, OPENSSL
  Built: Sun, 14 Jul 2024 03:13:50 +0000
  Rust Version: rustc 1.79.0 (129f3b996 2024-06-10)
  Profile: release

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

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

config_files: 
  ~/.ruby-version
  ~/.mise.toml

backends: 
  cargo
  core
  go
  npm
  pipx
  spm
  ubi

plugins: 
  bun     (core)
  deno    (core)
  erlang  (core)
  go      (core)
  java    (core)
  node    (core)
  python  (core)
  ruby    (core)

toolset: 
  ruby@3.1.2  (missing)

env_vars: 
  MISE_SHELL=zsh

settings: 
  activate_aggressive = false
  all_compile = false
  always_keep_download = false
  always_keep_install = false
  asdf_compat = false
  cargo_binstall = true
  color = true
  disable_default_shorthands = false
  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 = []
  node_compile = false
  not_found_auto_install = true
  paranoid = false
  plugin_autoupdate_last_check_duration = "7d"
  python_default_packages_file = "/Users/dmitry.pogrebnoy/.default-python-packages"
  python_pyenv_repo = "https://github.com/pyenv/pyenv.git"
  raw = false
  trusted_config_paths = []
  quiet = false
  verbose = 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
When RubyMine run tests it patches RUBYLIB variable and adds there several paths. But Mise drop RUBYLIB completely. I debugged it to the method get_pristine_env (src/env.rs:300) in Mise repository and for some reason patches from __MISE_DIFF is

[
    Remove(
        "RUBYLIB",
    ),
]

which is wrong. Mise should preserve RUBYLIB patches to be able to work with RubyMine.

@DmitryPogrebnoy DmitryPogrebnoy added the bug Something isn't working label Jul 16, 2024
@DmitryPogrebnoy DmitryPogrebnoy changed the title Mise wipe RUBYLIB value when works with RubyMine Mise wipe RUBYLIB value when working with RubyMine Jul 16, 2024
jdx added a commit that referenced this issue Jul 19, 2024
This should not be necessary anymore now that ruby is a core plugin.

Fixes #2380
@jdx jdx closed this as completed in #2387 Jul 19, 2024
jdx added a commit that referenced this issue Jul 19, 2024
This should not be necessary anymore now that ruby is a core plugin.

Fixes #2380
triarius pushed a commit to triarius/mise that referenced this issue Sep 18, 2024
This should not be necessary anymore now that ruby is a core plugin.

Fixes jdx#2380
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