← Back to Pull requests

Fix cc_common.link runtime library selection #4225

Open
KirillTim opened this pull request with 179 lines diff across 5 files
View on GitHub
KirillTim KirillTim commented on Aug 12, 2026 14:22 UTC
Author

Summary

  • honor --dynamic_mode=fully when calling cc_common.link

  • add Starlark analysis tests for runtime selection and shared link_deps

  • compare Rust linkage behavior with equivalent cc_binary targets
  • Why

    cc_common.link defaults link_deps_statically to true. Rust targets therefore selected the static C++ runtime even under fully dynamic linking.

    Impact

    Rust targets using cc_common.link now select the dynamic C++ runtime when built with --dynamic_mode=fully, matching cc_binary behavior.

    Validation

    $bazel test //...
    ...
    Executed 578 out of 608 tests: 578 tests pass and 30 were skipped.
    

    This is a follow-up to 226c4886e9243e9b6045ce4adb7e6c1bb6a4ab07

    Diff: 179 lines (+171 / -8) across 5 files Reviewer: krasimirgg Review duration: 76534m
    All Vouch review confidence checks passed
    Residual risk 0.16 = Change Risk (0.47) × (1 − Review Confidence (0.66)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 179 lines diff across 5 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.35 · 1 substantive comment(s)
    0.35
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    65%
    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.311
    Real PR Conversation Timeline
    2 items
    krasimirgg krasimirgg requested changes on Sep 29, 2026 10:26 UTC
    Changes Requested Reviewer

    Hey, thank you, this is very nice!

    I think there may be a couple of other stray places where we need to plumb these cc-std-dylibs for this setup to work. Could you add a toy example like a rust_binary that depends on a cc_library that exercises the C++ stdlib, and a test that runs the rust_binary under --dynamic_mode=fully (e.g., via a user-defined transition), ensuring that it succeeds at runtime (so the necessary cc-std-dylibs are appropriately made available to the rust binary at dynamic-link-time? -- and if that setup doesn't match your intended real use case please let me know :)

    Reviewers
    Assignees
    KirillTim KirillTim
    Labels
    risk: low confidence: 65.5% 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: 46.9% (MEDIUM) · Higher = larger blast radius
    46.9%
    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: 65.5% · Lower = rushed or shallow review
    65.5%
    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: 16.2% · Safe to merge
    16.2%