diff --git a/bazel/grpc_build_system.bzl b/bazel/grpc_build_system.bzl index 878218e42f7..c944d8f177b 100644 --- a/bazel/grpc_build_system.bzl +++ b/bazel/grpc_build_system.bzl @@ -88,11 +88,19 @@ def grpc_cc_library( linkopts = if_not_windows(["-pthread"]) if use_cfstream: linkopts = linkopts + if_mac(["-framework CoreFoundation"]) - # Temporary hack for GRPC_USE_ABSL { + + # This is a temporary solution to enable absl dependency only for + # Bazel-build with grpc_use_absl enabled to abseilfy in-house classes + # such as inlined_vector before absl is fully supported. + # When https://github.com/grpc/grpc/pull/20184 is merged, it will + # be removed. more_external_deps = [] if name == "inlined_vector": - more_external_deps += ["absl/container:inlined_vector"] - # Temporary hack for GRPC_USE_ABSL } + more_external_deps += select({ + "//:grpc_use_absl": ["@com_google_absl//absl/container:inlined_vector"], + "//conditions:default": [], + }) + native.cc_library( name = name, srcs = srcs, @@ -109,12 +117,12 @@ def grpc_cc_library( "//:grpc_disallow_exceptions": ["GRPC_ALLOW_EXCEPTIONS=0"], "//conditions:default": [], }) + - select({ - "//:grpc_use_absl": ["GRPC_USE_ABSL=1"], - "//conditions:default": [], + select({ + "//:grpc_use_absl": ["GRPC_USE_ABSL=1"], + "//conditions:default": [], }), hdrs = hdrs + public_hdrs, - deps = deps + _get_external_deps(external_deps + more_external_deps), + deps = deps + _get_external_deps(external_deps) + more_external_deps, copts = copts, visibility = visibility, testonly = testonly, diff --git a/src/core/lib/gprpp/inlined_vector.h b/src/core/lib/gprpp/inlined_vector.h index 6e637de76fd..e05a0a855f9 100644 --- a/src/core/lib/gprpp/inlined_vector.h +++ b/src/core/lib/gprpp/inlined_vector.h @@ -233,14 +233,7 @@ class InlinedVector { } } -#if 1 typename std::aligned_storage::type inline_[N]; -#else - // Alignment attribute should be used like this but it has a problem - // with current gRPC source. It has to be disabled until other gRPC part - // goes well with this. - typename std::aligned_storage::type inline_[N]; -#endif T* dynamic_; size_t size_; size_t capacity_; diff --git a/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh b/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh index 59c54edb009..b7e47920653 100755 --- a/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh +++ b/tools/internal_ci/linux/grpc_bazel_build_in_docker.sh @@ -25,4 +25,7 @@ git clone /var/local/jenkins/grpc /var/local/git/grpc ${name}') cd /var/local/git/grpc bazel build --spawn_strategy=standalone --genrule_strategy=standalone :all test/... examples/... + +# This is a temporary build test before full absl support is done +# with https://github.com/grpc/grpc/pull/20918. bazel build --spawn_strategy=standalone --genrule_strategy=standalone --define=GRPC_USE_ABSL=1 :grpc