| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| Expand Up | @@ -75,6 +75,7 @@ def get_env_patch(venv: str, version: str) -> PatchesT: | |
|
|
||
| return ( | ||
| ('GOROOT', os.path.join(venv, '.go')), | ||
| ('GOTOOLCHAIN', 'local'), | ||
| ( | ||
| 'PATH', ( | ||
| os.path.join(venv, 'bin'), os.pathsep, | ||
| Expand Down Expand Up | @@ -145,6 +146,7 @@ def install_environment( | |
| env = no_git_env(dict(os.environ, GOPATH=gopath)) | ||
| env.pop('GOBIN', None) | ||
| if version != 'system': | ||
| env['GOTOOLCHAIN'] = 'local' | ||
|
Comment thread
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityI think (?) this should be part of get_env_patch ?
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityFrom what I can see get_env_patch is only called from in_env which is used when running the hook and not during the installation. This should only be relevant during installation because that's when the build happens. I ran the test to make sure it works this way and it breaks when I move it.
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualityhmmm I guess? but what about for hooks that just call gofmt -- I know the rust toolchain gets grumbly when the versions mismatch -- does something like this survive? - repo: local
hooks:
- id: gofmt
name: gofmt
language: golang
entry: gofmt -l -w
types: [go]
Sorry, something went wrong.
All reactions
Copy link
Copy Markdown
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitygofmt doesn't seem to care about this option, but go fmt performs the toolchain switch. Looking at the code it seems that any go command will try to perform a toolchain switch. I guess the variable should be set in both places then.
Sorry, something went wrong.
asottile reacted with thumbs up emoji
All reactions
|
||
| env['GOROOT'] = os.path.join(env_dir, '.go') | ||
| env['PATH'] = os.pathsep.join(( | ||
| os.path.join(env_dir, '.go', 'bin'), os.environ['PATH'], | ||
| Expand Down | ||
| Back | FazBrowse Home | New Git URL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Qualitydoes this break with language_version: system? this seems different than the install code below
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low QualityIf the language_version is system the function is going to return before reaching that line, so it's consistent with the install code.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.