Skip to content

Commit ab37629

Browse files
committed
[NO TESTS] WIP
1 parent 671b3d9 commit ab37629

File tree

3 files changed

+32
-11
lines changed

3 files changed

+32
-11
lines changed

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ build --define=SOME_VAR=SOME_VALUE
1212

1313
common --features=-libtool
1414
common --incompatible_enable_cc_toolchain_resolution
15+
16+
# Use prebuilt protoc
17+
common --incompatible_enable_proto_toolchain_resolution
1518
common --per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
1619
common --host_per_file_copt=external/.*protobuf.*@--PROTOBUF_WAS_NOT_SUPPOSED_TO_BE_BUILT
20+
common --per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
21+
common --host_per_file_copt=external/.*grpc.*@--GRPC_WAS_NOT_SUPPOSED_TO_BE_BUILT
1722

1823
# Use local rules_python
1924
# Enable with --config=dev

MODULE.bazel

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ bazel_dep(name = "rules_python", version = "1.0.0")
2424
bazel_dep(name = "rules_python_gazelle_plugin", version = "1.0.0", dev_dependency = True)
2525
bazel_dep(name = "toolchains_musl", version = "0.1.20", dev_dependency = True)
2626
bazel_dep(name = "toolchains_llvm", version = "1.4.0", dev_dependency = True)
27+
bazel_dep(name = "toolchains_protoc", version = "0.4.3", dev_dependency = True)
2728

2829
single_version_override(
2930
module_name = "rules_python",
@@ -34,19 +35,15 @@ single_version_override(
3435
version = "1.0.0",
3536
)
3637

37-
# single_version_override(
38-
# module_name = "toolchains_llvm",
39-
# version = "0.10.3",
40-
# patches = [
41-
# "//third_party/com.github/bazel-contrib/toolchains_llvm:clang_ldd.patch",
42-
# ],
43-
# )
44-
4538
bazel_lib = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")
4639
bazel_lib.expand_template()
4740
bazel_lib.tar()
4841
use_repo(bazel_lib, "bsd_tar_toolchains")
4942

43+
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
44+
use_repo(protoc, "toolchains_protoc_hub")
45+
register_toolchains("@toolchains_protoc_hub//:all")
46+
5047
# Custom python version for testing only
5148
python = use_extension("@rules_python//python/extensions:python.bzl", "python", dev_dependency = True)
5249
python.toolchain(

tools/release/fetch.bzl

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,39 @@
22

33
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
44

5+
SYSROOT_LINUX_BUILD_FILE = """
6+
filegroup(
7+
name = "sysroot",
8+
srcs = glob(["*/**"]),
9+
visibility = ["//visibility:public"],
10+
)
11+
"""
12+
13+
SYSROOT_DARWIN_BUILD_FILE = """
14+
filegroup(
15+
name = "sysroot",
16+
srcs = glob(
17+
include = ["**"],
18+
exclude = ["**/*:*"],
19+
),
20+
visibility = ["//visibility:public"],
21+
)
22+
"""
23+
524
def _release_tools_impl(_module_ctx):
625
"""Fetch dependencies only needed for release builds used for the legacy WORKSPACE support."""
726

827
# FIXME: Replace this with the BCR release
928
http_archive(
1029
name = "org_chromium_sysroot_linux_arm64",
11-
build_file_content = _SYSROOT_LINUX_BUILD_FILE,
30+
build_file_content = SYSROOT_LINUX_BUILD_FILE,
1231
sha256 = "b199942a0bd9c34800e8d7b669778ef45f2054b9f106039439383dd66efcef31",
1332
urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_arm64_sysroot.tar.xz"],
1433
)
1534

1635
http_archive(
1736
name = "org_chromium_sysroot_linux_x86_64",
18-
build_file_content = _SYSROOT_LINUX_BUILD_FILE,
37+
build_file_content = SYSROOT_LINUX_BUILD_FILE,
1938
sha256 = "b279dd2926e7d3860bb4e134997a45df5106f680e160a959b945580ba4ec755f",
2039
urls = ["https://github.com/DavidZbarsky-at/sysroot-min/releases/download/v0.0.20/debian_bullseye_amd64_sysroot.tar.xz"],
2140
)
@@ -28,7 +47,7 @@ def _release_tools_impl(_module_ctx):
2847

2948
http_archive(
3049
name = "sysroot_darwin_universal",
31-
build_file_content = _SYSROOT_DARWIN_BUILD_FILE,
50+
build_file_content = SYSROOT_DARWIN_BUILD_FILE,
3251
sha256 = "11870a4a3d382b78349861081264921bb883440a7e0b3dd4a007373d87324a38",
3352
strip_prefix = "sdk-macos-11.3-ccbaae84cc39469a6792108b24480a4806e09d59/root",
3453
urls = ["https://github.com/hexops-graveyard/sdk-macos-11.3/archive/ccbaae84cc39469a6792108b24480a4806e09d59.tar.gz"],

0 commit comments

Comments
 (0)