exec-env improvements#80
Conversation
|
Checking if |
|
I just finished reading asdf-community/asdf-direnv#149, I think but you are right about unsetting/setting |
|
I agree changing is more crucial for For Anyway, I can revise this PR once I know what behavior the maintainers here prefer. Personally, I would drop touching both |
|
Thanks for the PR @scop! I've got the next two weeks off, so I'll spend some time digging into this one. |
Otherwise they -- especially GOROOT -- may end up pointing to a completely wrong one.
Otherwise, existing values from the environment may continue to point to a wrong version. Refs asdf-community/asdf-direnv#149
168b974 to
aa82aae
Compare
|
Rebased to resolve conflicts, cleaned up indentation some. |
…TH} is 1 Setting these variables is not really required for things to work, and some setups explicitly prefer them not to be touched. Modeled after the similar options in goenv. https://github.com/syndbg/goenv/blob/d4e2dd79b83496dbf9474e31dbdb8d7eb8bb0261/ENVIRONMENT_VARIABLES.md
aa82aae to
91cd860
Compare
|
Anything I can do to help with this? |
|
Hi, Is there anything that can be done to get this merged? Is there anything missing or broken here, apart from the conflicts due to the age of the PR? |
|
Just to clarify my reason for bumping this, my custom GOPATH is always overwritten right now by the GOPATH in the This seems to be because References:
Prepare the environment before executing the shims for the binaries for the tool.
**Environment Variables available to script**
- `ASDF_INSTALL_TYPE`: `version` or `ref`
- `ASDF_INSTALL_VERSION`:
- Full version number if `ASDF_INSTALL_TYPE=version`.
- Git ref (tag/commit/branch) if `ASDF_INSTALL_TYPE=ref`.
- `ASDF_INSTALL_PATH`: The path to where the tool _has been_, or _should be_ installed.
|
|
@darthShadow, was this happening with I ask because |
|
Can't really say for sure. Theoretically, I would say yes, because bash may have been passing through the variables unless they were cleared intentionally, but golang requires them to be explicitly declared for any shell-command executions. However, I recently moved from Goland to Cursor, and it requires a couple of tools to be installed separately. That switch led me to this issue since the installs were going to a different path than expected and required a reinstall on every restart of Cursor. |
|
@darthShadow you can still downgrade to |
|
Yep, can confirm v0.15 is passing through all environment variables and v0.16 is only passing the specified subset. |
|
@darthShadow I believe your issue will be fixed when asdf-vm/asdf#1899 is merged. There may be other places where
|
|
I don't think that specific PR will help? That seems to be only for plugin updates and doesn't pass through GOPATH. I would guess this needs a separate PR upstream that either allows all environment variables to pass through as before or allows a plugin to specify which ones it is interested in. The second option is probably cleaner but will require changes in all plugins relying on the first option. |
|
Upstream bug report: asdf-vm/asdf#1924 |
|
Thanks @darthShadow |
|
JFYI, I do not intend to work further on this or resolve conflicts etc, as I'm no longer using asdf (have switched to mise). I suggest someone who does take this over. |
See individual commit messages for details on each change.