← Back to Pull requests

Allow rules based toolchains to set compiler_files_without_includes #922

Open
keith opened this pull request with 10 lines diff across 2 files
View on GitHub
keith keith commented on Oct 02, 2026 01:33 UTC
Author

This field is preferred when include scanning is enabled so that bazel
can decide for itself what headers are actually needed.

Unlike the other fields this one is not something we can derive based
on data of cc_args unless we tried to do some sneaky filtering

Diff: 10 lines (+9 / -1) across 2 files Reviewer: armandomontanez Review duration: 89354m
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.26) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.26 · 10 lines diff across 2 files
0.26
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.90 · 5 substantive comment(s)
0.90
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
85%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.143
Real PR Conversation Timeline
6 items
armandomontanez armandomontanez commented on code on Oct 02, 2026 21:36 UTC
Code Review
cc/toolchains/toolchain.bzl:1
@@ -145,6 +146,9 @@ def cc_toolchain(
             See
             [`cc_toolchain.supports_param_files`](https://bazel.build/reference/be/c-cpp#cc_toolchain.supports_param_files)
             for more information.
+        compiler_files_without_includes: (Label) Toolchain files required for compile actions
+            when include scanning is enabled. Include compiler tools and other mandatory inputs,

Since most of these are dictated by some combination of what tools you're using, and what configuration your toolchain is targeting, shouldn't this be populated by cc_tool and cc_args?

keith keith commented on code on Oct 02, 2026 21:37 UTC
Code Review
cc/toolchains/toolchain.bzl:1
@@ -145,6 +146,9 @@ def cc_toolchain(
             See
             [`cc_toolchain.supports_param_files`](https://bazel.build/reference/be/c-cpp#cc_toolchain.supports_param_files)
             for more information.
+        compiler_files_without_includes: (Label) Toolchain files required for compile actions
+            when include scanning is enabled. Include compiler tools and other mandatory inputs,

I looked at that but that's why I added something to the pr desc, I don't think we can derive that since we would have to manually exclude things (which is the whole value of this)

armandomontanez armandomontanez commented on code on Oct 02, 2026 21:39 UTC
Code Review
cc/toolchains/toolchain.bzl:1
@@ -145,6 +146,9 @@ def cc_toolchain(
             See
             [`cc_toolchain.supports_param_files`](https://bazel.build/reference/be/c-cpp#cc_toolchain.supports_param_files)
             for more information.
+        compiler_files_without_includes: (Label) Toolchain files required for compile actions
+            when include scanning is enabled. Include compiler tools and other mandatory inputs,

not as data; it'd be a new attribute.

keith keith commented on code on Oct 03, 2026 00:07 UTC
Code Review
cc/toolchains/toolchain.bzl:1
@@ -145,6 +146,9 @@ def cc_toolchain(
             See
             [`cc_toolchain.supports_param_files`](https://bazel.build/reference/be/c-cpp#cc_toolchain.supports_param_files)
             for more information.
+        compiler_files_without_includes: (Label) Toolchain files required for compile actions
+            when include scanning is enabled. Include compiler tools and other mandatory inputs,

so you're thinking on cc_tool (which would probably be enough for this case given it's use case) beside data we'd have data_without_headers and we'd collect those from the compile actions?

armandomontanez armandomontanez commented on code on Oct 03, 2026 00:28 UTC
Code Review
cc/toolchains/toolchain.bzl:1
@@ -145,6 +146,9 @@ def cc_toolchain(
             See
             [`cc_toolchain.supports_param_files`](https://bazel.build/reference/be/c-cpp#cc_toolchain.supports_param_files)
             for more information.
+        compiler_files_without_includes: (Label) Toolchain files required for compile actions
+            when include scanning is enabled. Include compiler tools and other mandatory inputs,

Yeah, naming might be fun with this one. include_scanning_exempt_data is long and signals the why but not the what. data_without_headers signals the what but not the why.

What if we flipped the problem? All data is include scanning exempt unless something like scanned_hdrs is set? Seems to signal the what and the why.

Assignees
keith keith
Labels
risk: low confidence: 85.4% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 25.8% (LOW) · Higher = larger blast radius
25.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 85.4% · Lower = rushed or shallow review
85.4%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 3.8% · Safe to merge
3.8%