Skip to content

Commit 205a3dd

Browse files
authored
Disable bazel build for gcc 4.8, upgrade versions for grpc and bazel, document bazel support (#953)
* increment bazel * fix bazel * bazel macos fix * revert to old bazel * bazel 4.2.0 * fix * fix * fix * add doc * fix * add newline * remove commented workflow
1 parent 5e4962d commit 205a3dd

File tree

9 files changed

+32
-39
lines changed

9 files changed

+32
-39
lines changed

.bazelrc

+1
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ common:tsan --cc_output_directory_tag=tsan
2222
# This is needed to address false positive problem with abseil.The same setting as gRPC
2323
# https://github.com/google/sanitizers/issues/953
2424
common:tsan --test_env=TSAN_OPTIONS=report_atomic_races=0
25+

.bazelversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.7.2
1+
4.2.0

.github/workflows/ci.yml

+1-25
Original file line numberDiff line numberDiff line change
@@ -128,30 +128,6 @@ jobs:
128128
- name: run tests
129129
run: ./ci/do_ci.sh cmake.test_example_plugin
130130

131-
bazel_gcc_48_test:
132-
name: Bazel gcc 4.8
133-
runs-on: ubuntu-18.04
134-
steps:
135-
- uses: actions/checkout@v2
136-
with:
137-
submodules: 'recursive'
138-
- name: Mount Bazel Cache
139-
uses: actions/cache@v2
140-
env:
141-
cache-name: bazel_cache
142-
with:
143-
path: /home/runner/.cache/bazel
144-
key: bazel_gcc_48_test
145-
- name: setup
146-
run: |
147-
sudo ./ci/setup_ci_environment.sh
148-
sudo ./ci/install_bazelisk.sh
149-
sudo ./ci/install_gcc48.sh
150-
- name: run tests
151-
run: ./ci/do_ci.sh bazel.legacy.test
152-
env:
153-
CC: /usr/bin/gcc-4.8
154-
155131
bazel_test:
156132
name: Bazel
157133
runs-on: ubuntu-latest
@@ -272,7 +248,7 @@ jobs:
272248
path: /Users/runner/.cache/bazel
273249
key: bazel_osx
274250
- name: run tests
275-
run: ./ci/do_ci.sh bazel.test
251+
run: ./ci/do_ci.sh bazel.macos.test
276252

277253
benchmark:
278254
name: Benchmark

INSTALL.md

+2
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ target_link_libraries(foo PRIVATE ${OPENTELEMETRY_CPP_LIBRARIES})
133133

134134
## Build instructions using Bazel
135135

136+
NOTE: Experimental, and not supported for all the components.
137+
136138
### Prerequisites for Bazel
137139

138140
- A supported platform (e.g. Windows, macOS or Linux).

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,16 @@ of the current project.
4747

4848
Our CI pipeline builds and tests on following `x86-64` platforms:
4949

50-
* ubuntu-18.04 (Default GCC Compiler - 7.5.0)
51-
* ubuntu-18.04 (GCC 4.8 with -std=c++11 flag)
52-
* ubuntu-20.04 (Default GCC Compiler - 9.3.0 with -std=c++20 flags)
53-
* macOS 10.15 (Xcode 12.2)
54-
* Windows Server 2019 (Visual Studio Enterprise 2019)
50+
| Platform | Build type |
51+
|---------------------------------------------------------------------|---------------|
52+
| ubuntu-18.04 (Default GCC Compiler - 7.5.0) | CMake, Bazel |
53+
| ubuntu-18.04 (GCC 4.8 with -std=c++11 flag) | CMake [1] |
54+
| ubuntu-20.04 (Default GCC Compiler - 9.3.0 with -std=c++20 flags) | CMake, Bazel |
55+
| macOS 10.15 (Xcode 12.2) | Bazel |
56+
| Windows Server 2019 (Visual Studio Enterprise 2019) | CMake, Bazel |
57+
58+
[1]: Bazel build is disabled for GCC 4.8, as GRPC library ( required by OTLP expoter)
59+
doesn't build with this compiler. CMake build won't build OTLP exporter with GCC 4.8.
5560

5661
In general, the code shipped from this repository should build on all platforms
5762
having C++ compiler with [supported C++ standards](#supported-c-versions).

bazel/repository.bzl

+6-6
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ def opentelemetry_cpp_deps():
3232
maybe(
3333
http_archive,
3434
name = "com_github_grpc_grpc_legacy",
35-
sha256 = "2060769f2d4b0d3535ba594b2ab614d7f68a492f786ab94b4318788d45e3278a",
36-
strip_prefix = "grpc-1.33.2",
35+
sha256 = "024118069912358e60722a2b7e507e9c3b51eeaeee06e2dd9d95d9c16f6639ec",
36+
strip_prefix = "grpc-1.39.1",
3737
urls = [
38-
"https://github.com/grpc/grpc/archive/v1.33.2.tar.gz",
38+
"https://github.com/grpc/grpc/archive/v1.39.1.tar.gz",
3939
],
4040
)
4141

4242
maybe(
4343
http_archive,
4444
name = "com_github_grpc_grpc",
45-
sha256 = "2060769f2d4b0d3535ba594b2ab614d7f68a492f786ab94b4318788d45e3278a",
46-
strip_prefix = "grpc-1.33.2",
45+
sha256 = "024118069912358e60722a2b7e507e9c3b51eeaeee06e2dd9d95d9c16f6639ec",
46+
strip_prefix = "grpc-1.39.1",
4747
urls = [
48-
"https://github.com/grpc/grpc/archive/v1.33.2.tar.gz",
48+
"https://github.com/grpc/grpc/archive/v1.39.1.tar.gz",
4949
],
5050
)
5151

ci/do_ci.sh

+9
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ mkdir -p "${PLUGIN_DIR}"
2525

2626
BAZEL_OPTIONS="--copt=-DENABLE_METRICS_PREVIEW --copt=-DENABLE_LOGS_PREVIEW"
2727
BAZEL_TEST_OPTIONS="$BAZEL_OPTIONS --test_output=errors"
28+
29+
# https://github.com/bazelbuild/bazel/issues/4341
30+
BAZEL_MACOS_OPTIONS="$BAZEL_OPRIONS --features=-supports_dynamic_linker"
31+
BAZEL_MACOS_TEST_OPTIONS="$BAZEL_MACOS_OPTIONS --test_output=errors"
32+
2833
BAZEL_STARTUP_OPTIONS="--output_user_root=$HOME/.cache/bazel"
2934

3035
export CTEST_OUTPUT_ON_FAILURE=1
@@ -158,6 +163,10 @@ elif [[ "$1" == "bazel.test" ]]; then
158163
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_OPTIONS //...
159164
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_TEST_OPTIONS //...
160165
exit 0
166+
elif [[ "$1" == "bazel.macos.test" ]]; then
167+
bazel $BAZEL_STARTUP_OPTIONS build $BAZEL_MACOS_OPTIONS //...
168+
bazel $BAZEL_STARTUP_OPTIONS test $BAZEL_MACOS_TEST_OPTIONS //...
169+
exit 0
161170
elif [[ "$1" == "bazel.legacy.test" ]]; then
162171
# we uses C++ future and async() function to test the Prometheus Exporter functionality,
163172
# that make this test always fail. ignore Prometheus exporter here.

ci/install_bazelisk.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -e
77

8-
BAZELISK_VERSION=v1.7.4
8+
BAZELISK_VERSION=v1.10.1
99

1010
wget -O /usr/local/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/$BAZELISK_VERSION/bazelisk-linux-amd64
1111
chmod +x /usr/local/bin/bazel

ci/setup_grpc.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
set -e
77
export DEBIAN_FRONTEND=noninteractive
88
old_grpc_version='v1.33.2'
9-
new_grpc_version='v1.39.0'
9+
new_grpc_version='v1.39.1'
1010
gcc_version_for_new_grpc='5.1'
1111
install_grpc_version=${new_grpc_version}
1212
grpc_version='v1.39.0'

0 commit comments

Comments
 (0)