bazel-contrib / bazel-contrib/rules_go
Empty c files make the build sulky
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 760
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
The new cgo stuff is much better in many ways, but it does mean we often compile empty c files, and for some reason ranlib on the mac likes to produce non suppressible warnings for this.
```
ranlib: file: bazel-out/darwin_x86_64-fastbuild/.....cgo_c_lib.lo(_cgo_export.o) has no symbols
```
I think it's kind of ugly that the normal build process causes log spam, which might hide real information from the user. I think the only way to fix it though is to make all generated c files have at least one symbol in them, not sure what the best way to do that is that will work in all cases, on all compilers, is guaranteed to never cause a duplicate symbol error with user code, and does not cost in runtime memory or binary size.
Contributor guide
Research direction
Start by reproducing the macOS build that emits the ranlib warning for bazel-out/darwin_x86_64-fastbuild/.....cgo_c_lib.lo(_cgo_export.o), then trace which generated C files are empty. Done means the normal cgo build no longer produces these warnings without introducing duplicate symbols, runtime memory, or binary-size costs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, go
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100