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

cmd/go: configure -buildvcs via environment variable #52308

Closed
zmb3 opened this issue Apr 12, 2022 · 8 comments
Closed

cmd/go: configure -buildvcs via environment variable #52308

zmb3 opened this issue Apr 12, 2022 · 8 comments
Labels
FrozenDueToAge GoCommand cmd/go WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@zmb3
Copy link
Contributor

zmb3 commented Apr 12, 2022

Would there be any appetite for an environment variable alternative that configures the -buildvcs flag?

Use case - in order to build my project with 1.18 I need to set -buildvcs=false - our repository layout breaks the "main package and the main module containing it are in the repository containing the current directory rule."

If I unconditionally set -buildvcs=false, the project builds successfully on Go 1.18, but fails on 1.17 because it doesn't understand the -buildvcs flag. In order to support both Go versions, I have to add logic to handle version-specific flags.

Something like an environment variable would allow builds on 1.17 and 1.18 to succeed.

@zmb3 zmb3 added the Proposal label Apr 12, 2022
@seankhliao seankhliao added the GoCommand cmd/go label Apr 12, 2022
@seankhliao
Copy link
Member

maybe we should just backport recognizing (and ignoring) -buildvcs in GOFLAGS for 1.17

cc @bcmills @matloob

@bcmills
Copy link
Member

bcmills commented Apr 12, 2022

I suspect that your use-case will be fixed more simply by CL 398855.

@bcmills bcmills added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Apr 12, 2022
@bcmills
Copy link
Member

bcmills commented Apr 12, 2022

@zmb3, could you have a look at #51748 and see if that will resolve your use-case?

@zmb3
Copy link
Contributor Author

zmb3 commented Apr 12, 2022

Ironically, I originally had this comment in #51478 and was concerned that would muddy the issue.

But yes, if we default to buildvcs=auto and backport that to 1.17 I would be all set.

@zmb3
Copy link
Contributor Author

zmb3 commented Apr 13, 2022

@bcmills I'm happy to close this one if there's no further action needed and -buildvcs will be backported to Go 1.17 - let me know (or just go ahead and close).

@seankhliao
Copy link
Member

I don't think -buildvcs will be backported, only that the new default (auto) for 1.18 means you shouldn't need to set anything that may conflict between versions.

@zmb3
Copy link
Contributor Author

zmb3 commented Apr 13, 2022

Ah, I understand now. That's fine too!

@bcmills
Copy link
Member

bcmills commented Apr 20, 2022

Duplicate of #51748

@bcmills bcmills marked this as a duplicate of #51748 Apr 20, 2022
@bcmills bcmills closed this as completed Apr 20, 2022
@golang golang locked and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge GoCommand cmd/go WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants