jdx / mise

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

Best way to migrate to mise? #1350

Closed silasb closed 10 months ago

silasb commented 10 months ago

We leverage this tool for some development related tooling, but was surprised when we had a developer try to install rtx, which succeeded, but actually installed mise. Was there a reason we didn't leave the rtx homebrew package around so folks could migrate on their own leisure?

We are thinking of a couple options:

silasb commented 10 months ago

I found https://mise.jdx.dev/rtx.html

Might be a good idea to link to that page. I can open a PR.

jdx commented 10 months ago

someone else asked about this problem and I suggested doing the following:

$ cat <<EOF >/opt/homebrew/bin/rtx
#!/usr/bin/env bash
echo "[WARN] rtx has been replaced with mise. Please use `mise` instead of `rtx` to hide this warning." >&2
mise "$@"
EOF

it's my understanding that during migrations like this homebrew doesn't keep old formulas around but I think adding a shim like this for rtx would be better anyhow so the end-user knows they're using an abandoned CLI but will still have a functioning setup.

rdonkin-attest commented 10 months ago

Some help with migration would be great - I wasn't aware of a pending rename.

Fortunately rtx-actions@v1 in CI seems to work fine even though it's installing rtx.

Doing an FAQ, or maybe pinning key issues for rtx and rtx-actions migration, would be great.

Thanks for all your work on mise/rtx, it really is a great tool! 👍

blopker commented 10 months ago

Yeah, this surprised me as well. I even looked at the README and still missed the link talking about the rename. I'd suggest putting the announcement with a link to that page much larger and at the top of the README for a month or two.

uvlad7 commented 10 months ago

@jdx the migration doc says it's required to reinstall Ruby & Python. Can you pls describe why? Is it due to some hardcoded paths in the compiled binaries? I really want to avoid re-installation - especially for Ruby, cause I have a lot of Rubies with a lot of gems installed.

jdx commented 10 months ago

right, they're not compiled to be able to be moved. You can symlink the install directory to the old rtx directory manually.

uvlad7 commented 10 months ago

Or even hardlink. Maybe add this as an automatic migration option with an alert that removing the original directory will break things?

And what about community-developed plugins? I assume they are not migrated automatically too, right?

jdx commented 10 months ago

I can't (or maybe don't want is more accurate) to put much complexity into the migration code. It's hard to test and since it runs every single time the CLI launches it's a precarious place to be. I've already caused several bugs in that logic and really don't want to make more mistakes there. It also happens before the CLI starts so doing things like showing a prompt isn't easy because prompting relies on initialization that wouldn't have happened yet. It's also of little value compared to other things I could be working on since it only happens once per user.

If I had all the time in the world I would get e2e tests around it and make it as automated as possible, but that's just not the reality.

I think there is also some question on how the linking would be done (hard, sym for a start). You could symlink the whole directory: ln -s ~/.local/share/{rtx,mise} individual languages: ln -s ~/.local/share/{rtx,mise}/installs/python or individual versions: ln - s ~/.local/share/{rtx,mise}/installs/python/3.0.0.

That said, if someone wants to add a note on how to setup links for this I'd be more than happy to add it to the migration doc. I think that's the easier and safer approach here.

And what about community-developed plugins? I assume they are not migrated automatically too, right?

All plugins are migrated.

uvlad7 commented 10 months ago

if someone wants to add a note on how to setup links for this

Ok, maybe I'll try. But honestly, I don't want to migrate right now

All plugins are migrated

Oh, I should have been more precise, I mean tools installed via those plugins. It's unknown whether they are movable

jdx commented 10 months ago

everything that's not ruby/python is migrated. It's possible other tools may use unmovable binaries but I haven't heard of any yet. I think there aren't likely to be too many though since not very many tools actually compile inside the plugin.

