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

GOROOT not set/updated on directory change #12

Closed
amoosbr opened this issue Jan 27, 2023 · 1 comment · Fixed by #13
Closed

GOROOT not set/updated on directory change #12

amoosbr opened this issue Jan 27, 2023 · 1 comment · Fixed by #13

Comments

@amoosbr
Copy link
Contributor

amoosbr commented Jan 27, 2023

GOROOT environment variable is empty, when switching directories.

Reproduce:

cd ~
❯ rtx global
golang 1.19.5
❯ rtx env
export GOROOT=/Users/user/.local/share/rtx/installs/golang/1.19.5/go
...
❯ echo $GOROOT
/Users/user/.local/share/rtx/installs/golang/1.19.5/go

❯ mkdir ~/dev/tmp/empty-rtx-goroot
❯ cd ~/dev/tmp/empty-rtx-goroot
❯ echo $GOROOT\ls -la ~/dev/tmp/empty-rtx-goroot
total 0
drwxr-xr-x@  2 user  staff   64 Jan 27 18:21 .
drwxr-xr-x@ 12 user  staff  384 Jan 27 18:21 ..
❯ rtx global
golang 1.19.5
❯ rtx env
# no `export GOROOT`

Similar with local golang version:

New zsh:

# New zsh shell in user home (contains .tool-versions)
❯ rtx global
golang 1.19.5
❯ echo $GOROOT
/Users/user/.local/share/rtx/installs/golang/1.19.5/go
❯ cd ~/dev/tmp/rtx-goroot
❯ rtx env
export GOROOT=/Users/user/.local/share/rtx/installs/golang/1.18.10/go
...
❯ echo $GOROOT

❯ rtx local
golang 1.18.10
❯ cat .tool-versions
golang 1.18.10

Fix:

This seems to be related to the bin/exec-env handling. Not sure, if this should be fixed in the asdf-golang plugin or in rtx. I would expect GOROOT/JAVA_HOME be set always and updated on based on local overrides.

Update: Seems to be similar with JAVA_HOME

@amoosbr amoosbr changed the title GOROOT not set/updated by local golang GOROOT not set/updated on directory change Jan 27, 2023
jdx added a commit that referenced this issue Jan 27, 2023
jdx added a commit that referenced this issue Jan 27, 2023
jdx added a commit that referenced this issue Jan 27, 2023
jdx added a commit that referenced this issue Jan 27, 2023
@jdx jdx closed this as completed in #13 Jan 27, 2023
jdx added a commit that referenced this issue Jan 27, 2023
@jdx
Copy link
Owner

jdx commented Jan 28, 2023

this fix is out in 1.1

jdx pushed a commit that referenced this issue Apr 9, 2024
jdx added a commit that referenced this issue Jun 1, 2024
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 a pull request may close this issue.

2 participants