Skip to content

Commit

Permalink
Update clang to 6.0 and use it for release binaries.
Browse files Browse the repository at this point in the history
Signed-off-by: Piotr Sikora <[email protected]>
  • Loading branch information
PiotrSikora committed Aug 14, 2018
1 parent b1f4e7e commit 6f53854
Show file tree
Hide file tree
Showing 20 changed files with 49 additions and 37 deletions.
8 changes: 1 addition & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ version: 2
jobs:
build:
docker:
- image: istio/ci:go1.9-bazel0.11
- image: istio/ci:go1.10-bazel0.15-clang6.0
environment:
- BAZEL_TEST_ARGS: "--test_env=ENVOY_IP_TEST_VERSIONS=v4only --test_output=all"
resource_class: xlarge
steps:
- run: curl -Lo /tmp/bazel.deb https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel_0.15.2-linux-x86_64.deb && sudo dpkg -i /tmp/bazel.deb && rm /tmp/bazel.deb
- run: sudo apt-get update && sudo apt-get install -y ninja-build pkg-config
- checkout
- restore_cache:
keys:
Expand Down Expand Up @@ -37,8 +35,6 @@ jobs:
- BAZEL_TEST_ARGS: "--test_env=ENVOY_IP_TEST_VERSIONS=v4only --test_output=all"
resource_class: xlarge
steps:
- run: curl -Lo /tmp/bazel.deb https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel_0.15.2-linux-x86_64.deb && sudo dpkg -i /tmp/bazel.deb && rm /tmp/bazel.deb
- run: sudo apt-get update && sudo apt-get install -y ninja-build pkg-config
- checkout
- restore_cache:
keys:
Expand All @@ -58,8 +54,6 @@ jobs:
- BAZEL_TEST_ARGS: "--test_env=ENVOY_IP_TEST_VERSIONS=v4only --test_output=all"
resource_class: xlarge
steps:
- run: curl -Lo /tmp/bazel.deb https://github.com/bazelbuild/bazel/releases/download/0.15.2/bazel_0.15.2-linux-x86_64.deb && sudo dpkg -i /tmp/bazel.deb && rm /tmp/bazel.deb
- run: sudo apt-get update && sudo apt-get install -y ninja-build pkg-config
- checkout
- restore_cache:
keys:
Expand Down
27 changes: 20 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,42 @@ TOP := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SHELL := /bin/bash
LOCAL_ARTIFACTS_DIR ?= $(abspath artifacts)
ARTIFACTS_DIR ?= $(LOCAL_ARTIFACTS_DIR)
BAZEL_STARTUP_ARGS ?= --batch
BAZEL_STARTUP_ARGS ?=
BAZEL_BUILD_ARGS ?=
BAZEL_TEST_ARGS ?=
HUB ?=
TAG ?=
ifeq "$(origin CC)" "default"
CC := clang-6.0
endif
ifeq "$(origin CXX)" "default"
CXX := clang++-6.0
endif

build:
@bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //...
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //...
@bazel shutdown

# Build only envoy - fast
build_envoy:
bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //src/envoy:envoy
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //src/envoy:envoy
@bazel shutdown

clean:
@bazel clean
@bazel shutdown

test:
bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) //...
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) //...
@bazel shutdown

test_asan:
CC=clang-5.0 CXX=clang++-5.0 bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) --config=clang-asan //...
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) --config=clang-asan //...
@bazel shutdown

test_tsan:
CC=clang-5.0 CXX=clang++-5.0 bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) --config=clang-tsan //...
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) test $(BAZEL_TEST_ARGS) --config=clang-tsan //...
@bazel shutdown

check:
@script/check-license-headers
Expand All @@ -50,7 +62,8 @@ artifacts: build
@script/push-debian.sh -c opt -p $(ARTIFACTS_DIR)

deb:
@bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //tools/deb:istio-proxy
CC=$(CC) CXX=$(CXX) bazel $(BAZEL_STARTUP_ARGS) build $(BAZEL_BUILD_ARGS) //tools/deb:istio-proxy
@bazel shutdown


.PHONY: build clean test check artifacts
4 changes: 2 additions & 2 deletions script/check-style
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"

CLANG_VERSION_REQUIRED="5.0.0"
CLANG_VERSION_REQUIRED="6.0.0"
CLANG_FORMAT=$(which clang-format-${CLANG_VERSION_REQUIRED%.*})
if [[ ! -x "${CLANG_FORMAT}" ]]; then
# Install required clang version to a folder and cache it.
Expand All @@ -28,7 +28,7 @@ if [[ ! -x "${CLANG_FORMAT}" ]]; then
if [ "$(uname)" == "Darwin" ]; then
CLANG_BIN="x86_64-apple-darwin.tar.xz"
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
CLANG_BIN="linux-x86_64-ubuntu14.04.tar.xz"
CLANG_BIN="x86_64-linux-gnu-ubuntu-14.04.tar.xz"
else
echo "Unsupported environment." ; exit 1 ;
fi
Expand Down
2 changes: 1 addition & 1 deletion script/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ if [[ ! -x "${CLANG_FORMAT}" ]]; then
fi

