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

micromamba: mamba and micromamba behave differently, despite being the same executable #201341

Open
4 tasks done
ideabucket opened this issue Dec 16, 2024 · 0 comments
Open
4 tasks done
Labels
bug Reproducible Homebrew/homebrew-core bug

Comments

@ideabucket
Copy link

ideabucket commented Dec 16, 2024

brew gist-logs <formula> link OR brew config AND brew doctor output

`brew gist-logs micromamba` reports "No logs".

`brew config`:

> HOMEBREW_VERSION: 4.4.11-66-g3001afe
> ORIGIN: https://github.com/Homebrew/brew
> HEAD: 3001afe88112c13b5aafdd92e097680897060881
> Last commit: 16 hours ago
> Branch: master
> Core tap JSON: 16 Dec 07:55 UTC
> Core cask tap JSON: 16 Dec 07:55 UTC
> HOMEBREW_PREFIX: /opt/homebrew
> HOMEBREW_CASK_OPTS: []
> HOMEBREW_DISPLAY: /private/tmp/com.apple.launchd.00qBss0aq9/org.xquartz:0
> HOMEBREW_EDITOR: /usr/local/bin/bbedit --new-window --wait --resume --
> HOMEBREW_MAKE_JOBS: 8
> HOMEBREW_SORBET_RUNTIME: set
> Homebrew Ruby: 3.3.6 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/bin/ruby
> CPU: octa-core 64-bit arm_blizzard_avalanche
> Clang: 16.0.0 build 1600
> Git: 2.47.1 => /opt/homebrew/bin/git
> Curl: 8.7.1 => /usr/bin/curl
> macOS: 15.1.1-arm64
> CLT: 16.1.0.0.1.1729049160
> Xcode: 16.2
> Rosetta 2: false

`brew doctor --verbose`:

==> Cask Environment Variables:
BUNDLE_PATH
CHRUBY_VERSION
GEM_HOME
GEM_PATH
HOMEBREW_CASK_OPTS
LC_ALL
PATH
RBENV_VERSION
RUBYLIB
RUBYOPT
RUBYPATH
SHELL
==> $LOAD_PATHS
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bundler-2.5.20/lib
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/gems/3.3.0/gems/msgpack-1.7.3/lib
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/gems/3.3.0/gems/debug-1.9.2/lib
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/gems/3.3.0/gems/bootsnap-1.18.4/lib
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/gems/3.3.0/extensions/arm64-darwin-20/3.3.0-static/msgpack-1.7.3
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/gems/3.3.0/extensions/arm64-darwin-20/3.3.0-static/debug-1.9.2
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/gems/3.3.0/extensions/arm64-darwin-20/3.3.0-static/bootsnap-1.18.4
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/warning-1.4.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/vernier-1.4.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/vernier-1.4.0
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/tapioca-0.16.5/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/yard-sorbet-0.9.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/yard-0.9.37/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/stackprof-0.2.26/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/stackprof-0.2.26
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/spoom-1.5.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/thor-1.3.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-static-and-runtime-0.5.11694/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-0.5.11694/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-static-0.5.11694-universal-darwin/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/simplecov-cobertura-2.1.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/simplecov-0.22.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/simplecov_json_formatter-0.1.4/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/simplecov-html-0.13.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/ruby-prof-1.7.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/ruby-prof-1.7.1
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/ruby-macho-4.1.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/ruby-lsp-0.22.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-sorbet-0.8.7/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-rspec-3.3.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-performance-1.23.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-md-1.2.4/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-1.69.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/unicode-display_width-3.1.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/unicode-emoji-4.0.4/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/ruby-progressbar-1.13.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rubocop-ast-1.37.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec_junit_formatter-0.6.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-sorbet-1.9.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-retry-0.6.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-github-2.4.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-3.13.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-mocks-3.13.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-expectations-3.13.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-core-3.13.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rspec-support-3.13.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/redcarpet-3.6.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/redcarpet-3.6.0
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rbs-3.7.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/rbs-3.7.0
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rbi-0.2.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/sorbet-runtime-0.5.11694/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rainbow-3.1.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/pry-0.15.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/prism-1.2.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/prism-1.2.0
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/plist-3.7.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/patchelf-1.5.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/parser-3.3.6.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/racc-1.8.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/racc-1.8.1
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/parallel_tests-4.7.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/parallel-1.26.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/netrc-0.11.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/minitest-5.25.4/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/method_source-1.1.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/logger-1.6.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/language_server-protocol-3.17.0.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/kramdown-2.5.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/rexml-3.4.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json_schemer-2.3.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/simpleidn-0.2.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/regexp_parser-2.9.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/json-2.9.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/json-2.9.0
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/hana-1.3.7/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/erubi-1.13.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/elftools-1.3.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/docile-1.4.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/diff-lcs-1.5.1/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/concurrent-ruby-1.3.4/lib/concurrent-ruby
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/coderay-1.1.3/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bindata-2.5.0/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.8/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/extensions/arm64-darwin-20/3.3.0-static/bigdecimal-3.1.8
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/ast-2.4.2/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/addressable-2.8.7/lib
/opt/homebrew/Library/Homebrew/vendor/bundle/ruby/3.3.0/gems/public_suffix-6.0.1/lib
/opt/homebrew/Library/Homebrew
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/vendor_ruby/3.3.0
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/vendor_ruby/3.3.0/arm64-darwin20
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/vendor_ruby
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0
/opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.3.6/lib/ruby/3.3.0/arm64-darwin20
==> Homebrew Version
4.4.11-66-g3001afe
==> macOS
15.1.1
==> SIP
Enabled
==> Homebrew Cask Staging Location
/opt/homebrew/Caskroom
==> Homebrew Cask Taps:
/opt/homebrew/Library/Taps/homebrew/homebrew-cask (7274 casks)
Your system is ready to brew.

