Skip to content

Commit 9a303bb

Browse files
dmitriplotnikovcopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 917337474
1 parent 533aff4 commit 9a303bb

7 files changed

Lines changed: 624 additions & 14 deletions

File tree

.bazelrc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,25 @@ build --incompatible_default_to_explicit_init_py
99

1010
# MSVC: Use the C++20 standard in order to support C++20 features that were introduced in clang and gcc
1111
build:windows --copt="/std:c++20" --cxxopt="/std:c++20"
12+
# MSVC: Corrects the __cplusplus macro to report the true standard
13+
build:windows --copt="/Zc:__cplusplus" --cxxopt="/Zc:__cplusplus"
1214
# MSVC: Enable modern standards-compatible preprocessor
1315
build:windows --cxxopt="/Zc:preprocessor" --host_cxxopt="/Zc:preprocessor"
1416
# MSVC: Link ANTLR statically to avoid Windows DLL linking errors
1517
build:windows --cxxopt="-DANTLR4CPP_STATIC" --host_cxxopt="-DANTLR4CPP_STATIC"
18+
19+
# Repo environment bypasses for corporate proxy (Windows-only)
20+
common:windows --repo_env=no_proxy=bcr.bazel.build,bazel.build,storage.googleapis.com,*.googleapis.com,metadata.google.internal,169.254.169.254
21+
common:windows --repo_env=NO_PROXY=bcr.bazel.build,bazel.build,storage.googleapis.com,*.googleapis.com,metadata.google.internal,169.254.169.254
22+
23+
# Downloader attempts and retries for BCR network stability (Windows-only)
24+
common:windows --http_connector_attempts=10
25+
common:windows --experimental_repository_downloader_retries=10
26+
27+
# Build verbosity and output options (Windows-only)
28+
build:windows --verbose_failures
29+
test:windows --test_output=errors
30+
31+
# GCS remote caching config (Windows-only, active by default on Windows!)
32+
build:windows --remote_cache=https://storage.googleapis.com/windows-cel-python-remote-cache
33+
build:windows --google_default_credentials=true

MODULE.bazel

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@ module(
33
)
44

55
# https://registry.bazel.build/modules/abseil-cpp
6-
bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl")
6+
bazel_dep(name = "abseil-cpp", version = "20260107.0", repo_name = "com_google_absl")
77

88
# https://registry.bazel.build/modules/abseil-py
9-
bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "com_google_absl_py")
9+
bazel_dep(name = "abseil-py", version = "2.4.0", repo_name = "com_google_absl_py")
1010

1111
# https://github.com/bazelbuild/bazel-skylib
12-
bazel_dep(name = "bazel_skylib", version = "1.8.2")
12+
bazel_dep(name = "bazel_skylib", version = "1.9.0")
1313

1414
# https://registry.bazel.build/modules/cel-cpp
1515
bazel_dep(name = "cel-cpp", version = "0.15.0", repo_name = "com_google_cel_cpp")
16-
single_version_override(
16+
git_override(
1717
module_name = "cel-cpp",
18+
commit = "2e6e9ff4493bfbe0baf883107f3fb7ce6f675d88",
1819
patch_cmds = [
1920
# ABSL_CONST_INIT is incompatible with MSVC-CL with the /std:c++20 option
2021
"sed -i 's/ABSL_CONST_INIT //g' common/values/optional_value.cc",
2122
],
22-
version = "0.15.0",
23+
patch_cmds_win = [
24+
"python -c \"import sys; path='common/values/optional_value.cc'; content=open(path).read(); open(path,'w').write(content.replace('ABSL_CONST_INIT ',''))\"",
25+
],
26+
remote = "https://github.com/google/cel-cpp",
2327
)
2428

2529
# https://registry.bazel.build/modules/cel-spec
@@ -32,7 +36,7 @@ bazel_dep(name = "googletest", version = "1.17.0.bcr.2", repo_name = "com_google
3236
bazel_dep(name = "platforms", version = "1.0.0")
3337

3438
# https://registry.bazel.build/modules/protobuf
35-
bazel_dep(name = "protobuf", version = "33.1", repo_name = "com_google_protobuf")
39+
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")
3640

3741
# https://registry.bazel.build/modules/pybind11_abseil
3842
bazel_dep(name = "pybind11_abseil", version = "202402.0")
@@ -41,25 +45,42 @@ bazel_dep(name = "pybind11_abseil", version = "202402.0")
4145
bazel_dep(name = "pybind11_bazel", version = "3.0.0")
4246

4347
# https://registry.bazel.build/modules/rules_cc
44-
bazel_dep(name = "rules_cc", version = "0.2.14")
48+
bazel_dep(name = "rules_cc", version = "0.2.16")
4549

4650
# https://registry.bazel.build/modules/rules_proto
4751
bazel_dep(name = "rules_proto", version = "7.1.0")
4852

4953
# https://registry.bazel.build/modules/rules_python
50-
bazel_dep(name = "rules_python", version = "1.7.0")
54+
bazel_dep(name = "rules_python", version = "1.9.0")
5155

5256
# On Windows the file system is case-insensitive, which creates a collision between
5357
# antlr4-cpp-runtime/VERSION and the system `#include <version>`
5458
single_version_override(
5559
module_name = "antlr4-cpp-runtime",
5660
patch_cmds = [
57-
"mv VERSION VERSION.txt",
61+
"python -c \"import os; os.rename('VERSION', 'VERSION.txt') if os.path.exists('VERSION') else None\"",
62+
"python -c \"import os; os.rename('version', 'version.txt') if os.path.exists('version') else None\"",
5863
],
5964
)
6065

61-
python_rules = use_extension("@rules_python//python/extensions:python.bzl", "python")
62-
python_rules.toolchain(
63-
is_default = True,
64-
python_version = "3.11",
66+
# Configure rules_python's hermetic toolchains to resolve external
67+
# dependencies natively. Under Windows, compiling pybind C++ extensions
68+
# against Python 3.11 headers requires that the execution environment
69+
# also runs under the hermetic Python 3.11 interpreter (python.exe).
70+
#
71+
# By calling register_toolchains("@pythons_hub//:all"), we register the
72+
# hermetic toolchain globally in the Bzlmod resolution chain. This forces
73+
# 'bazel test' to run all sandboxed test targets under the hermetic
74+
# python.exe interpreter.
75+
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
76+
python.defaults(python_version = "3.11")
77+
python.toolchain(python_version = "3.11")
78+
use_repo(python, "pythons_hub")
79+
80+
register_toolchains("@pythons_hub//:all")
81+
82+
pybind11_internal_configure = use_extension(
83+
"@pybind11_bazel//:internal_configure.bzl",
84+
"internal_configure_extension",
6585
)
86+
use_repo(pybind11_internal_configure, "pybind11")

0 commit comments

Comments
 (0)