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

exec-env improvements #80

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

Conversation

scop
Copy link

@scop scop commented Apr 23, 2022

See individual commit messages for details on each change.

@missingcharacter
Copy link
Contributor

Checking if GOROOT and GOPATH should be more than enough, there is no need to add unset or add 2 environment variables (ASDF_GOLANG_DISABLE_GOROOT, ASDF_GOLANG_DISABLE_GOPATH

@missingcharacter
Copy link
Contributor

missingcharacter commented Apr 23, 2022

I just finished reading asdf-community/asdf-direnv#149, I think GOPATH should not be changed if it was already set since GOPATH is normally a developer's workspace.

but you are right about unsetting/setting GOROOT depending on the switch between versions

@scop
Copy link
Author

scop commented Apr 25, 2022

I agree changing is more crucial for GOROOT if it's set.

For GOPATH, one approach would be to change if the already set value looks like something asdf-golang has set it to earlier, otherwise leave alone.

Anyway, I can revise this PR once I know what behavior the maintainers here prefer.

Personally, I would drop touching both GOROOT and GOPATH altogether, no matter if set or not. That'd be a backwards incompatible change though -- therefore the ASDF_GOLANG_DISABLE_* variables, to make the breaking change opt-in.

@kennyp
Copy link
Member

kennyp commented Dec 17, 2022

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
@scop scop force-pushed the feat/exec-env-improvements branch from 168b974 to aa82aae Compare January 1, 2023 19:49
@scop
Copy link
Author

scop commented Jan 1, 2023

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
@scop scop force-pushed the feat/exec-env-improvements branch from aa82aae to 91cd860 Compare January 1, 2023 19:52
@scop
Copy link
Author

scop commented Jul 17, 2023

Anything I can do to help with this?

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

Successfully merging this pull request may close these issues.

3 participants