Skip to content

Commit 0595347

Browse files
committed
refactor: remove non-functional cc toolchain
Rust depends on having one that works. We can find a more surgical way to prevent protoc cc_binary from getting built.
1 parent 52e6977 commit 0595347

File tree

2 files changed

+2
-73
lines changed

2 files changed

+2
-73
lines changed
Lines changed: 2 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
1-
"""Define a non-functional cc toolchain.
2-
3-
To fail-fast in cases where we are forced to compile third-party C++ code,
4-
define a cc toolchain that doesn't work, by using 'false' as the compiler.
5-
See https://bazel.build/tutorials/ccp-toolchain-config
6-
"""
7-
81
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain")
9-
load("@rules_rust//rust:defs.bzl", "rust_library_group")
102
load("@rules_rust_prost//:defs.bzl", "rust_prost_toolchain")
11-
load("defs.bzl", "cc_toolchain_config")
123

134
# Configure protoc to have the right arguments for generating Python stubs.
145
# NB: the protobuf team intends to remove --python_out and instead use a protoc plugin for Python stub emit.
@@ -29,59 +20,17 @@ proto_lang_toolchain(
2920
toolchain_type = "@rules_java//java/proto:toolchain_type",
3021
)
3122

32-
rust_library_group(
33-
name = "prost_runtime",
34-
deps = [
35-
"@crates//:prost",
36-
],
37-
)
38-
39-
rust_library_group(
40-
name = "tonic_runtime",
41-
deps = [
42-
":prost_runtime",
43-
"@crates//:tonic",
44-
],
45-
)
46-
4723
rust_prost_toolchain(
4824
name = "prost_toolchain_impl",
4925
prost_plugin = "@crates//:protoc-gen-prost__protoc-gen-prost",
50-
prost_runtime = ":prost_runtime",
26+
prost_runtime = "//rust:prost_runtime",
5127
prost_types = "@crates//:prost-types",
5228
tonic_plugin = "@crates//:protoc-gen-tonic__protoc-gen-tonic",
53-
tonic_runtime = ":tonic_runtime",
29+
tonic_runtime = "//rust:tonic_runtime",
5430
)
5531

5632
toolchain(
5733
name = "prost_toolchain",
5834
toolchain = "prost_toolchain_impl",
5935
toolchain_type = "@rules_rust_prost//:toolchain_type",
6036
)
61-
62-
################
63-
# Setup a non-functional C++ toolchain, so we're assured that no C++ compilation
64-
# will be expected for engineers working in our repo.
65-
# That's the critical guarantee of toolchains_protoc
66-
filegroup(name = "empty")
67-
68-
cc_toolchain_config(name = "noop_toolchain_config")
69-
70-
cc_toolchain(
71-
name = "noop_toolchain",
72-
all_files = ":empty",
73-
compiler_files = ":empty",
74-
dwp_files = ":empty",
75-
linker_files = ":empty",
76-
objcopy_files = ":empty",
77-
strip_files = ":empty",
78-
supports_param_files = 0,
79-
toolchain_config = ":noop_toolchain_config",
80-
toolchain_identifier = "noop-toolchain",
81-
)
82-
83-
# toolchain(
84-
# name = "cc_toolchain",
85-
# toolchain = ":noop_toolchain",
86-
# toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
87-
# )

examples/tools/toolchains/defs.bzl

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)