-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bazel: Enable hybrid mode for Bzlmod migration
See https://bazel.build/versions/7.4.0/external/migration#hybrid-mode. PiperOrigin-RevId: 692951204 Change-Id: Idf1680e4db98fa4668f4512e136c928e68514b67
- Loading branch information
1 parent
a46325a
commit bcd2876
Showing
7 changed files
with
3,967 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
# Migration to Bzlmod is not ready yet, waiting for Protobuf to release 27.0 | ||
common --noenable_bzlmod | ||
# Enable Bazel modules by default. Projects using Sandboxed API may still use | ||
# a regular WORKSPACE ("Hybrid Mode"). | ||
common --enable_bzlmod | ||
|
||
# Build in C++17 mode without a custom CROSSTOOL | ||
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
module( | ||
name = "com_google_sandboxed_api", | ||
version = "20241101.0", | ||
bazel_compatibility = [">=7.1.1"], | ||
) | ||
|
||
bazel_dep( | ||
name = "abseil-cpp", | ||
version = "20240722.0", | ||
repo_name = "com_google_absl", | ||
) | ||
bazel_dep( | ||
name = "abseil-py", | ||
version = "2.1.0", | ||
repo_name = "com_google_absl_py", | ||
) | ||
bazel_dep(name = "bazel_skylib", version = "1.7.1") | ||
bazel_dep( | ||
name = "google_benchmark", | ||
version = "1.8.5", | ||
repo_name = "com_google_benchmark", | ||
) | ||
bazel_dep( | ||
name = "googletest", | ||
version = "1.15.2", | ||
repo_name = "com_google_googletest", | ||
) | ||
bazel_dep( | ||
name = "protobuf", | ||
version = "28.2", | ||
repo_name = "com_google_protobuf", | ||
) | ||
bazel_dep(name = "rules_proto", version = "6.0.2") | ||
bazel_dep(name = "rules_python", version = "0.37.2") |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Copyright 2024 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Workspace definition used when Bzlmod is enabled | ||
workspace(name = "com_google_sandboxed_api") | ||
|
||
load("@bazel_skylib//lib:versions.bzl", "versions") | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
load("//sandboxed_api/bazel:sapi_deps.bzl", "sapi_non_module_deps") | ||
|
||
versions.check(minimum_bazel_version = "7.1.1") | ||
|
||
sapi_non_module_deps() | ||
|
||
load( | ||
"//sandboxed_api/bazel:llvm_config.bzl", | ||
"llvm_disable_optional_support_deps", | ||
) | ||
|
||
llvm_disable_optional_support_deps() | ||
|
||
# zlib, only needed for examples | ||
http_archive( | ||
name = "net_zlib", | ||
build_file = "//sandboxed_api:bazel/external/zlib.BUILD", | ||
patch_args = ["-p1"], | ||
# This is a patch that removes the "OF" macro that is used in zlib function | ||
# definitions. It is necessary, because libclang, the library used by the | ||
# interface generator to parse C/C++ files contains a bug that manifests | ||
# itself with macros like this. | ||
# We are investigating better ways to avoid this issue. For most "normal" | ||
# C and C++ headers, parsing just works. | ||
patches = ["//sandboxed_api:bazel/external/zlib.patch"], | ||
sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1", # 2020-04-23 | ||
strip_prefix = "zlib-1.2.11", | ||
urls = [ | ||
"https://mirror.bazel.build/zlib.net/zlib-1.2.11.tar.gz", | ||
"https://www.zlib.net/zlib-1.2.11.tar.gz", | ||
], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters