← Back to Pull requests

[cmake] Add clang resource dir and extra interpreter args into library #1119

Closed
unknown closed this pull request without merging on Sep 29, 2026 15:11 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 11:02 UTC
Author

MakeResourcesPath() derives the clang builtin-header location from LLVM_BINARY_DIR at runtime, which misses wherever clang's headers are installed under a different prefix than LLVM's libraries (e.g. NixOS), leaving a probe for a clang on PATH as the only fallback.

  • CPPINTEROP_CLANG_RESOURCE_DIR: cache override for the resource directory; when empty, detected at configure time by asking the clang this build links against (clang -print-resource-dir). The detected value stays local so it cannot outlive a reconfigure against a different Clang_DIR. MakeResourcesPath() prefers the compiled-in directory when it still exists at runtime.

  • CPPINTEROP_BAKED_INTERPRETER_ARGS: space-separated arguments appended to every CreateInterpreter() call, after the embedder's arguments and before CPPINTEROP_EXTRA_INTERPRETER_ARGS, letting a packager record toolchain header paths the in-process clang cannot probe for. Arguments are split on spaces with no quoting, so arguments containing spaces are not supported.
  • Both values are delivered through a configure_file-generated header (BakedArgs.h) rather than -D definitions, escaping exactly once for the C string literal. An earlier -D-based variant required double escaping to compensate for the extra shell unescape layer and still corrupted literal backslashes (n -> n/2 round-trip on POSIX); empirically verified with a compile-time check that backslashes, quotes, spaces, and ';' now survive exactly.

    Diff: 182 lines (+136 / -46) across 2 files Reviewer: vgvassilev Review duration: 3129m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.36) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.36 · 182 lines diff across 2 files
    0.36
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    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.312
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #1119"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.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: 35.6% (MEDIUM) · Higher = larger blast radius
    35.6%
    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: 60.5% · Lower = rushed or shallow review
    60.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: 14.1% · Safe to merge
    14.1%