CLANG_FORMAT_VERSION="$(${CLANG_FORMAT} -version | cut -d ' ' -f 3)"
CLANG_FORMAT_VERSION_REQUIRED="5.0.0"
CLANG_FORMAT_VERSION_REQUIRED="6.0.0"
if ! [[ "${CLANG_FORMAT_VERSION}" =~ "${CLANG_FORMAT_VERSION_REQUIRED}" ]]; then
echo "Skipping: clang-format ${CLANG_FORMAT_VERSION_REQUIRED} required."
exit 0
Expand Down
17 changes: 12 additions & 5 deletions script/release-binary
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
################################################################################
#
set -ex

# Use clang for the release builds.
CC=${CC:-clang-6.0}
CXX=${CXX:-clang++-6.0}

# The bucket name to store proxy binary
DST="gs://istio-build/proxy"

Expand Down Expand Up @@ -54,7 +59,7 @@ gsutil stat "${DST}/${BINARY_NAME}" \
|| echo 'Building a new binary.'

# Build the release binary with symbol
bazel --batch build --config=release-symbol //src/envoy:envoy_tar
CC=${CC} CXX=${CXX} bazel build --config=release-symbol //src/envoy:envoy_tar
BAZEL_TARGET="bazel-bin/src/envoy/envoy_tar.tar.gz"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
sha256sum "${BINARY_NAME}" > "${SHA256_NAME}"
Expand All @@ -67,7 +72,7 @@ BINARY_NAME="envoy-alpha-${SHA}.tar.gz"
SHA256_NAME="envoy-alpha-${SHA}.sha256"

# Build the release binary
bazel --batch build --config=release //src/envoy:envoy_tar
CC=${CC} CXX=${CXX} bazel build --config=release //src/envoy:envoy_tar
BAZEL_TARGET="bazel-bin/src/envoy/envoy_tar.tar.gz"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
sha256sum "${BINARY_NAME}" > "${SHA256_NAME}"
Expand All @@ -78,7 +83,7 @@ gsutil cp "${BINARY_NAME}" "${SHA256_NAME}" "${DST}/"

BINARY_NAME="istio-proxy-${SHA}.deb"
SHA256_NAME="istio-proxy-${SHA}.sha256"
bazel --batch build --config=release //tools/deb:istio-proxy
CC=${CC} CXX=${CXX} bazel build --config=release //tools/deb:istio-proxy
BAZEL_TARGET="bazel-bin/tools/deb/istio-proxy.deb"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
sha256sum "${BINARY_NAME}" > "${SHA256_NAME}"
Expand All @@ -91,7 +96,7 @@ gsutil cp "${BINARY_NAME}" "${SHA256_NAME}" "${DST}/"
# Build the debug binary
BINARY_NAME="envoy-debug-${SHA}.tar.gz"
SHA256_NAME="envoy-debug-${SHA}.sha256"
bazel --batch build -c dbg //src/envoy:envoy_tar
CC=${CC} CXX=${CXX} bazel build -c dbg //src/envoy:envoy_tar
BAZEL_TARGET="bazel-bin/src/envoy/envoy_tar.tar.gz"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
sha256sum "${BINARY_NAME}" > "${SHA256_NAME}"
Expand All @@ -102,11 +107,13 @@ gsutil cp "${BINARY_NAME}" "${SHA256_NAME}" "${DST}/"

BINARY_NAME="istio-proxy-debug-${SHA}.deb"
SHA256_NAME="istio-proxy-debug-${SHA}.sha256"
bazel --batch build -c dbg //tools/deb:istio-proxy
CC=${CC} CXX=${CXX} bazel build -c dbg //tools/deb:istio-proxy
BAZEL_TARGET="bazel-bin/tools/deb/istio-proxy.deb"
cp -f "${BAZEL_TARGET}" "${BINARY_NAME}"
sha256sum "${BINARY_NAME}" > "${SHA256_NAME}"

# Copy it to the bucket.
echo "Copying ${BINARY_NAME} ${SHA256_NAME} to ${DST}/"
gsutil cp "${BINARY_NAME}" "${SHA256_NAME}" "${DST}/"

