Skip to content

Commit

Permalink
Remove abseil optionality
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Apr 22, 2024
1 parent 27c5f69 commit f9c9ce9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 33 deletions.
30 changes: 7 additions & 23 deletions api/BUILD
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
# Copyright The OpenTelemetry Authors
# SPDX-License-Identifier: Apache-2.0

load("@bazel_skylib//rules:common_settings.bzl", "bool_flag", "string_flag")
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")

package(default_visibility = ["//visibility:public"])

bool_flag(
name = "with_abseil",
build_setting_default = False,
)

CPP_STDLIBS = [
"none",
"best",
Expand All @@ -28,10 +23,7 @@ string_flag(
cc_library(
name = "api",
hdrs = glob(["include/**/*.h"]),
defines = select({
":with_external_abseil": ["HAVE_ABSEIL"],
"//conditions:default": [],
}) + select({
defines = ["HAVE_ABSEIL"] + select({
":set_cxx_stdlib_none": [],
### automatic selection
":set_cxx_stdlib_best": ["OPENTELEMETRY_STL_VERSION=(__cplusplus/100)"],
Expand All @@ -46,19 +38,11 @@ cc_library(
}),
strip_include_prefix = "include",
tags = ["api"],
deps = select({
":with_external_abseil": [
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:variant",
],
"//conditions:default": [],
}),
)

config_setting(
name = "with_external_abseil",
flag_values = {":with_abseil": "true"},
deps = [
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/types:variant",
],
)

[config_setting(
Expand Down
13 changes: 3 additions & 10 deletions bazel/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,12 @@ def opentelemetry_cpp_deps():

# Load abseil dependency(optional)
maybe(
#
# Important note:
#
# The bazel build still uses abseil-cpp-20220623.1 here.
#
# Upgrading to abseil-cpp-20240116.1 breaks the OTLP build, reason unknown.
#
http_archive,
name = "com_google_absl",
sha256 = "91ac87d30cc6d79f9ab974c51874a704de9c2647c40f6932597329a282217ba8",
strip_prefix = "abseil-cpp-20220623.1",
sha256 = "3c743204df78366ad2eaf236d6631d83f6bc928d1705dd0000b872e53b73dc6a",
strip_prefix = "abseil-cpp-20240116.1",
urls = [
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20220623.1.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.1.tar.gz",
],
)

Expand Down

0 comments on commit f9c9ce9

Please sign in to comment.