← Back to Pull requests

fix(bazel): keep the CRLF lines of the stamped Windows version header and load bazel_features for the MSVC toolchain #4017

Closed
unknown closed this pull request without merging on Nov 12, 2026 21:39 UTC
View on GitHub
unknown unknown commented on Nov 12, 2026 19:28 UTC
Author

Description

Stamped builds (--config=release-dpc) fill in the build date of the version headers with sed in a run_shell action (expand_build_date, #3962). On Windows that sed is the MSYS one, which reads in text mode and drops every CR, including the ones _copy_version_header puts on the seven version #define lines to match Make. So the Make and Bazel Windows releases differ in line endings only:

! include/services/library_version_info.h Make=2768B Bazel=2761B EOL Make(crlf=7,lf=80,cr=0) Bazel(crlf=0,lf=87,cr=0) (line endings only)

That is the only difference, and it fails the release compare step of Nightly-test / oneDAL Windows Bazel test on main since #3962 (scheduled run at c3e296509) and on every pull request that runs Nightly-test, for example #3979.

The stamping sed now runs with -b, which keeps the CRs. GNU sed accepts -b on every platform and changes nothing where there is no text mode, so Linux output is byte-identical (a stamped --config=release-dpc build of //cpp/daal:version writes the same file), and unstamped builds still use expand_template. No OS check or parameter is needed.

MSVC toolchain on rules_cc 0.2.28

WindowsBazel_MKL(AVX2)-MSVC-GitHub hosted fails on main since the rules_cc 0.2.28 bump (#4003):

ERROR: error loading package '@@+cc_toolchain_extension+onedal_cc_toolchain//msvc': at .../msvc/windows_cc_toolchain_config.bzl:16:6: Unable to find package for @@[unknown repo 'bazel_features' ...

rules_cc 0.2.28 loads @bazel_features in the windows_cc_toolchain_config.bzl it generates for cl. Our cc toolchain extension writes that file into its own repository, which sees only the root module's dependencies, so the root MODULE.bazel now has bazel_dep(name = "bazel_features", version = "1.50.0"), the version rules_cc 0.2.28 requires. The module graph and MODULE.bazel.lock do not change. Only the cl lane uses that file; the icx and clang-cl toolchains have their own config.

Testing

  • Linux: a stamped build (--config=release-dpc) of the DAAL version header runs sed -b and writes the date as before.

  • printf 'a\r\n#define D @ONEDAL_BUILD_DATE@\r\nb\n' | sed -b ... keeps both CRs.

  • Linux: @bazel_features//:features.bzl resolves from the root module, //:release and //:release_all analyse, and //examples/oneapi/cpp:kmeans_lloyd_dense_batch_host (the MSVC lane's test) passes.

  • Windows: covered by Nightly-test / oneDAL Windows Bazel test (release compare) and WindowsBazel_MKL(AVX2)-MSVC-GitHub hosted on this PR; both fail on main without these changes.
  • ---

    <details>
    <summary>Checklist:</summary>

    Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.

  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary. (not applicable)

  • Git commit message contains an appropriate signed-off-by string _(see CONTRIBUTING.md for details)_.

  • I have resolved any merge conflicts that might occur with the base branch.
  • Testing

  • I have run it locally and tested the changes extensively.

  • All CI jobs are green or I have provided justification why they aren't: the Windows release compare is the test; see above.

  • I have extended testing suite if new functionality was introduced in this PR. (no new functionality; the existing release compare covers it)
  • Performance

  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected: build rules only.
  • </details>

    🤖 Generated with Claude Code

    Diff: 476 lines (+357 / -119) across 5 files Reviewer: ethanglaser Review duration: 130m
    All Vouch review confidence checks passed
    Residual risk 0.18 = Change Risk (0.46) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.46 · 476 lines diff across 5 files
    0.46
    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.369
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #4017"
    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: 45.8% (MEDIUM) · Higher = larger blast radius
    45.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: 18.1% · Safe to merge
    18.1%