build(bazel): make the Windows build and tests fit MAX_PATH #3948
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3948"
general
weight: 0.35
Alexandr-Solovev
Description
Six small changes that together make the Bazel build and tests pass on Windows under a long output base, where MSVC
cl.exe,lib.exeandlink.exeand Bazel's own test wrapper hitMAX_PATH(260 characters) whateverLongPathsEnabledsays. They are combined here so that one Windows CI run validates the whole set; they replace #3943, #3944 and #3945.1. Short object paths at compile time (
dev/bazel/cc/compile.bzl,dev/bazel/cc.bzl). Bazel names every object after its source,bazel-out/<config>/bin/<package>/_objs/<target>[_<fpt>_<cpu>]/<source basename>.obj, plus.paramsfor the compiler's response file; the longest is 139 characters underbin, so with a CI output base of about 120 characters the compile ofcoordinate_descent,cross_entropy_lossor the decision forest kernels fails beforelib.exeis reached (D8022 cannot open '...obj.params',LNK1181). The makefile never has this problem because it keeps all objects of a library in one flat directory named after the source basename only. This does the equivalent for Bazel, where the package directory is fixed. On Windowscc_modulefirst bounds the longest object path a target would get with its real names; a target that fits keeps them, which on a forced Linux run is 392 of the 676 oneAPI objects and 58 of the 1552 DAAL objects. A target that does not fit compiles a one-line stand-in per source,_s/<short>/<n>.cpp, that includes the real source by its exec-root path, and names the per-fpt and per-cpu compile callsf/dand0..n. The object path becomes<package>/_objs/<short>[_<f|d>_<n>]/<n>.obj, at most 87 characters underbin, and analysis fails with the offending label if any object would still exceed 95 with.params. The real source is a declared input of its own compile call, so edits rebuild exactly as before; because the compiler resolves quote includes,__FILE__and diagnostics against the including file, same-directory includes keep working and errors still point at the real file and line. Nothing changes on Linux and macOS.2. lld-link next to icx (
dev/bazel/toolchains/cc_toolchain_win.bzl). oneAPI keepslld-link.exeandllvm-lib.exeinbin\compiler, offPATH, sowhich()missed them and the icx toolchain fell back to MSVClink.exeandlib.exe. One_find_llvm_toolhelper now looks next to the compiler for both, as #3941 did forllvm-libalone.3. Graph tests named like the other oneAPI tests (ten renames, no content change). The main test of an algorithm is
test/batch.cppand the argument checkstest/badarg.cpp; the graph tests carried a redundant<name>_test.cppsuffix. The test target is derived from the file name, so for example:test_connected_components_test_hostbecomes:test_batch_host. On Windows this also matters for the test wrapper, which validates<bin>\<pkg>\<test>.exe.runfiles\MANIFESTwithout long-path support:connected_componentsandsubgraph_isomorphismreached 261 characters and failed to start (CreateProcessW ... error: 3); after the rename they are 241.4. Two Windows runtime failures skipped (
dal_test_suitegets anot_on_windowslist). The graph service functions test crashes at teardown and theshortest_pathsbadargs test dies before printing any test output on Windows, tracked in #3530. Neither failure can be narrowed below the file: one crashes at process exit, the other before the first test runs. The named tests are marked incompatible on Windows, so the suites report them as SKIPPED there and run them everywhere else; naming a file that is not insrcsfails analysis.5. MSVC cl configured for the Visual Studio the shell was set up with (
dev/bazel/toolchains/cc_toolchain_win.bzl,cc_toolchain.bzl,cc_toolchain_win.tpl.BUILD). rules_cc's auto-config takes the newest Visual Studio fromvswhereunlessBAZEL_VC/BAZEL_VSis set; on a runner with VS 2022 and VS 2026 installed, where the job had run VS 2022'svcvarsall.bat, every compile failed withC1083: Cannot open include file: 'vector', because the toolchain had thecl.exeof VS 2026 and the include directories of neither. The cl toolchain is now produced by calling rules_cc'sconfigure_windows_toolchainfrom oneDAL's own toolchain repository withBAZEL_VCdefaulting toVCINSTALLDIR, the variablevcvarsall.batexports; rules_cc's BUILD and the files it references land in themsvcpackage of that repository, soregister_toolchains("//:all")still registers only the root toolchain, which points at//msvc:cc-compiler-x64_windows. With a single Visual Studio, or withBAZEL_VCset, nothing changes.6. Standard-conforming preprocessor under MSVC (
dev/bazel/cc/compile.bzl). MSVC's traditional preprocessor expands__VA_ARGS__as a single token, so the test engine'sCOMBINE_TYPES, which unpacks parenthesized type lists through a variadic helper, fails to parse (C2059,C2947) in every test that uses it.cc_modulepasses/Zc:preprocessorwhen the toolchain compiler ismsvc-cl; icx and clang-cl conform without a switch.7. Catch2 suites that compile under MSVC (three test files). MSVC rejects three constructs that icx and GCC accept. A lambda reads a
constexprlocal without capturing it in the hdbscancluster_utilstest (C3493), andif constexprreads through a by-reference capture in the decision forest fixture (C2131); both locals are nowstatic constexpr.global_context.cppreads the CPU vendor with GCC inline assembly, which MSVC does not have on x64 (C2059); under_MSC_VERit now uses the__cpuidexintrinsic, as DAAL's CPU detection does.8. A Bazel example in the Windows PR workflow (
.github/workflows/ci-win.yml). A new x86_64 job builds with plain MSVCclon a stockwindows-2025runner and runs//examples/oneapi/cpp:kmeans_lloyd_dense_batch_host. MKL and TBB come from the@mkl/@tbbdownloads, so the runner needs no Intel compiler, and Visual Studio is located withvswhere. Bazel runs with--output_user_root=C:\b, like the Azure Bazel lane. The ARM64 clang-cl job runs the same example after its PE checks. Until now, PR CI built Windows Bazel binaries but ran none of them.9. Online SPMD tests built for DPC++ only (four
BUILDfiles). Host SPMD finalize is not implemented, so the basic_statistics, covariance, pca and linear_regression online SPMD tests return atSKIP_IF(is_cpu())on host. Their host binaries still referenced the host SPMD finalize dispatchers: GCC drops those calls at-O2, but MSVClink.exeresolves them and fails withLNK2019. GCC fails the same way at-O0onmain. The four tests now live in a DPC++-only suite, sotest_online_spmd_dpckeeps its name and only the empty host targets are gone.Validation
On Linux:
bazel build --nobuild //cpp/oneapi/dal:tests //:releaseanalyses, andbazel test --config=hoston the graph, connected_components, shortest_paths and subgraph_isomorphism suites runs 8 of 8 tests green under the new names. With the short-path mode forced on for Linux,//cpp/daal:all_staticand//cpp/oneapi/dal:all_staticbuild, the pca, dbscan, decision_forest and threading suites pass,bazel aqueryshows each compile action taking_s/<short>/<n>.cppas its source with the real.cppamong its inputs, and a deliberate error appended todf_classification_model.cppis reported at that file's own path and line.The Windows result comes from the
WindowsBazelCI lanes; the MSVCcllane in particular validates items 5 to 7 and 9, which Linux analysis can only load, not run. Item 8 is checked by its own jobs once public CI runs on this PR.🤖 Generated with Claude Code