Skip to content

Commit 21f5dad

Browse files
committed
Merge remote-tracking branch 'origin/main' into jsgette/fix-windows-cpython-install-runfiles
2 parents 4f731c0 + 0234273 commit 21f5dad

26 files changed

Lines changed: 506 additions & 329 deletions

File tree

.bazelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ common:windows --repo_env=PIP_CACHE_DIR # https://pip.pypa.io/en/stable/topics/c
8181
common:windows --repo_env=SYSTEMDRIVE # needed by vswhere to locate the VS installer instance database
8282
common:windows --repo_env=SYSTEMROOT # used by COM to load system DLLs, needed by vswhere
8383
common:windows --repo_env=USERPROFILE # used by MSYS2 bash to emulate HOME, needed by git to fetch repositories
84-
common:windows --repo_env=VSTUDIO_ROOT # visual_studio(path_variable) in MODULE.bazel; MSBuild-only
8584
common:windows --run_env=__COMPAT_LAYER=RunAsInvoker # install*.exe may otherwise fail claiming unneeded admin elevation
8685
common:windows --test_env=__COMPAT_LAYER=RunAsInvoker # same, for bazel test
8786
common:windows --shell_executable=C:/tools/msys64/usr/bin/bash.exe

MODULE.bazel

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ register_toolchains(
218218
dev_dependency = True,
219219
)
220220

221-
visual_studio = use_repo_rule("//bazel/rules:visual_studio.bzl", "visual_studio")
222-
223221
######################################
224222
## LLVM BPF toolchain for eBPF ##
225223
####################################
@@ -378,8 +376,9 @@ winlibs_mingw_repository(
378376
url = "https://github.com/brechtsanders/winlibs_mingw/releases/download/14.2.0posix-19.1.7-12.0.0-msvcrt-r3/winlibs-x86_64-posix-seh-gcc-14.2.0-mingw-w64msvcrt-12.0.0-r3.zip",
379377
)
380378

381-
# Hermetic MSVC + Windows SDK for rules_cc (cl/link), and MSBuild for CPython
382-
# (see deps/cpython/build_python.bat). MinGW stays the default Windows cc_toolchain.
379+
# Hermetic MSVC + Windows SDK + MSBuild for CPython and DatadogInterop
380+
# (see deps/cpython/build_python.bat, tools/windows/DatadogInterop). MinGW stays
381+
# the default Windows cc_toolchain.
383382
msvc_toolchain = use_extension("@toolchains_msvc//:extensions.bzl", "toolchain")
384383
msvc_toolchain.toolchain_set(
385384
name = "default",
@@ -402,13 +401,6 @@ register_toolchains(
402401
"@llvm_toolchain//:all", # last to avoid taking precedence over GCC toolchains
403402
)
404403

405-
# Host MSBuild for the DatadogInterop vcxproj only; CPython uses the hermetic
406-
# @msvc_toolchains//msbuild instead.
407-
visual_studio(
408-
name = "visual_studio",
409-
path_variable = "VSTUDIO_ROOT",
410-
)
411-
412404
# =========================================
413405
# Python dependencies
414406
# =========================================

bazel/AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,6 +892,14 @@ over constructing paths under `*.runfiles`.
892892
**No sandbox.** Windows uses `--strategy=standalone`. Builds are less hermetic by default — undeclared dependencies that
893893
happen to be present locally will succeed locally and fail in CI or RBE.
894894

895+
**Hermetic MSVC / MSBuild.** MinGW is the default Windows `cc_toolchain`. Hermetic `cl.exe`,
896+
Windows SDK, and MSBuild come from `@msvc_toolchains` (staged by
897+
`bazel/patches/toolchains_msvc/`). Drive MSVC-only sources (C++/WinRT, etc.) with
898+
`run_binary` + hermetic MSBuild — see `tools/windows/DatadogInterop/BUILD.bazel` and
899+
`deps/cpython.BUILD.bazel` (`python_win`) — so the rest of the Windows tree stays on MinGW.
900+
Only do this for a library the Go side loads over a C ABI: MSVC and MinGW objects must not
901+
be linked into the same binary.
902+
895903
**Path separators.** Bazel stores paths with `/` internally. When constructing command lines or environment variables
896904
for actions, replace `/` with `\` for Windows tools that don't accept forward slashes:
897905

bazel/rules/visual_studio.bzl

Lines changed: 0 additions & 119 deletions
This file was deleted.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ tar_md5sums = rule(
2121
mandatory = True,
2222
),
2323
"_tool": attr.label(
24-
default = "//tools/tar_checksums:tar_checksums",
24+
default = "//bazel/tools/tar_checksums:tar_checksums",
2525
executable = True,
2626
cfg = "exec",
2727
),
File renamed without changes.

tools/tar_checksums/testdata/expected_checksums.txt renamed to bazel/tools/tar_checksums/testdata/expected_checksums.txt

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)