Skip to content

Commit

Permalink
Update envoy dep (istio#3070)
Browse files Browse the repository at this point in the history
* update envoy dep

* Update workspace

* update PATH

* fix

* update style script
  • Loading branch information
bianpengyuan authored Nov 2, 2020
1 parent 18e1804 commit 6bc8d61
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# =====================================================================

# Keep envoy.bazelrc up-to-date by run:
# curl -sSL https://raw.githubusercontent.com/istio/envoy/release-1.8/.bazelrc > envoy.bazelrc
# curl -sSL https://raw.githubusercontent.com/envoyproxy/envoy/master/.bazelrc > envoy.bazelrc
import %workspace%/envoy.bazelrc

# Overrides workspace_status_command
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.4.1
3.6.0
2 changes: 1 addition & 1 deletion Makefile.core.mk
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ endif
ifeq "$(origin CXX)" "default"
CXX := clang++
endif
PATH := /usr/lib/llvm-9/bin:$(PATH)
PATH := /usr/lib/llvm-10/bin:$(PATH)

VERBOSE ?=
ifeq "$(VERBOSE)" "1"
Expand Down
10 changes: 5 additions & 5 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ bind(
actual = "//external:ssl",
)

# 1. Determine SHA256 `wget https://github.com/istio/envoy/archive/$COMMIT.tar.gz && sha256sum $COMMIT.tar.gz`
# 1. Determine SHA256 `wget https://github.com/envoyproxy/envoy/archive/$COMMIT.tar.gz && sha256sum $COMMIT.tar.gz`
# 2. Update .bazelversion, envoy.bazelrc and .bazelrc if needed.
#
# Note: this is needed by release builder to resolve envoy dep sha to tag.
# Commit date: 2020-10-19
ENVOY_SHA = "4760a0f90c8fcfa319d699adec21e177cfcb48e2"
# Commit date: 2020-10-30
ENVOY_SHA = "3a32d23c7c361b6ffd5860a707af8957326b2b17"

ENVOY_SHA256 = "4829a219b4a4bd96dc9f231aec463e34563cea9d942f6eb591cdfe0120d72f12"
ENVOY_SHA256 = "a9dbedc06e5bb60d18e694f689188f4fa9cbb425f964898f0e3312cf75d6a5f9"

ENVOY_ORG = "istio"
ENVOY_ORG = "envoyproxy"

ENVOY_REPO = "envoy"

Expand Down
52 changes: 34 additions & 18 deletions envoy.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Bazel doesn't need more than 200MB of memory for local build based on memory profiling:
# https://docs.bazel.build/versions/master/skylark/performance.html#memory-profiling
# The default JVM max heapsize is 1/4 of physical memory up to 32GB which could be large
# enough to consume all memory constrained by cgroup in large host, which is the case in CircleCI.
# enough to consume all memory constrained by cgroup in large host.
# Limiting JVM heapsize here to let it do GC more when approaching the limit to
# leave room for compiler/linker.
# The number 2G is choosed heuristically to both support in CircleCI and large enough for RBE.
# The number 2G is chosen heuristically to both support large VM and small VM with RBE.
# Startup options cannot be selected via config.
startup --host_jvm_args=-Xmx2g

Expand All @@ -19,7 +19,8 @@ build --host_javabase=@bazel_tools//tools/jdk:remote_jdk11
build --javabase=@bazel_tools//tools/jdk:remote_jdk11
build --enable_platform_specific_config

# Enable position independent code, this option is not supported on Windows and default on on macOS.
# Enable position independent code (this is the default on macOS and Windows)
# (Workaround for https://github.com/bazelbuild/rules_foreign_cc/issues/421)
build:linux --copt=-fPIC
build:linux --cxxopt=-std=c++17
build:linux --conlyopt=-fexceptions
Expand Down Expand Up @@ -61,6 +62,9 @@ build:asan --copt -D__SANITIZE_ADDRESS__
build:asan --test_env=ASAN_OPTIONS=handle_abort=1:allow_addr2line=true:check_initialization_order=true:strict_init_order=true:detect_odr_violation=1
build:asan --test_env=UBSAN_OPTIONS=halt_on_error=true:print_stacktrace=1
build:asan --test_env=ASAN_SYMBOLIZER_PATH
# ASAN needs -O1 to get reasonable performance.
build:asan --copt -O1
build:asan --copt -fno-optimize-sibling-calls

# Clang ASAN/UBSAN
build:clang-asan --config=asan
Expand Down Expand Up @@ -164,6 +168,16 @@ build:rbe-toolchain-clang-libc++ --action_env=CXXFLAGS=-stdlib=libc++
build:rbe-toolchain-clang-libc++ --action_env=LDFLAGS=-stdlib=libc++
build:rbe-toolchain-clang-libc++ --define force_libcpp=enabled

# Do not inherit from "clang-asan" to avoid picking up flags from local clang.bazelrc.
build:rbe-toolchain-asan --config=asan
build:rbe-toolchain-asan --linkopt -fuse-ld=lld
build:rbe-toolchain-asan --action_env=ENVOY_UBSAN_VPTR=1
build:rbe-toolchain-asan --copt=-fsanitize=vptr,function
build:rbe-toolchain-asan --linkopt=-fsanitize=vptr,function
build:rbe-toolchain-asan --linkopt=-L/opt/llvm/lib/clang/10.0.0/lib/linux
build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone-x86_64.a
build:rbe-toolchain-asan --linkopt=-l:libclang_rt.ubsan_standalone_cxx-x86_64.a

build:rbe-toolchain-msan --linkopt=-L/opt/libcxx_msan/lib
build:rbe-toolchain-msan --linkopt=-Wl,-rpath,/opt/libcxx_msan/lib
build:rbe-toolchain-msan --config=clang-msan
Expand Down Expand Up @@ -192,8 +206,6 @@ build:remote --spawn_strategy=remote,sandboxed,local
build:remote --strategy=Javac=remote,sandboxed,local
build:remote --strategy=Closure=remote,sandboxed,local
build:remote --strategy=Genrule=remote,sandboxed,local
# rules_rust is not remote runnable (yet)
build:remote --strategy=Rustc=sandboxed,local
build:remote --remote_timeout=7200
build:remote --auth_enabled=true
build:remote --remote_download_toplevel
Expand All @@ -216,6 +228,10 @@ build:remote-clang-libc++ --config=rbe-toolchain-clang-libc++
build:remote-gcc --config=remote
build:remote-gcc --config=rbe-toolchain-gcc

build:remote-asan --config=remote
build:remote-asan --config=rbe-toolchain-clang-libc++
build:remote-asan --config=rbe-toolchain-asan

build:remote-msan --config=remote
build:remote-msan --config=rbe-toolchain-clang-libc++
build:remote-msan --config=rbe-toolchain-msan
Expand Down Expand Up @@ -287,27 +303,27 @@ build:windows --define signal_trace=disabled
build:windows --define hot_restart=disabled
build:windows --define tcmalloc=disabled
build:windows --define manual_stamp=manual_stamp
build:windows --cxxopt="/std:c++17"

# Should not be required after upstream fix to bazel,
# and already a no-op to linux/macos builds
# see issue https://github.com/bazelbuild/rules_foreign_cc/issues/301
# TODO(wrowe,sunjayBhatia): Resolve bugs upstream in curl and rules_foreign_cc
# See issue https://github.com/bazelbuild/rules_foreign_cc/issues/301
build:windows --copt="-DCARES_STATICLIB"
build:windows --copt="-DNGHTTP2_STATICLIB"
build:windows --copt="-DCURL_STATICLIB"
build:windows --cxxopt="/std:c++17"

# Required to work around build defects on Windows MSVC cl
# Unguarded gcc pragmas in quiche are not recognized by MSVC
build:msvc-cl --copt="/wd4068"
# Allows 'nodiscard' function return values to be discarded
build:msvc-cl --copt="/wd4834"
# Allows inline functions to be undefined
build:msvc-cl --copt="/wd4506"
build:msvc-cl --copt="-D_SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING"
# Override any clang preference if building msvc-cl
# Drop the determinism feature (-DDATE etc are a no-op in msvc-cl)
build:msvc-cl --action_env=USE_CLANG_CL=""
build:msvc-cl --define clang_cl=0
build:msvc-cl --features=-determinism

# Windows build behaviors when using clang-cl
build:clang-cl --action_env=USE_CLANG_CL=1
build:clang-cl --define clang_cl=1

# Required to work around Windows clang-cl build defects
# Ignore conflicting definitions of _WIN32_WINNT
# Overriding __TIME__ etc is problematic (and is actually an invalid no-op)
# Override determinism flags (DATE etc) is valid on clang-cl compiler
build:clang-cl --copt="-Wno-macro-redefined"
build:clang-cl --copt="-Wno-builtin-macro-redefined"
build:clang-cl --action_env=USE_CLANG_CL=1
Expand Down
9 changes: 5 additions & 4 deletions scripts/check-style.sh
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="9.0.0"
CLANG_VERSION_REQUIRED="10.0.1"
CLANG_FORMAT=$(command -v clang-format)
CLANG_VERSION="$(${CLANG_FORMAT} -version 2>/dev/null | cut -d ' ' -f 3 | cut -d '-' -f 1)"
if [[ ! -x "${CLANG_FORMAT}" || "${CLANG_VERSION}" != "${CLANG_VERSION_REQUIRED}" ]]; then
Expand All @@ -29,17 +29,18 @@ if [[ ! -x "${CLANG_FORMAT}" || "${CLANG_VERSION}" != "${CLANG_VERSION_REQUIRED}
if [ "$(uname)" == "Darwin" ]; then
CLANG_BIN="x86_64-darwin-apple.tar.xz"
elif [[ "$(uname -s)" =~ Linux* ]]; then
CLANG_BIN="x86_64-linux-gnu-ubuntu-14.04.tar.xz"
CLANG_BIN="x86_64-linux-gnu-ubuntu-16.04.tar.xz"
else
echo "Unsupported environment." ; exit 1 ;
fi

echo "Downloading clang-format: https://releases.llvm.org/${CLANG_VERSION_REQUIRED}/clang+llvm-${CLANG_VERSION_REQUIRED}-${CLANG_BIN}"
LLVM_URL_PREFIX="https://https://github.com/llvm/llvm-project/releases/download/llvmorg"
echo "Downloading clang-format: ${LLVM_URL_PREFIX}-${CLANG_VERSION_REQUIRED}/clang+llvm-${CLANG_VERSION_REQUIRED}-${CLANG_BIN}"
echo "Installing required clang-format ${CLANG_VERSION_REQUIRED} to ${CLANG_DIRECTORY}"

mkdir -p "${CLANG_DIRECTORY}"
curl --silent --show-error --retry 10 \
"https://releases.llvm.org/${CLANG_VERSION_REQUIRED}/clang+llvm-${CLANG_VERSION_REQUIRED}-${CLANG_BIN}" \
"${LLVM_URL_PREFIX}-${CLANG_VERSION_REQUIRED}/clang+llvm-${CLANG_VERSION_REQUIRED}-${CLANG_BIN}" \
| tar Jx -C "${CLANG_DIRECTORY}" --strip=1 \
|| { echo "Could not install required clang-format. Skip formatting." ; exit 1 ; }
fi
Expand Down
2 changes: 1 addition & 1 deletion scripts/release-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
set -ex

# Use clang for the release builds.
export PATH=/usr/lib/llvm-9/bin:$PATH
export PATH=/usr/lib/llvm-10/bin:$PATH
export CC=${CC:-clang}
export CXX=${CXX:-clang++}

Expand Down

0 comments on commit 6bc8d61

Please sign in to comment.