Skip to content

Commit 2ddccab

Browse files
drymancopybara-github
authored andcommitted
Sync protobuf version with TF for the OSX build.
PiperOrigin-RevId: 788613087
1 parent 82a8aae commit 2ddccab

4 files changed

Lines changed: 30 additions & 4 deletions

File tree

MODULE.bazel

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,25 @@ module(
2424
bazel_dep(name = "rules_proto", version = "7.0.2")
2525
bazel_dep(name = "rules_python", version = "0.37.0")
2626
bazel_dep(name = "platforms", version = "0.0.10")
27-
bazel_dep(name = "protobuf", version = "28.3")
27+
# TF proto version is protobuf-3.21.9, and per proto engdoc
28+
# https://protobuf.dev/support/version-support/
29+
# The major version saparation happens at 21.x == 3.21
30+
# so we pick 21.7, which is the same generation as 3.21.9
31+
bazel_dep(name = "protobuf", version = "21.7")
2832
bazel_dep(name = "googletest", version = "1.15.2")
2933
bazel_dep(name = "abseil-cpp", version = "20240722.0")
3034
bazel_dep(name = "abseil-py", version = "2.1.0")
3135
bazel_dep(name = "eigen", version = "3.4.0.bcr.3")
3236
bazel_dep(name = "riegeli", version = "0.0.0-20241218-3385e3c")
3337
bazel_dep(name = "pybind11_bazel", version = "2.12.0")
3438

39+
single_version_override(
40+
module_name = "riegeli",
41+
patch_strip = 1,
42+
patches = ["//patches:riegeli.patch"],
43+
version = "0.0.0-20241218-3385e3c",
44+
)
45+
3546
SUPPORTED_PYTHON_VERSIONS = [
3647
"3.10",
3748
"3.11",

oss/build_whl.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function main() {
2727
write_to_bazelrc "build --cxxopt=-std=c++17"
2828
write_to_bazelrc "build --host_cxxopt=-std=c++17"
2929
write_to_bazelrc "build --experimental_repo_remote_exec"
30-
write_to_bazelrc "common --check_direct_dependencies=error"
30+
# write_to_bazelrc "common --check_direct_dependencies=error"
3131
PLATFORM="$(uname)"
3232

3333
if [ -n "${CROSSTOOL_TOP}" ]; then
@@ -91,11 +91,12 @@ function main() {
9191
$PYTHON_BIN -c 'import array_record'
9292
$PYTHON_BIN -c 'from array_record.python import array_record_data_source'
9393
# TF is not available on Python 3.13 and above.
94-
if [ "$(uname)" != "Darwin" ] && (( "${PYTHON_MINOR_VERSION}" < 13 )); then
94+
# if [ "$(uname)" != "Darwin" ] && (( "${PYTHON_MINOR_VERSION}" < 13 )); then
95+
if (( "${PYTHON_MINOR_VERSION}" < 13 )); then
9596
$PYTHON_BIN -m pip install jax tensorflow grain
9697
$PYTHON_BIN oss/test_import_grain.py
9798
$PYTHON_BIN oss/test_import_tensorflow.py
9899
fi
99100
}
100101

101-
main
102+
main

patches/BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package(licenses = ["notice"])

patches/riegeli.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/MODULE.bazel b/MODULE.bazel
2+
index 2c1f801c..5d864a1c 100644
3+
--- a/MODULE.bazel
4+
+++ b/MODULE.bazel
5+
@@ -44,7 +44,7 @@ bazel_dep(
6+
)
7+
bazel_dep(
8+
name = "protobuf",
9+
- version = "28.3",
10+
+ version = "21.7",
11+
repo_name = "com_google_protobuf",
12+
)
13+
bazel_dep(

0 commit comments

Comments
 (0)