bazel shutdown
2 changes: 1 addition & 1 deletion src/envoy/http/authn/http_filter_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ using Envoy::Http::Istio::AuthN::FilterContext;
using istio::authn::Payload;
using istio::authn::Result;
using istio::envoy::config::filter::http::authn::v2alpha1::FilterConfig;
using testing::_;
using testing::AtLeast;
using testing::Invoke;
using testing::NiceMock;
using testing::ReturnRef;
using testing::StrictMock;
using testing::_;

namespace iaapi = istio::authentication::v1alpha1;

Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/authn/origin_authenticator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ namespace iaapi = istio::authentication::v1alpha1;

using istio::authn::Payload;
using istio::authn::Result;
using testing::_;
using testing::DoAll;
using testing::MockFunction;
using testing::NiceMock;
using testing::Return;
using testing::SetArgPointee;
using testing::StrictMock;
using testing::_;

namespace Envoy {
namespace Http {
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/authn/peer_authenticator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
namespace iaapi = istio::authentication::v1alpha1;

using istio::authn::Payload;
using testing::_;
using testing::DoAll;
using testing::MockFunction;
using testing::NiceMock;
using testing::Return;
using testing::SetArgPointee;
using testing::StrictMock;
using testing::_;

namespace Envoy {
namespace Http {
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/jwt_auth/jwt_authenticator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@

using ::istio::envoy::config::filter::http::jwt_auth::v2alpha1::
JwtAuthentication;
using ::testing::_;
using ::testing::Invoke;
using ::testing::NiceMock;
using ::testing::_;

namespace Envoy {
namespace Http {
Expand Down
2 changes: 1 addition & 1 deletion src/envoy/http/jwt_auth/token_extractor_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@

using ::istio::envoy::config::filter::http::jwt_auth::v2alpha1::
JwtAuthentication;
using ::testing::_;
using ::testing::Invoke;
using ::testing::NiceMock;
using ::testing::_;

namespace Envoy {
namespace Http {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/api_spec/http_api_spec_parser_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ using ::istio::mixer::v1::Attributes;
using ::istio::mixer::v1::config::client::HTTPAPISpec;
using ::istio::utils::AttributesBuilder;

using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace api_spec {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/control/http/attributes_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ using ::google::protobuf::util::MessageDifferencer;
using ::istio::mixer::v1::Attributes;
using ::istio::mixer::v1::Attributes_StringMap;

using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace control {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/control/http/request_handler_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ using ::istio::mixerclient::MixerClient;
using ::istio::mixerclient::TransportCheckFunc;
using ::istio::quota_config::Requirement;

using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace control {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/control/tcp/attributes_builder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
using ::google::protobuf::TextFormat;
using ::google::protobuf::util::MessageDifferencer;

using ::testing::_;
using ::testing::Invoke;
using ::testing::Return;
using ::testing::_;

namespace istio {
namespace control {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/control/tcp/request_handler_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ using ::istio::mixerclient::MixerClient;
using ::istio::mixerclient::TransportCheckFunc;
using ::istio::quota_config::Requirement;

using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace control {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/mixerclient/client_impl_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ using ::istio::mixer::v1::CheckRequest;
using ::istio::mixer::v1::CheckResponse;
using ::istio::mixerclient::CheckResponseInfo;
using ::istio::quota_config::Requirement;
using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace mixerclient {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/mixerclient/quota_cache_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ using ::istio::mixer::v1::CheckRequest;
using ::istio::mixer::v1::CheckResponse;
using ::istio::mixer::v1::ReferencedAttributes;
using ::istio::quota_config::Requirement;
using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace mixerclient {
Expand Down
2 changes: 1 addition & 1 deletion src/istio/mixerclient/report_batch_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ using ::google::protobuf::util::error::Code;
using ::istio::mixer::v1::Attributes;
using ::istio::mixer::v1::ReportRequest;
using ::istio::mixer::v1::ReportResponse;
using ::testing::Invoke;
using ::testing::_;
using ::testing::Invoke;

namespace istio {
namespace mixerclient {
Expand Down
1 change: 0 additions & 1 deletion tools/bazel.rc.ci
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This is from Bazel's former travis setup, to avoid blowing up the RAM usage.
startup --host_jvm_args=-Xmx8192m
startup --host_jvm_args=-Xms8192m
startup --batch

# This is so we understand failures better
build --verbose_failures
Expand Down
1 change: 0 additions & 1 deletion tools/bazel.rc.cloudbuilder
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This is from Bazel's former travis setup, to avoid blowing up the RAM usage.
startup --host_jvm_args=-Xmx8192m
startup --host_jvm_args=-Xms8192m
startup --batch

# This is so we understand failures better
build --verbose_failures
Expand Down

0 comments on commit 6f53854

Please sign in to comment.