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

Fix //go/config:linkmode flag value not being effective #3627

Merged
merged 1 commit into from Jul 18, 2023
Merged

Conversation

fmeum
Copy link
Collaborator

@fmeum fmeum commented Jul 17, 2023

What type of PR is this?

Bug fix

What does this PR do? Why is it needed?

The value of the flag was always overriden by the linkmode go_binary attribute, even if that attribute was at its default (normal) value. Instead, use a default of auto to distinguish this case from the case where no attribute value has been set explicitly.

Which issues(s) does this PR fix?

Fixes #3614
Closes #3615

Other notes for review

@fmeum
Copy link
Collaborator Author

fmeum commented Jul 17, 2023

@HakanSunay

@HakanSunay
Copy link

lgtm

I also validated that gazelle is built with linkmode set to "pie" when --@io_bazel_rules_go//go/config:linkmode=pie is passed, because the gazelle binary does not use go_binary directly, but its internals.

@fmeum fmeum enabled auto-merge (squash) July 18, 2023 06:31
The value of the flag was always overriden by the `linkmode` `go_binary`
attribute, even if that attribute was at its default (`normal`) value.
Instead, use a default of `auto` to distinguish this case from the case
where no attribute value has been set explicitly.

Fixes #3614
Closes #3615
@fmeum fmeum merged commit 61c1e91 into master Jul 18, 2023
2 checks passed
@fmeum fmeum deleted the 3614-linkmode branch July 18, 2023 06:51
@HakanSunay
Copy link

HakanSunay commented Jul 18, 2023

@fmeum, I forgot to point out that this issue is present for go_test too.

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.

go_binary and go_test rules do not take --@io_bazel_rules_go//go/config:linkmode=pie into account
3 participants