← Back to Pull requests

Enable building Windows message tables on Linux hosts too #58987

Closed
unknown closed this pull request without merging on Oct 27, 2026 22:15 UTC
View on GitHub
unknown unknown commented on Oct 27, 2026 10:58 UTC
Author

What does this PR do?


Pick Windows resource compilers through a toolchain resolved per exec platform, so that they cannot disagree and an unsupported exec platform fails analysis:
  • WinLibs' windmc and windres stay on Windows,

  • Wine's wmc and LLVM's windres serve Linux x86_64.
  • Add //:llvm, LLVM's multicall binary, which the Linux toolchain runs as llvm windres and llvm clang.

    Provide the hermetic LLVM C toolchain for Windows targets on Linux hosts too, to archive the resulting objects, WinLibs' remaining the one on Windows hosts.

    Move the rules to //bazel/rules/windows:resources.bzl, next to their toolchains.

    Motivation


    win_messagetable could only build on Windows hosts, so targets linking message tables, like //pkg/util/winutil/messagestrings, couldn't be built from Linux.

    Extending that support to Linux lets CI jobs, like #58906's e2e ones, prepare the Windows test binaries that link them.

    Describe how you validated your changes


  • the 14 win_resource and 2 win_messagetable objects built natively on a Windows VM were byte-identical to main's,

  • both message tables built on Linux held the same resources, and //pkg/util/winutil/messagestrings then built for Windows too.
  • Additional Notes


    LLVM's windres writes .rsrc$01 and .rsrc$02 sections, as cvtres.exe does, but GNU ld only merges input sections named .rsrc.
    Linking such an object next to another resource object therefore either fails, as windows_msi_and_bosh_zip_x64-a7 did on security-agent.exe (https://gitlab.ddbuild.io/DataDog/datadog-agent/-/jobs/2180573019), or silently keeps the first resource tree only.
    => keeping GNU windres on Windows, and Linux-built binaries linking a single resource object, like #58906's test binaries.

    Diff: 225 lines (+168 / -57) across 2 files Reviewer: dd-gplassard Review duration: 677m
    All Vouch review confidence checks passed
    Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 225 lines diff across 2 files
    0.37
    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.324
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #58987"
    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: 36.9% (MEDIUM) · Higher = larger blast radius
    36.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: 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.6% · Safe to merge
    14.6%