bazel-contrib / bazel-contrib/rules_go
go_binary: don't concatenate headers in c-archive, c-shared link modes
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
The `go_binary_c_archive_shared` macro declares several additional targets around `go_binary` rules with `linkmode = "c-shared"` or `"c-archive"`. One of these gathers all the .h files in the `cgo_exports` output group and concatenates them into a single header.
This is not what the Go command does. Only the export header for the `main` package should be visible. Incorporating headers from other packages adds confusion.
Contributor guide
Research direction
Start with the go_binary_c_archive_shared macro and its go_binary rules using linkmode = "c-shared" or "c-archive". Inspect how the cgo_exports output group is gathered and compare it with the Go command's export-header behavior; done means only the main package's export header is visible, without concatenated headers from other packages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100