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

Reshim doesn't update asdf path #531

Closed
pikeas opened this issue May 29, 2019 · 14 comments
Closed

Reshim doesn't update asdf path #531

pikeas opened this issue May 29, 2019 · 14 comments

Comments

@pikeas
Copy link

pikeas commented May 29, 2019

Steps to reproduce

$ which asdf
/usr/local/Cellar/asdf/0.7.2/bin/asdf

$ python
/Users/aris/.asdf/shims/python: line 3: /usr/local/Cellar/asdf/0.7.1/bin/asdf: No such file or directory
/Users/aris/.asdf/shims/python: line 3: exec: /usr/local/Cellar/asdf/0.7.1/bin/asdf: cannot execute: No such file or directory

$ cat ~/.asdf/shims/python
#!/usr/bin/env bash
# asdf-plugin: python 3.7.3
exec /usr/local/Cellar/asdf/0.7.1/bin/asdf exec "python" "$@"

$ asdf reshim python

$ cat ~/.asdf/shims/python
#!/usr/bin/env bash
# asdf-plugin: python 3.7.3
exec /usr/local/Cellar/asdf/0.7.1/bin/asdf exec "python" "$@"

Expected behavior

asdf reshim python should update the asdf path from 0.7.1 to 0.7.2

Actual behavior

The shim file was unchanged.

Environment

OS: OS X 10.14

asdf version: 0.7.2

@pikeas
Copy link
Author

pikeas commented Aug 8, 2019

This happens because my shell sourced asdf from /usr/local/Cellar/asdf/<version> instead of brew --prefix asdf. Updating the source command to the latter, and running rm -rf ~/.asdf/shims && asdf reshim recreates the shims with the correct exec path.

@pikeas pikeas closed this as completed Aug 8, 2019
@pikeas
Copy link
Author

pikeas commented Aug 8, 2019

Re-opening this issue because a case can be made for reshim updating the exec path when it changes.

@pikeas pikeas reopened this Aug 8, 2019
@Stratus3D
Copy link
Member

@pikeas we haven't had anyone else report this issue recently, can you check and see if this is still a problem on the latest version of asdf and asdf-python? Thanks!

@pikeas
Copy link
Author

pikeas commented Feb 5, 2021

Just checked, reshim does not update when the exec command changes.

$ grep exec ~/.asdf/shims/python
exec /usr/local/opt/asdf/bin/asdf exec "python" "$@"

$ asdf reshim

$ grep exec ~/.asdf/shims/python
exec /usr/local/opt/asdf/bin/asdf exec "python" "$@"

$ grep asdf ~/.config/fish/config.fish
source /usr/local/Cellar/asdf/0.8.0/asdf.fish

$ rm ~/.asdf/shims/python
$ asdf reshim

$ grep exec ~/.asdf/shims/python
exec /usr/local/Cellar/asdf/0.8.0/bin/asdf exec "python" "$@"

This isn't a problem generally as /usr/local/opt/asdf symlinks to ../Cellar/asdf/<version>. As a quality of life improvement, it would be nice if reshim always updated shims relative to the invoked script, rather than only recreating when the shim is missing.

@yukster
Copy link

yukster commented Feb 16, 2022

I just had this problem with Elixir/Erlang... tho maybe it's Homebrew's fault? I had several Elixir apps with various Elixir/Erlang versions and then checked out another app that is written in Ruby. I used asdf to install the correct Ruby version, then installed a ton of deps used by that app. Somewhere in there homebrew updated asdf from 0.8.1 to 0.9.0 but didn't fix the elixir/erlang shims. All the new Ruby shims had paths like /usr/local/opt/asdf/libexec/bin/asdf but the old shims had /usr/local/Cellar/asdf/0.8.1/... and I could not get reshim to update those. Even uninstalling all Elixir and Erlang versions did not remove the shims. Eventually just manually deleted each broken shim and after reinstalling my first Elixir and Erlang versions all the new shims are correct.

@connorjacobsen
Copy link

Also just had this problem with elixir/erlang and running rm -rf ~/.asdf/shims && asdf reshim fixed it for me.

@maco
Copy link

maco commented Mar 3, 2022

Just bumped into this with Python.

@gukandrew
Copy link

@connorjacobsen works for me as well! Thanks!

@taylorkhanrecharge
Copy link

@connorjacobsen worked for me as well!

@tadasajon
Copy link

tadasajon commented May 3, 2022

I just bumped into this issue with elixir/erlang as well -- but the solution from @connorjacobsen worked

@anjaniacatus
Copy link

Also just had this problem with elixir/erlang and running rm -rf ~/.asdf/shims && asdf reshim fixed it for me.

got the same issue, it works thanks

@Drarok
Copy link

Drarok commented May 4, 2022

Having to manually delete the shims to make a reshim command work seems counter-intuitive to me, but that does indeed seem to be the current way things work.

@albertvaka
Copy link

Not only that, IMO reshiming all existing shims should happen automatically on upgrade. Otherwise, all binaries break when asdf is updated.

@jthegedus
Copy link
Contributor

Closing this as #1115 is the same but more active conversation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests