bazel-contrib / bazel-contrib/rules_go

Better support for C++ Sandwich

Open
#2,176 7 comments 4 reactions 0 assignees View on GitHub
cgo enhancement
Dominant language
Go
Stars
1.5k
Forks
760
Avg merge
1d 11h
Merged PRs (30d)
12

Description

If I understand correctly, `rules_go` supports C++ Sandwich s.t. `go_library` can have `.{c,cc,h,..}` sources and depend on `cc_library`. It would be great if that was also possible the other way around, but that currently fails because `go_library` doesn't return `CcInfo`.

I did some experiments regarding such an implementation and somehow succeeded to expose the C++ headers to other `cc_library` targets. However, linking the final binary failed because I could figure out how to get the correct archives (i.e. `.a`) for the Go targets.

Any help regarding this issue would be greatly appreciated.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported failure with a go_library consumed by a cc_library and linked into a final binary. Read the rules_go handling of CcInfo and the archive outputs involved; done means C++ targets can consume Go targets and the final binary links successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, go
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.