Skip to content

Commit ae0d9a3

Browse files
authored
chore(build): replace Abseil extension with bazel_dep and eliminate source patching (#243)
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 9dcfeb2 commit ae0d9a3

File tree

6 files changed

+11
-57
lines changed

6 files changed

+11
-57
lines changed

.bazelrc.absl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
# This bazelrc defines the `DD_USE_ABSEIL_FOR_ENVOY` preprocessor macro, and so
88
# the resulting library will use `absl::string_view` and `absl::optional`
99
# instead of their standard (`std`) equivalents.
10+
#
11+
# Additionally, we configure Abseil to not use std library types by setting
12+
# the appropriate ABSL_OPTION_* macros, replacing the need for patching.
1013

1114
build --enable_platform_specific_config
1215

13-
build:linux --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY'
14-
build:macos --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY'
15-
build:windows --cxxopt='/std:c++17' --cxxopt='/DDD_USE_ABSEIL_FOR_ENVOY' --linkopt='ws2_32.lib'
16+
build:linux --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY' --cxxopt='-DABSL_OPTION_USE_STD_OPTIONAL=0' --cxxopt='-DABSL_OPTION_USE_STD_STRING_VIEW=0' --cxxopt='-DABSL_OPTION_USE_STD_VARIANT=0'
17+
build:macos --cxxopt='-std=c++17' --cxxopt='-Wall' --cxxopt='-Wextra' --cxxopt='-pedantic' --cxxopt='-DDD_USE_ABSEIL_FOR_ENVOY' --cxxopt='-DABSL_OPTION_USE_STD_OPTIONAL=0' --cxxopt='-DABSL_OPTION_USE_STD_STRING_VIEW=0' --cxxopt='-DABSL_OPTION_USE_STD_VARIANT=0'
18+
build:windows --cxxopt='/std:c++17' --cxxopt='/DDD_USE_ABSEIL_FOR_ENVOY' --cxxopt='/DABSL_OPTION_USE_STD_OPTIONAL=0' --cxxopt='/DABSL_OPTION_USE_STD_STRING_VIEW=0' --cxxopt='/DABSL_OPTION_USE_STD_VARIANT=0' --linkopt='ws2_32.lib'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/bazel-*
22
/.build/
33
/.coverage/
4+
build/
45

56
dist/
67
out/

MODULE.bazel

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ bazel_dep(
1111
name = "rules_cc",
1212
version = "0.0.9",
1313
)
14-
# -- bazel_dep definitions -- #
15-
16-
non_module_dependencies = use_extension("//:extensions.bzl", "non_module_dependencies")
17-
use_repo(
18-
non_module_dependencies,
19-
"com_google_absl",
14+
bazel_dep(
15+
name = "abseil-cpp",
16+
version = "20230125.1",
17+
repo_name = "com_google_absl",
2018
)

WORKSPACE

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ http_archive(
1919
urls = ["https://github.com/abseil/abseil-cpp/archive/98eb410c93ad059f9bba1bf43f5bb916fc92a5ea.zip"],
2020
sha256 = "aabf6c57e3834f8dc3873a927f37eaf69975d4b28117fc7427dfb1c661542a87",
2121
strip_prefix = "abseil-cpp-98eb410c93ad059f9bba1bf43f5bb916fc92a5ea",
22-
patches = ["//:abseil.patch"],
23-
patch_args = ["-p1"],
2422
)
2523

2624
http_archive(

abseil.patch

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

extensions.bzl

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

0 commit comments

Comments
 (0)