Skip to content

Commit d74c6ac

Browse files
authored
bring back llvm @17 since 19 is gigantic (download too slow) (#472)
* bring back llvm @17 since 19 is gigantic (download too slow) * turn on mongoose again * add example grpc * ynot
1 parent 61fbb7c commit d74c6ac

File tree

9 files changed

+290
-169
lines changed

9 files changed

+290
-169
lines changed

MODULE.bazel

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ module(
33
version = "1.0",
44
)
55

6-
####### PROTOBUF ##########
7-
#bazel_dep(name = "toolchains_protoc", version = "0.3.6")
8-
#
9-
#protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
10-
#
11-
#protoc.toolchain(
12-
# google_protobuf = "com_google_protobuf",
13-
# version = "v29.0-rc3",
14-
#)
15-
#
16-
#use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")
6+
####### LLVM ##########
7+
bazel_dep(name = "toolchains_llvm", version = "1.2.0")
8+
9+
# Configure and register the toolchain.
10+
llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm")
11+
llvm.toolchain(
12+
llvm_version = "17.0.6",
13+
)
14+
use_repo(llvm, "llvm_toolchain")
15+
# use_repo(llvm, "llvm_toolchain_llvm") # if you depend on specific tools in scripts
16+
17+
register_toolchains("@llvm_toolchain//:all")
1718

1819
bazel_dep(name = "rules_python", version = "1.0.0")
1920
bazel_dep(name = "rules_proto", version = "7.1.0")
@@ -110,8 +111,8 @@ use_repo(
110111
"org_golang_google_grpc",
111112
)
112113

113-
#non_module_deps = use_extension("//bazel:extensions.bzl", "non_module_deps")
114-
#use_repo(non_module_deps, "mongoose_cc")
114+
non_module_deps = use_extension("//bazel:extensions.bzl", "non_module_deps")
115+
use_repo(non_module_deps, "mongoose_cc")
115116

116117
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven")
117118

@@ -149,7 +150,6 @@ maven.install(
149150
)
150151
use_repo(maven, "maven")
151152

152-
#bazel_dep(name = "grpc-java", version = "1.67.1")
153153
bazel_dep(name = "rules_pkg", version = "1.0.1")
154154
bazel_dep(name = "rules_oci", version = "2.2.0")
155155

MODULE.bazel.lock

Lines changed: 111 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cpp/example_service/BUILD.bazel

Lines changed: 65 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
#load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
2-
#load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
3-
#load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
4-
#
5-
#cc_library(
6-
# name = "example_service_lib",
7-
# srcs = ["example_service.cc"],
8-
# hdrs = ["example_service.h"],
9-
# visibility = ["//visibility:public"],
10-
# deps = [
11-
# "//protos/example_service:example_service_proto",
12-
# "@com_github_grpc_grpc//:grpc++",
13-
# ],
14-
#)
15-
#
16-
#cc_binary(
17-
# name = "example_service",
18-
# srcs = ["main.cc"],
19-
# visibility = ["//visibility:public"],
20-
# deps = [
21-
# ":example_service_lib",
22-
# "@com_github_grpc_grpc//:grpc++_reflection",
23-
# "@com_google_absl//absl/flags:flag",
24-
# "@com_google_absl//absl/flags:parse",
25-
# "@com_google_absl//absl/strings:str_format",
26-
# ],
27-
#)
28-
#
29-
#cc_test(
30-
# name = "example_service_test",
31-
# size = "small",
32-
# srcs = ["example_service_test.cc"],
33-
# deps = [
34-
# ":example_service_lib",
35-
# "@googletest//:gtest_main",
36-
# ],
37-
#)
38-
#
39-
#pkg_tar(
40-
# name = "example_cc_grpc_tar",
41-
# srcs = [":example_service"],
42-
#)
43-
#
44-
#oci_image(
45-
# name = "example_cc_grpc_image",
46-
# base = "@docker_lib_ubuntu",
47-
# entrypoint = ["/example_service"],
48-
# exposed_ports = [
49-
# str(x)
50-
# for x in range(8080, 8090)
51-
# ],
52-
# tars = [":example_cc_grpc_tar"],
53-
#)
54-
#
55-
#oci_load(
56-
# name = "oci_tarball",
57-
# image = ":example_cc_grpc_image",
58-
# repo_tags = ["example_cc_grpc:latest"],
59-
#)
60-
#
61-
#filegroup(
62-
# name = "example_service_oci.tar",
63-
# srcs = [":oci_tarball"],
64-
# output_group = "tarball",
65-
#)
1+
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test")
2+
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
3+
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
4+
5+
cc_library(
6+
name = "example_service_lib",
7+
srcs = ["example_service.cc"],
8+
hdrs = ["example_service.h"],
9+
visibility = ["//visibility:public"],
10+
deps = [
11+
"//protos/example_service:example_service_proto",
12+
"@com_github_grpc_grpc//:grpc++",
13+
],
14+
)
15+
16+
cc_binary(
17+
name = "example_service",
18+
srcs = ["main.cc"],
19+
visibility = ["//visibility:public"],
20+
deps = [
21+
":example_service_lib",
22+
"@com_github_grpc_grpc//:grpc++_reflection",
23+
"@com_google_absl//absl/flags:flag",
24+
"@com_google_absl//absl/flags:parse",
25+
"@com_google_absl//absl/strings:str_format",
26+
],
27+
)
28+
29+
cc_test(
30+
name = "example_service_test",
31+
size = "small",
32+
srcs = ["example_service_test.cc"],
33+
deps = [
34+
":example_service_lib",
35+
"@googletest//:gtest_main",
36+
],
37+
)
38+
39+
pkg_tar(
40+
name = "example_cc_grpc_tar",
41+
srcs = [":example_service"],
42+
)
43+
44+
oci_image(
45+
name = "example_cc_grpc_image",
46+
base = "@docker_lib_ubuntu",
47+
entrypoint = ["/example_service"],
48+
exposed_ports = [
49+
str(x)
50+
for x in range(8080, 8090)
51+
],
52+
tars = [":example_cc_grpc_tar"],
53+
)
54+
55+
oci_load(
56+
name = "oci_tarball",
57+
image = ":example_cc_grpc_image",
58+
repo_tags = ["example_cc_grpc:latest"],
59+
)
60+
61+
filegroup(
62+
name = "example_service_oci.tar",
63+
srcs = [":oci_tarball"],
64+
output_group = "tarball",
65+
)

0 commit comments

Comments
 (0)