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

Allow running tools from one another without passing ASDF_DATA_DIR around #1716

Open
romeovs opened this issue Jan 25, 2024 · 0 comments
Open

Comments

@romeovs
Copy link

romeovs commented Jan 25, 2024

Is your feature request related to a problem? Please describe

I'm using asdf for most of my development work.

I'm currently working on a job where test runners spawn each other.
Our nodejs test runner starts up a java server for example,
with an empty env, except for PATH.

I've got all tools set up in .tool-versions.

When calling java from nodejs the error is:

unknown command: java. Perhaps you have to reshim?

This can be fixed by adding ASDF_DATA_DIR to the env in the nodejs code that
spawns java.

Is there a way of avoiding this, I don't want to force my package manager on the project.

I've set up a reproduction repo here.

Describe the proposed solution

Could the shims for the all current .tool-version be references in the PATH variable set when called a tool is called?

For example: in the reproduction repo I set up, golang gets the following items in it's PATH (that are not coming from my shell environment):

/Users/romeo/.asdf/installs/golang/1.21.6/go/bin
/Users/romeo/.asdf/installs/golang/1.21.6/packages/bin

Could this also include the node installs?

Describe similar asdf features and why they are not sufficient

None come to mind.

Describe other workarounds you've considered

Adding the ASDF_DATA_DIR environment variable to the spawn call works, but forces the code to know about asdf which I would like to avoid.

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

1 participant