Verification

  • My brew doctor output says Your system is ready to brew. and am still able to reproduce my issue.
  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.
  • I searched for recent similar issues at https://github.com/Homebrew/homebrew-core/issues?q=is%3Aissue and found no duplicates.

What were you trying to do (and why)?

Related, I think, to #200954, but not the same.

The install caveat for the micromamba formula encourages you to invoke micromamba as mamba (emphasis added):

Please run the following to setup your shell:
/opt/homebrew/opt/micromamba/bin/mamba shell init --shell --root-prefix ~/mamba
and restart your terminal.

And micromamba is a symlink to mamba:

$ ls -l (which micromamba)
lrwxr-xr-x@ 1 keith  admin  41 16 Dec 18:55 /opt/homebrew/bin/micromamba@ -> ../Cellar/micromamba/2.0.5/bin/micromamba
$ ls -l /opt/homebrew/Cellar/micromamba/2.0.5/bin/micromamba
lrwxr-xr-x@ 1 keith  admin  5 13 Dec 03:22 /opt/homebrew/Cellar/micromamba/2.0.5/bin/micromamba@ -> mamba

Plus there is this comment in #200954 :

Since v2 they're essentially the same thing.

So on this basis I expect that I should be able to run micromamba activate somenv and mamba activate somenv and that these two commands would do exactly the same thing.

What happened (include all command output)?

$ micromamba info
    [snip]
            environment : base
    [snip]
$ micromamba activate whisper-cpp 
$ micromamba info
    [snip]
            environment : whisper-cpp (active)
   [snip]

OK, that works great. But if I do the same thing calling mamba, in a fresh shell:

$ mamba info
    [snip]
            environment : base
    [snip]
$ mamba activate whisper-cpp

'mamba' is running as a subprocess and can't modify the parent shell.
Thus you must initialize your shell before using activate and deactivate.

To initialize the current fish shell, run:
    $ eval "$(mamba shell hook --shell fish)"
and then activate or deactivate with:
    $ mamba activate
To automatically initialize all future (fish) shells, run:
    $ mamba shell init --shell fish --root-prefix=~/.local/share/mamba
If your shell was already initialized, reinitialize your shell with:
    $ mamba shell reinit --shell fish
Otherwise, this may be an issue. In the meantime you can run commands. See:
    $ mamba run --help

Supported shells are {bash, zsh, csh, posix, xonsh, cmd.exe, powershell, fish, nu}.
critical libmamba Shell not initialized

Except here's the relevant section of my config.fish:

# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba shell init' !!
set -gx MAMBA_EXE "/opt/homebrew/bin/mamba"
set -gx MAMBA_ROOT_PREFIX "/Users/keith/Library/Application Support/micromamba"
$MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source
# <<< mamba initialize <<<

Even if I re-run the exact mamba shell init command recommended in the mamba error message (setting up ~/.local/share/mamba as my prefix rather than ~/Library/Application Support/micromamba), running mamba activate in a fresh shell just produces the same error. The only way to use micromamba is to invoke it as micromamba.

What did you expect to happen?

mamba and micromamba should be synonyms; alternatively, mamba should provide an error message that actually explains how to fix whatever it objects to, rather than telling me to do something I've already done.

Step-by-step reproduction instructions (by running brew commands)

brew install micromamba
mamba env create -n test   # this works
mamba activate test        # this fails
micromamba activate test   # this works
@ideabucket ideabucket added the bug Reproducible Homebrew/homebrew-core bug label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reproducible Homebrew/homebrew-core bug
Projects
None yet
Development

No branches or pull requests

1 participant