Skip to content

fix: remove '-tags heroku' passed to CLI to honor '-tags' in GOFLAGS #578

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

Closed
wants to merge 1 commit into from

Conversation

GuillaumeDesforges
Copy link

@GuillaumeDesforges GuillaumeDesforges commented Nov 12, 2024

The CLI flag -tags heroku forcefully set in the buildpack overrides the tags set in the GOFLAGS environment variable, as per specified in:

https://github.com/golang/go/blob/c96939fbed3d60159dc81ee9ad591de8cfd41168/src/cmd/go/internal/help/helpdoc.go#L525-L531

Flags listed on the command line are applied after this list and therefore override it.

However, it makes it impossible to set other tags such as viper_bind_struct (see spf13/viper#1720) using the standard GOFLAGS="-tags=viper_bind_struct".

@GuillaumeDesforges GuillaumeDesforges requested a review from a team as a code owner November 12, 2024 11:35
@edmorley edmorley requested review from joshwlewis and removed request for a team November 12, 2024 11:43
Copy link
Member

@joshwlewis joshwlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a long history of apps on Heroku that depend on the -tags heroku for conditional compilation. Removing this would break a bunch of apps, so I can't accept this as-is. Maybe the buildpack could set a default value of GOFLAGS=-tags heroku when GOFLAGS was empty or unset instead?

@GuillaumeDesforges
Copy link
Author

Makes sense.

I'm not using this anymore so I will leave it at that.

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 this pull request may close these issues.

2 participants