← Back to Pull requests

Add `//pie:required` config setting #17

Open
fmeum opened this pull request with 61 lines diff across 2 files
View on GitHub
fmeum fmeum commented on Sep 27, 2026 22:45 UTC
Author

A config_setting_group matching target platforms that only run
position-independent executables: Android, Fuchsia, Apple OSes on arm64
and arm64_32, and Windows on ARM.

Diff: 61 lines (+61 / -0) across 2 files Reviewer: keith Review duration: 88409m
All Vouch review confidence checks passed
Residual risk 0.10 = Change Risk (0.64) × (1 − Review Confidence (0.85)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 61 lines diff across 2 files
0.64
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 1 substantive comment(s)
0.89
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
84%
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.247
Sensitive Paths sensitive_paths
0.064
Ai Authored ai_authored
0.050
Real PR Conversation Timeline
2 items
keith keith commented on code on Sep 28, 2026 16:42 UTC
Code Review
pie/BUILD.bazel:1
@@ -0,0 +1,60 @@
+# Config setting matching target platforms that only run position-independent executables (PIE).
+#
+# Usage: use `:required` as a `select()` key, e.g. to choose linker flags.
+
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# The OS and CPU combinations that require PIE, keyed by the name of their config setting.
+_REQUIREMENTS = {
+    # Android 5.0+ only loads PIE executables:
+    # https://source.android.com/docs/security/enhancements#android-5
+    "android": ["@platforms//os:android"],
+    # Zircon only loads PIE executables:
+    # https://fuchsia.dev/fuchsia-src/concepts/process/program_loading#background_traditional_elf_program_loading
+    "fuchsia": ["@platforms//os:fuchsia"],
+} | {
+    # Apple's linker always emits PIE for arm64 and arm64_32:
+    # https://github.com/apple-oss-distributions/ld64/blob/ld64-951.9/src/ld/Options.cpp#L5685-L5695
+    "{}_{}".format(os, cpu): [
+        "@platforms//os:" + os,
+        "@platforms//cpu:" + cpu,
+    ]
+    for os in [
+        "ios",
+        "macos",
+        "tvos",
+        "visionos",
+        "watchos",
+    ]
+    for cpu in [
+        "aarch64",
+        "arm64_32",
+        "arm64e",
+    ]

im not sure we actually want these here. because of the fact that there's no disabling this on apple platforms, the apple_support toolchain actually doesn't advertise the pie features to just avoid the complexity of bazel's pie stuff

Reviewers
Assignees
fmeum fmeum
Labels
risk: low confidence: 84.6% reviewed sensitive_module
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: 64.3% (MEDIUM) · Higher = larger blast radius
64.3%
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: 84.6% · Lower = rushed or shallow review
84.6%
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: 9.9% · Safe to merge
9.9%