← Back to Pull requests

go-pathrs: fix build failure with Clang #410

Closed
unknown closed this pull request without merging on Sep 04, 2026 17:21 UTC
View on GitHub
unknown unknown commented on Aug 25, 2026 11:23 UTC
Author

The PATHRS_PROC_* values are defined in <pathrs.h> as an enum with values that are too large to fit in an int, and CGo's interpretation of their signedness turns out to be compiler-dependent: GCC hands them to us as implicitly-converted (negative) signed constants, while Clang gives us the actual unsigned values. Our sanity check in init() only handled the GCC behaviour (by assigning them to an int64), so builds using Clang failed with

  libpathrs_linux.go:256:32: cannot use (_Ciconst_PATHRS_PROC_ROOT)
    (untyped int constant 18446744067006164835) as int64 value in variable
    declaration (overflows)

Neither int64 nor uint64 can hold the constant with both compilers. However, Go constant expressions are arbitrary-precision and bitwise operations on negative constants operate on their infinite two's complement representation, so masking off the low 64 bits gives us the same uint64 value regardless of which compiler CGo used.

Note that this only affected the internal cross-check of the values (the constants themselves are open-coded on the Go side), so no user-visible behaviour changes -- but the package could not be built at all with Clang.

Also add a CC={gcc,clang} dimension to the Go smoke-test matrix so this doesn't regress. CC is only set for the smoke-test step so that we don't change how libpathrs itself is built.

Fixes #401

Assisted-by: Claude Opus 5

  • - -
  • Tested with gcc 15.2.0 and clang 21.1.8 (Ubuntu 26.04, go 1.26.7) locally.

    Diff: 188 lines (+141 / -47) across 2 files Reviewer: cyphar Review duration: 14758m
    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 · 188 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.314
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #410"
    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.8% (MEDIUM) · Higher = larger blast radius
    35.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: 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%