cc_binary dep on cc_library#linkstamp doesn't set up include paths correctly for non-root module deps
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- cpp
- Domain
- build-system
Research direction
Reproduce the failure using the linked linkstamp_issue_rules_cc example with Bazel 8.2.1 and rules_cc 0.1.1, comparing ersatz_foo and ersatz_main in module B. Start from the cc_binary target with the linkstamp and the reported build_embed.cc include failure. Done means the non-root-module binary compiles with the required include path, while the existing reproduction case remains covered.
Written by the indexing model from the issue text.
Description
Suppose you have two bazel modules, A and B. B depends upon A.
A has a cc_library called "src/foo:foo". This library has linkstamp = build_embed.cc", where build_embed.cc has a local include path: #include "src/foo/build_embed.h"`.
A's "src/foo:foo" library is a dep of a binary called "src/foo:main", also within A.
B has two targets that just copy from A: "ersatz_main" and "ersatz_foo". Both of these targets just copy the output files of @A//src/foo:{foo,main} into B's repository.
Within B, it is possible to compile ersatz_foo correctly. However, it is not possible to compile ersatz_main. This error occurs:
external/foo+/src/foo/build_embed.cc:1:10: fatal error: src/foo/build_embed.h: No such file or directory
1 | #include "src/foo/build_embed.h"
It seems that the compilation action for cc_binary targets with linkstamp set does not properly add all required include paths.
See https://github.com/ted-xie/linkstamp_issue_rules_cc for full repro.
Bazel version: 8.2.1 (also repros at 7.4.1)
rules_cc version: 0.1.1 (also repros at 0.0.10)
- Dominant language
- Starlark
- Stars
- 247
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bazelbuild/rules_cc
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bazelbuild/rules_cc#841 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bazelbuild/rules_cc#839 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
bazelbuild/rules_cc#895 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
bazelbuild/rules_cc#893 ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
bazelbuild/rules_cc#847 ·
All issues in bazelbuild/rules_cc
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
priority: p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
googleapis/librarian#7636 ·
-
package-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
oSoWoSo/vOid_Community_repOsitory#147 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
agentic-workflows cascade-suspected
Difficulty 1/5 Under an hour Newbie friendliness 88/100