Skip to content

feat(golang-rewrite): add support for shim templates resolution #2067

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

augustobmoura
Copy link
Member

Summary

In this PR I'm adding support for custom shim templates back, since it is missing from the current go implementation.
As of now, the implementation short-circuits very early if it finds an acceptable shim in the first tool available.

Plugins that I know are using shim templates are: asdf-elixir, asdf-nodejs, and asdf-python.

fixes #2025 asdf-vm/asdf-nodejs#421

Verified

This commit was signed with the committer’s verified signature.
augustobmoura Augusto Moura

Verified

This commit was signed with the committer’s verified signature.
augustobmoura Augusto Moura

Verified

This commit was signed with the committer’s verified signature.
augustobmoura Augusto Moura

Verified

This commit was signed with the committer’s verified signature.
augustobmoura Augusto Moura

Verified

This commit was signed with the committer’s verified signature.
augustobmoura Augusto Moura
@Stratus3D
Copy link
Member

Hi @augustobmoura . I'm not actually sure custom shim templates are needed for Elixir. The plugin seems to work fine for me without the custom shim for mix.

Was I wrong in my understanding when I removed this feature? See https://asdf-vm.com/guide/upgrading-to-v0-16.html#custom-shim-templates-are-no-longer-supported

@augustobmoura augustobmoura changed the title feat(shims): add support for shim templates resolution feat(golang-rewrite): add support for shim templates resolution Apr 22, 2025
@augustobmoura
Copy link
Member Author

Was I wrong in my understanding when I removed this feature? See https://asdf-vm.com/guide/upgrading-to-v0-16.html#custom-shim-templates-are-no-longer-supported

Shim templates are still being used by asdf-nodejs and asdf-python for auto-reshimming after running global installs.

We could think of a different mechanism for this, instead of shim templates. We need a way of intercepting calls to commands and conditionally marking them for auto-reshiming after the command is finished. Similar to plugin hooks, but defined at the plugin level, instead of user level.

Maybe we could implement a way of having plugin hooks at mutiple levels? plugin, user, and maybe system level for example. And all of them are called when the hook is triggered, wdyt?

@Stratus3D
Copy link
Member

@augustobmoura thanks for the clarification. I guess I'd be inclined to add back in support for custom shim templates. I'm not a fan of how asdf hooks are designed. And hooks are not controlled by the plugin, they are managed by the user. I'm going to work to get this PR merged soon.

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

Successfully merging this pull request may close these issues.

bug: shim creation doesn't honor custom shims
2 participants