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

Support .syso files in the srcs lists for go_library and go_test rules. #4151

Merged
merged 5 commits into from
Oct 21, 2024

Conversation

eljobe
Copy link
Contributor

@eljobe eljobe commented Oct 21, 2024

What type of PR is this?
Feature

What does this PR do? Why is it needed?

Essentially, go build ./... and go test ./... allow having .syso files in the packages and it includes them in the packages it creates so that functions defined therein can be called from Go code.

Bazel didn't allow them to be among the srcs in these rules until this PR.

Which issues(s) does this PR fix?

Fixes #4148

Other notes for review

I also added a bunch of tests and ran them on both linux (amd64) and Mac OS (arm64).

It's quite possible that I need to add some more things to get these tests to work on other platforms which are in the CI system.

This commit adds minimal support for allowing .syso files to be in the
`srcs` list for these rules.

Related to bazel-contrib#4148
Copy link
Contributor

@sluongng sluongng left a comment

Choose a reason for hiding this comment

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

It seems like most of the groundwork has already been done in #3763 which correctly instruments go tool pack to append the syso file(s) to the compiled archive. However, it only added support for go_binary and not go_library and go_test. This PR added support for the remaining rules.

LGTM

tests/core/go_library/BUILD.bazel Show resolved Hide resolved
tests/core/go_binary/meaning2.go Outdated Show resolved Hide resolved
@fmeum fmeum merged commit b1a4cc1 into bazel-contrib:master Oct 21, 2024
1 check passed
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.

Feature Request: Support syso files as source files in rules_go
3 participants