diff --git a/MODULE.bazel b/MODULE.bazel index 048f68c..bd9b4eb 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -3,23 +3,27 @@ module( ) # https://registry.bazel.build/modules/abseil-cpp -bazel_dep(name = "abseil-cpp", version = "20250814.1", repo_name = "com_google_absl") +bazel_dep(name = "abseil-cpp", version = "20260107.0", repo_name = "com_google_absl") # https://registry.bazel.build/modules/abseil-py -bazel_dep(name = "abseil-py", version = "2.1.0", repo_name = "com_google_absl_py") +bazel_dep(name = "abseil-py", version = "2.4.0", repo_name = "com_google_absl_py") # https://github.com/bazelbuild/bazel-skylib -bazel_dep(name = "bazel_skylib", version = "1.8.2") +bazel_dep(name = "bazel_skylib", version = "1.9.0") # https://registry.bazel.build/modules/cel-cpp bazel_dep(name = "cel-cpp", version = "0.15.0", repo_name = "com_google_cel_cpp") -single_version_override( +git_override( module_name = "cel-cpp", + commit = "2e6e9ff4493bfbe0baf883107f3fb7ce6f675d88", patch_cmds = [ # ABSL_CONST_INIT is incompatible with MSVC-CL with the /std:c++20 option "sed -i 's/ABSL_CONST_INIT //g' common/values/optional_value.cc", ], - version = "0.15.0", + patch_cmds_win = [ + "python -c \"import sys; path='common/values/optional_value.cc'; content=open(path).read(); open(path,'w').write(content.replace('ABSL_CONST_INIT ',''))\"", + ], + remote = "https://github.com/google/cel-cpp", ) # 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 bazel_dep(name = "platforms", version = "1.0.0") # https://registry.bazel.build/modules/protobuf -bazel_dep(name = "protobuf", version = "33.1", repo_name = "com_google_protobuf") +bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf") # https://registry.bazel.build/modules/pybind11_abseil bazel_dep(name = "pybind11_abseil", version = "202402.0") @@ -41,25 +45,33 @@ bazel_dep(name = "pybind11_abseil", version = "202402.0") bazel_dep(name = "pybind11_bazel", version = "3.0.0") # https://registry.bazel.build/modules/rules_cc -bazel_dep(name = "rules_cc", version = "0.2.14") +bazel_dep(name = "rules_cc", version = "0.2.16") # https://registry.bazel.build/modules/rules_proto bazel_dep(name = "rules_proto", version = "7.1.0") # https://registry.bazel.build/modules/rules_python -bazel_dep(name = "rules_python", version = "1.7.0") +bazel_dep(name = "rules_python", version = "1.9.0") # On Windows the file system is case-insensitive, which creates a collision between # antlr4-cpp-runtime/VERSION and the system `#include ` single_version_override( module_name = "antlr4-cpp-runtime", patch_cmds = [ - "mv VERSION VERSION.txt", + "python -c \"import os; os.rename('VERSION', 'VERSION.txt') if os.path.exists('VERSION') else None\"", ], ) -python_rules = use_extension("@rules_python//python/extensions:python.bzl", "python") -python_rules.toolchain( - is_default = True, - python_version = "3.11", +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.defaults(python_version = "3.11") +python.toolchain(python_version = "3.11") +use_repo(python, "pythons_hub") + +pybind11_internal_configure = use_extension( + "@pybind11_bazel//:internal_configure.bzl", + "internal_configure_extension", ) +use_repo(pybind11_internal_configure, "pybind11") + +local_repo_ext = use_extension("//cel_expr_python:local_repo_extension.bzl", "local_repo_ext") +use_repo(local_repo_ext, "python_headers_custom") diff --git a/local_repo_extension.bzl b/local_repo_extension.bzl new file mode 100644 index 0000000..d72ded0 --- /dev/null +++ b/local_repo_extension.bzl @@ -0,0 +1,34 @@ +def _custom_headers_repo_impl(ctx): + # Resolve label to path + build_file_path = ctx.path(ctx.attr.build_file_label) + repo_dir = build_file_path.dirname + + # Symlink the include directory + ctx.symlink(repo_dir.get_child("include"), "include") + + # Create BUILD file + ctx.file("BUILD.bazel", """ +cc_library( + name = "headers", + hdrs = glob(["include/python3.11/**"]), + includes = ["include/python3.11"], + visibility = ["//visibility:public"], +) +""") + +custom_headers_repo = repository_rule( + implementation = _custom_headers_repo_impl, + attrs = { + "build_file_label": attr.label(mandatory = True), + }, +) + +def _local_repo_extension_impl(ctx): + custom_headers_repo( + name = "python_headers_custom", + build_file_label = "@@rules_python++python+python_3_11_x86_64-unknown-linux-gnu//:BUILD.bazel", + ) + +local_repo_ext = module_extension( + implementation = _local_repo_extension_impl, +) diff --git a/release/kokoro/build_windows.cfg b/release/kokoro/build_windows.cfg deleted file mode 100644 index 7454eac..0000000 --- a/release/kokoro/build_windows.cfg +++ /dev/null @@ -1,9 +0,0 @@ -# proto-file: //devtools/kokoro/config/proto/build.proto -# proto-message: BuildConfig - -build_file: "cel-python/release/kokoro/presubmit_windows.bat" -timeout_mins: 30 - -container_properties { - docker_image: "us-central1-docker.pkg.dev/kokoro-container-bakery/kokoro/windows/windows2019/full@sha256:c9995cdda2206803409164f9682f47e0027b8836076591a960373e3cdb1847e1" -}