uvlad7 commented 10 months ago
vladimir@np940x5n:~/.local/share/rtx/installs/php$ grep -rnFe 'share/rtx' -l 
8.3.1RC3/pear.conf
8.3.1RC3/lib/php/.registry/archive_tar.reg
8.3.1RC3/lib/php/.registry/pear.reg
8.3.1RC3/lib/php/.registry/xml_util.reg
8.3.1RC3/lib/php/.registry/console_getopt.reg
8.3.1RC3/lib/php/.registry/structures_graph.reg
8.3.1RC3/lib/php/pearcmd.php
8.3.1RC3/lib/php/peclcmd.php
8.3.1RC3/lib/php/test/Structures_Graph/tests/helper.inc
8.3.1RC3/php/man/man8/php-fpm.8
8.3.1RC3/bin/php-cgi
8.3.1RC3/bin/phar.phar
8.3.1RC3/bin/php
8.3.1RC3/bin/php-config
8.3.1RC3/bin/phpize
8.3.1RC3/bin/pecl
8.3.1RC3/bin/pear
8.3.1RC3/bin/phpdbg
8.3.1RC3/bin/peardev
8.3.1RC3/php-fpm.conf.default
8.3.1RC3/include/php/main/build-defs.h
8.3.1RC3/sbin/php-fpm
8.3.1RC3/php-fpm.d/www.conf.default
vladimir@np940x5n:~/.local/share/rtx/installs/php$ cd ../lua/
vladimir@np940x5n:~/.local/share/rtx/installs/lua$ grep -rnFe 'share/rtx' -l 
5.4.6/luarocks/bin/luarocks-admin
5.4.6/luarocks/bin/luarocks
5.4.6/luarocks/etc/luarocks/config-5.4.lua
vladimir@np940x5n:~/.local/share/rtx/installs/lua$ 
vladimir@np940x5n:~/.local/share/rtx/installs/lua$ cd ../go/
vladimir@np940x5n:~/.local/share/rtx/installs/go$ grep -rnFe 'share/rtx' -l 
1.20.4/packages/bin/gophernotes
vladimir@np940x5n:~/.local/share/rtx/installs/go$ cd ../node/
vladimir@np940x5n:~/.local/share/rtx/installs/node$ grep -rnFe 'share/rtx' -l 
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/input.cpython-310.pyc
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/simple_copy.cpython-310.pyc
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/common.cpython-310.pyc
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/__init__.cpython-310.pyc
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__pycache__/xcode_emulation.cpython-310.pyc
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/__init__.cpython-310.pyc
16.13.1/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/__pycache__/make.cpython-310.pyc
vladimir@np940x5n:~/.local/share/rtx/installs/node$ cd ../rust/
vladimir@np940x5n:~/.local/share/rtx/installs/rust$ ll
total 20
drwxrwxr-x  5 vladimir vladimir 4096 сту  8 19:49 ./
drwxrwxr-x 17 vladimir vladimir 4096 сту 10 19:53 ../
lrwxrwxrwx  1 vladimir vladimir    8 кас 14 04:42 1 -> ./1.73.0/
lrwxrwxrwx  1 vladimir vladimir    8 сту  8 19:49 1.71 -> ./1.71.1/
drwxrwxr-x  2 vladimir vladimir 4096 кас 14 04:41 1.71.1/
lrwxrwxrwx  1 vladimir vladimir    8 кас  2 01:24 1.72 -> ./1.72.1/
drwxrwxr-x  8 vladimir vladimir 4096 ліс 10 02:00 1.72.1/
lrwxrwxrwx  1 vladimir vladimir    8 кас 14 04:42 1.73 -> ./1.73.0/
lrwxrwxrwx  1 vladimir vladimir   21 кас 14 04:42 1.73.0 -> /home/vladimir/.cargo/
lrwxrwxrwx  1 vladimir vladimir    8 кас 14 04:42 latest -> ./1.73.0/
drwxrwxr-x  7 vladimir vladimir 4096 кас 11 03:11 nightly/
lrwxrwxrwx  1 vladimir vladimir   21 кас 14 03:41 rustup -> /home/vladimir/.cargo/
vladimir@np940x5n:~/.local/share/rtx/installs/rust$ grep -rnFe 'share/rtx' -l 
1.72.1/lib/rustlib/manifest-rustfmt-preview
1.72.1/lib/rustlib/install.log
1.72.1/lib/rustlib/manifest-rust-analyzer-preview
1.72.1/lib/rustlib/manifest-rustc
1.72.1/lib/rustlib/manifest-rust-demangler-preview
1.72.1/lib/rustlib/manifest-rust-analysis-x86_64-unknown-linux-gnu
1.72.1/lib/rustlib/manifest-rust-docs
1.72.1/lib/rustlib/manifest-rust-docs-json-preview
1.72.1/lib/rustlib/manifest-rls-preview
1.72.1/lib/rustlib/manifest-cargo
1.72.1/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
1.72.1/lib/rustlib/manifest-llvm-tools-preview
1.72.1/lib/rustlib/manifest-clippy-preview
1.72.1/bin/evcxr_jupyter
1.72.1/bin/evcxr
1.72.1/bin/bindgen
1.72.1/bin/cargo-expand
nightly/lib/rustlib/manifest-rustfmt-preview
nightly/lib/rustlib/install.log
nightly/lib/rustlib/manifest-rust-analyzer-preview
nightly/lib/rustlib/manifest-rustc
nightly/lib/rustlib/manifest-rust-demangler-preview
nightly/lib/rustlib/manifest-rust-analysis-x86_64-unknown-linux-gnu
nightly/lib/rustlib/manifest-rust-docs
nightly/lib/rustlib/manifest-rust-docs-json-preview
nightly/lib/rustlib/manifest-rls-preview
nightly/lib/rustlib/manifest-cargo
nightly/lib/rustlib/manifest-rust-std-x86_64-unknown-linux-gnu
nightly/lib/rustlib/manifest-llvm-tools-preview
nightly/lib/rustlib/manifest-miri-preview
nightly/lib/rustlib/manifest-clippy-preview

plus poetry and pipenv, ofk