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

bug: Unexpected results for ‘system’ versions before installing asdf versions #1130

Open
andrewcrook opened this issue Dec 16, 2021 · 1 comment
Labels
enhancement help wanted priority asdf core intend to resolve soon

Comments

@andrewcrook
Copy link

andrewcrook commented Dec 16, 2021

Describe the Bug

Scenario -
rollout systems with asdf and basic plugins preinstalled,
by default work with the system versions of tools (as set in the config file).
allow user(s) to install other versions of tools as and when required

Issue -
When I install asdf and its plugins then set the globals to the systems.
if I then run, for example, asdf exec direnv status
I get the following

asdf exec direnv status
unknown command: direnv. Perhaps you have to reshim? 

I cannot get the command working until I have installed at least one version via asdf.
I have seen this behaviour with asdf-python and asdf-direnv plugins (gradually adding more)

I believe it should work with the system versions when no asdf versions are installed
I am not sure if this is a bug with each plugin or a bug in the core of asdf itself.

Steps to Reproduce

  1. install asdf
  2. install plugin example asdf-direnv
  3. set global to system - $asdf global direnv system (note: my system version is via homebrew)
  4. check
$asdf current
direnv          system          /Users/andrew/.tool-versions
python          system          /Users/andrew/.tool-versions

5. run commands this shows the issue

$asdf which direnv
unknown command: direnv. Perhaps you have to reshim? 
$asdf exec  direnv status
unknown command: direnv. Perhaps you have to reshim?
  1. install a version via asdf $asdf install direnv 2.28.0
  2. it can now find the system version
$asdf which direnv
/opt/homebrew/bin/direnv
  1. check the asdf version 2.28.0 $asdf global direnv 2.28.0
$asdf which direnv
/Users/andrew/.asdf/installs/direnv/2.28.0/bin/direnv

Expected Behaviour

when no versions are installed by asdf and set to system
allow the system version to work through asdf

Actual Behaviour

Doesn’t find any version
reshim doesn’t do anything
only finds system version if another version is installed via asdf``

Environment

OS:
Darwin Andrews-MBP.local 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:29:10 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T8101 arm64

SHELL:
zsh 5.8 (arm-apple-darwin21.1.0)

ASDF VERSION:
v0.9.0

ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/opt/homebrew/Cellar/asdf/0.9.0/libexec

ASDF INSTALLED PLUGINS:
direnv                       https://github.com/asdf-community/asdf-direnv.git master 4900445
python                       https://github.com/danhper/asdf-python.git master 57a4d72

asdf plugins affected (if relevant)

ASDF INSTALLED PLUGINS:
direnv                       https://github.com/asdf-community/asdf-direnv.git master 4900445
python                       https://github.com/danhper/asdf-python.git master 57a4d72

Possibly more. As mentioned I am not sure if this is a bug with each plugin or a bug in the core of asdf itself.

@Stratus3D
Copy link
Member

Hey @andrewcrook thanks for opening this issue. To confirm, this is an issue with the core of asdf itself. Plugins don't get to control the version-resolution process.

I agree that using the system version by default when no other version has been specified is good. However, I don't consider the current behavior to be a bug, but rather a missing feature. I'm updating this issue accordingly. I think this is a feature we should implement for v0.11.0, the next minor version release.

PR is welcome if you want to take a stab at this!

@Stratus3D Stratus3D modified the milestones: v0.10.0, v0.11.0 May 27, 2022
@jthegedus jthegedus removed this from the v0.11.0 milestone Jul 12, 2022
@jthegedus jthegedus added the priority asdf core intend to resolve soon label Jul 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement help wanted priority asdf core intend to resolve soon
Projects
None yet
Development

No branches or pull requests

3 participants