diff --git a/.bazelrc b/.bazelrc index 98518f1b1d7ee..12d313003f5a6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -71,6 +71,7 @@ build:asan --linkopt -fsanitize=address,undefined build:asan --copt -fno-sanitize=vptr,function build:asan --linkopt -fno-sanitize=vptr,function build:asan --copt -DADDRESS_SANITIZER=1 +build:asan --copt -DUNDEFINED_SANITIZER=1 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 @@ -109,6 +110,7 @@ build:clang-tsan --define ENVOY_CONFIG_TSAN=1 build:clang-tsan --copt -fsanitize=thread build:clang-tsan --linkopt -fsanitize=thread build:clang-tsan --linkopt -fuse-ld=lld +build:clang-tsan --copt -DTHREAD_SANITIZER=1 build:clang-tsan --build_tag_filters=-no_san,-no_tsan build:clang-tsan --test_tag_filters=-no_san,-no_tsan # Needed due to https://github.com/libevent/libevent/issues/777 @@ -127,6 +129,7 @@ build:clang-msan --copt -fsanitize=memory build:clang-msan --linkopt -fsanitize=memory build:clang-msan --linkopt -fuse-ld=lld build:clang-msan --copt -fsanitize-memory-track-origins=2 +build:clang-msan --copt -DMEMORY_SANITIZER=1 build:clang-msan --test_env=MSAN_SYMBOLIZER_PATH # MSAN needs -O1 to get reasonable performance. build:clang-msan --copt -O1 diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl index 81b15344de493..ffe21c99d8f87 100644 --- a/bazel/dependency_imports.bzl +++ b/bazel/dependency_imports.bzl @@ -1,6 +1,5 @@ load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies") load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies") -load("@bazel_toolchains//rules/exec_properties:exec_properties.bzl", "create_rbe_exec_properties_dict", "custom_exec_properties") load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") @@ -33,13 +32,6 @@ def envoy_dependency_imports(go_version = GO_VERSION): rules_cc_dependencies() rules_cc_toolchains() - custom_exec_properties( - name = "envoy_large_machine_exec_property", - constants = { - "LARGE_MACHINE": create_rbe_exec_properties_dict(labels = dict(size = "large")), - }, - ) - # These dependencies, like most of the Go in this repository, exist only for the API. go_repository( name = "org_golang_google_grpc", diff --git a/bazel/external/wee8.BUILD b/bazel/external/wee8.BUILD deleted file mode 100644 index ee56998db90fb..0000000000000 --- a/bazel/external/wee8.BUILD +++ /dev/null @@ -1,45 +0,0 @@ -load("@rules_cc//cc:defs.bzl", "cc_library") -load("@envoy_large_machine_exec_property//:constants.bzl", "LARGE_MACHINE") -load(":genrule_cmd.bzl", "genrule_cmd") - -licenses(["notice"]) # Apache 2 - -cc_library( - name = "wee8", - srcs = [ - "libwee8.a", - ], - hdrs = - glob([ - "include/**/*.h", - "src/**/*.h", - "third_party/wasm-api/wasm.hh", - ]), - copts = [ - "-Wno-range-loop-analysis", - ], - defines = [ - "V8_ENABLE_WEBASSEMBLY", - ], - includes = [ - ".", - "include", - "third_party", - ], - tags = ["skip_on_windows"], - visibility = ["//visibility:public"], -) - -genrule( - name = "build", - srcs = glob( - ["**"], - exclude = ["out/**"], - ), - outs = [ - "libwee8.a", - ], - cmd = genrule_cmd("@envoy//bazel/external:wee8.genrule_cmd"), - exec_properties = LARGE_MACHINE, - tags = ["skip_on_windows"], -) diff --git a/bazel/external/wee8.genrule_cmd b/bazel/external/wee8.genrule_cmd deleted file mode 100644 index 57a6a9ba56709..0000000000000 --- a/bazel/external/wee8.genrule_cmd +++ /dev/null @@ -1,157 +0,0 @@ -#!/bin/bash - -set -e - -# Works on Linux-{x86_64,s390x,aarch64,ppc64le} and macOS-{x86_64,arm64}. -ARCH="$$(uname -m)" -SYSTEM="$$(uname -s)" -PLATFORM="$${SYSTEM}-$${ARCH}" - -case $${PLATFORM} in -Linux-x86_64|Linux-s390x|Linux-aarch64|Linux-ppc64le) - ;; -Darwin-x86_64|Darwin-arm64) - ;; -MSYS_NT-*-x86_64) - echo "WARNING: wee8 is currently untested on $${PLATFORM}." >&2 - ;; -*) - echo "ERROR: wee8 is currently not supported on $${PLATFORM}." >&2 - exit 1 -esac - -# Bazel magic. -ROOT=$$(dirname $(rootpath BUILD.gn)) -pushd $$ROOT - -# Clean after previous build. -rm -rf out/wee8 - -# Export compiler configuration. -export CFLAGS="$${CFLAGS-} -Wno-unknown-warning-option" -export CXXFLAGS="$${CXXFLAGS-} -Wno-sign-compare -Wno-deprecated-copy -Wno-unknown-warning-option -Wno-range-loop-analysis -Wno-shorten-64-to-32 -Wno-invalid-offsetof" -if [[ ( $${SYSTEM} == "Darwin" && $${CXX-} == "" ) || $${CXX-} == *clang* ]]; then - export CC=$${CC:-clang} - export CXX=$${CXX:-clang++} -else - export CC=$${CC:-gcc} - export CXX=$${CXX:-g++} -fi - -if $${CXX} --version 2>&1 | grep -q clang ; then - export IS_CLANG=true - export CXXFLAGS="$${CXXFLAGS} -Wno-implicit-int-float-conversion -Wno-builtin-assume-aligned-alignment -Wno-final-dtor-non-final-class -Wno-invalid-constexpr" -else - export IS_CLANG=false -fi - -export AR=$${AR:-ar} -export NM=$${NM:-nm} - -# Hook sanitizers. -if [[ $${ENVOY_ASAN-} == "1" ]]; then - WEE8_BUILD_ARGS+=" is_asan=true" - WEE8_BUILD_ARGS+=" is_lsan=true" -fi -if [[ $${ENVOY_UBSAN_VPTR-} == "1" ]]; then - WEE8_BUILD_ARGS+=" is_ubsan=true" - WEE8_BUILD_ARGS+=" is_ubsan_vptr=true" -fi -if [[ $${ENVOY_MSAN-} == "1" ]]; then - WEE8_BUILD_ARGS+=" is_msan=true" - WEE8_BUILD_ARGS+=" msan_track_origins=2" - export LDFLAGS="$${LDFLAGS} -L/opt/libcxx_msan/lib -Wl,-rpath,/opt/libcxx_msan/lib" -fi -if [[ $${ENVOY_TSAN-} == "1" ]]; then - WEE8_BUILD_ARGS+=" is_tsan=true" - export LDFLAGS="$${LDFLAGS} -L/opt/libcxx_tsan/lib -Wl,-rpath,/opt/libcxx_tsan/lib" -fi - -# Debug/release build. -if [[ $(COMPILATION_MODE) == "dbg" && $${ENVOY_UBSAN_VPTR-} != "1" && $${ENVOY_MSAN-} != "1" && $${ENVOY_TSAN-} != "1" ]]; then - WEE8_BUILD_ARGS+=" is_debug=true" - WEE8_BUILD_ARGS+=" v8_symbol_level=2" - WEE8_BUILD_ARGS+=" v8_optimized_debug=false" -else - WEE8_BUILD_ARGS+=" is_debug=false" - WEE8_BUILD_ARGS+=" v8_symbol_level=1" - WEE8_BUILD_ARGS+=" v8_enable_handle_zapping=false" -fi - -# Clang or not Clang, that is the question. -WEE8_BUILD_ARGS+=" is_clang=$$IS_CLANG" -if [[ $${SYSTEM} == Darwin ]]; then - WEE8_BUILD_ARGS+=" use_lld=false" -else - WEE8_BUILD_ARGS+=" use_lld=$$IS_CLANG" -fi -# Use local toolchain. -WEE8_BUILD_ARGS+=" custom_toolchain=\"//build/toolchain/linux/unbundle:default\"" -# Use local stdlibc++ / libc++. -WEE8_BUILD_ARGS+=" use_custom_libcxx=false" -# Use local sysroot. -WEE8_BUILD_ARGS+=" use_sysroot=false" -# Disable unused GLib2 dependency. -WEE8_BUILD_ARGS+=" use_glib=false" -# Expose debug symbols. -WEE8_BUILD_ARGS+=" v8_expose_symbols=true" -# Build monolithic library. -WEE8_BUILD_ARGS+=" is_component_build=false" -WEE8_BUILD_ARGS+=" v8_enable_i18n_support=false" -WEE8_BUILD_ARGS+=" v8_enable_gdbjit=false" -WEE8_BUILD_ARGS+=" v8_use_external_startup_data=false" -# Disable read-only heap, since it's leaky and HEAPCHECK complains about it. -# TODO(PiotrSikora): remove when fixed upstream. -WEE8_BUILD_ARGS+=" v8_enable_shared_ro_heap=false" -# Disable pointer compression (limits the maximum number of WasmVMs). -WEE8_BUILD_ARGS+=" v8_enable_pointer_compression=false" - -# Set target architecture. -if [[ $${ARCH} == "x86_64" ]]; then - WEE8_BUILD_ARGS+=" target_cpu=\"x64\"" -elif [[ $${ARCH} == "aarch64" || $${ARCH} == "arm64" ]]; then - WEE8_BUILD_ARGS+=" target_cpu=\"arm64\"" -elif [[ $${ARCH} == "ppc64le" ]]; then - WEE8_BUILD_ARGS+=" target_cpu=\"ppc64\"" -elif [[ $${ARCH} == "s390x" ]]; then - WEE8_BUILD_ARGS+=" target_cpu=\"s390x\"" -fi - -# Select gn tool for the current platform. -if [[ -f /etc/centos-release ]] && [[ $$(cat /etc/centos-release) =~ "CentOS Linux release 7" ]] && [[ -x "$$(command -v gn)" ]]; then - # Use system default on CentOS 7, as it has an old version of GLIBC which is otherwise incompatible with the prebuilt binary. - gn=$$(command -v gn) -elif [[ $${PLATFORM} == "Darwin-x86_64" ]]; then - gn=buildtools/mac/gn -elif [[ $${PLATFORM} == "Darwin-arm64" ]]; then - gn=buildtools/mac-arm64/gn -elif [[ $${PLATFORM} == "Linux-x86_64" ]]; then - gn=buildtools/linux64/gn -elif [[ $${PLATFORM} == "Linux-aarch64" ]]; then - gn=buildtools/linux-arm64/gn -elif [[ $${PLATFORM} == MSYS_NT-*-x86_64 ]]; then - gn=buildtools/win/gn.exe -else - # Fallback to system default. - gn=$$(command -v gn) -fi - -# Select ninja tool for the current platform. -if [[ $${SYSTEM} == "Darwin" ]]; then - ninja=third_party/depot_tools/ninja-mac -elif [[ $${PLATFORM} == "Linux-x86_64" ]]; then - ninja=third_party/depot_tools/ninja-linux64 -elif [[ $${PLATFORM} == MSYS_NT-*-x86_64 ]]; then - ninja=third_party/depot_tools/ninja.exe -else - # Fallback to system default. - ninja=$$(command -v ninja) -fi - -# Build wee8. -"$$gn" gen out/wee8 --args="$$WEE8_BUILD_ARGS" -"$$ninja" -C out/wee8 wee8 - -# Move compiled library to the expected destinations. -popd -mv $$ROOT/out/wee8/obj/libwee8.a $(execpath libwee8.a) diff --git a/bazel/external/wee8.patch b/bazel/external/wee8.patch deleted file mode 100644 index 94b381da78333..0000000000000 --- a/bazel/external/wee8.patch +++ /dev/null @@ -1,210 +0,0 @@ -# 1. Fix linking with unbundled toolchain on macOS. -# 3. Fix linking with MSAN. -# 4. Fix build with LLVM/Clang versions older than 13.0.0. ---- build/toolchain/gcc_toolchain.gni -+++ build/toolchain/gcc_toolchain.gni -@@ -381,6 +381,8 @@ template("gcc_toolchain") { - # AIX does not support either -D (deterministic output) or response - # files. - command = "$ar -X64 {{arflags}} -r -c -s {{output}} {{inputs}}" -+ } else if (current_os == "mac") { -+ command = "\"$ar\" {{arflags}} -r -c -s {{output}} {{inputs}}" - } else { - rspfile = "{{output}}.rsp" - rspfile_content = "{{inputs}}" -@@ -595,7 +597,7 @@ template("gcc_toolchain") { - - start_group_flag = "" - end_group_flag = "" -- if (current_os != "aix") { -+ if (current_os != "aix" && current_os != "mac") { - # the "--start-group .. --end-group" feature isn't available on the aix ld. - start_group_flag = "-Wl,--start-group" - end_group_flag = "-Wl,--end-group " ---- build/config/sanitizers/sanitizers.gni -+++ build/config/sanitizers/sanitizers.gni -@@ -158,7 +158,7 @@ if (!is_a_target_toolchain) { - # standard system libraries. We have instrumented system libraries for msan, - # which requires them to prevent false positives. - # TODO(thakis): Maybe remove this variable. --use_prebuilt_instrumented_libraries = is_msan -+use_prebuilt_instrumented_libraries = false - - # Whether we are doing a fuzzer build. Normally this should be checked instead - # of checking "use_libfuzzer || use_afl" because often developers forget to -@@ -207,8 +207,7 @@ assert(!using_sanitizer || is_clang, - assert(!is_cfi || is_clang, - "is_cfi requires setting is_clang = true in 'gn args'") - --prebuilt_instrumented_libraries_available = -- is_msan && (msan_track_origins == 0 || msan_track_origins == 2) -+prebuilt_instrumented_libraries_available = false - - if (use_libfuzzer && (is_linux || is_chromeos)) { - if (is_asan) { ---- build/config/compiler/BUILD.gn -+++ build/config/compiler/BUILD.gn -@@ -1253,19 +1253,12 @@ config("compiler_deterministic") { - # different build directory like "out/feature_a" and "out/feature_b" if - # we build same files with same compile flag. - # Other paths are already given in relative, no need to normalize them. -- if (is_nacl) { -- # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. -- cflags += [ -- "-Xclang", -- "-fdebug-compilation-dir", -- "-Xclang", -- ".", -- ] -- } else { -- # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= -- # and -fcoverage-compilation-dir=. -- cflags += [ "-ffile-compilation-dir=." ] -- } -+ cflags += [ -+ "-Xclang", -+ "-fdebug-compilation-dir", -+ "-Xclang", -+ ".", -+ ] - if (!is_win) { - # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) - asmflags = [ "-Wa,-fdebug-compilation-dir,." ] ---- build/config/sanitizers/BUILD.gn -+++ build/config/sanitizers/BUILD.gn -@@ -272,11 +272,11 @@ config("asan_flags") { - if (is_asan) { - cflags += [ "-fsanitize=address" ] - if (is_win) { -- if (!defined(asan_win_blocklist_path)) { -- asan_win_blocklist_path = -+ if (!defined(asan_win_blacklist_path)) { -+ asan_win_blacklist_path = - rebase_path("//tools/memory/asan/blocklist_win.txt", root_build_dir) - } -- cflags += [ "-fsanitize-ignorelist=$asan_win_blocklist_path" ] -+ cflags += [ "-fsanitize-blacklist=$asan_win_blacklist_path" ] - } - } - } -@@ -306,13 +306,13 @@ config("link_shared_library") { - config("cfi_flags") { - cflags = [] - if (is_cfi && current_toolchain == default_toolchain) { -- if (!defined(cfi_ignorelist_path)) { -- cfi_ignorelist_path = -+ if (!defined(cfi_blacklist_path)) { -+ cfi_blacklist_path = - rebase_path("//tools/cfi/ignores.txt", root_build_dir) - } - cflags += [ - "-fsanitize=cfi-vcall", -- "-fsanitize-ignorelist=$cfi_ignorelist_path", -+ "-fsanitize-blacklist=$cfi_blacklist_path", - ] - - if (use_cfi_cast) { -@@ -409,14 +409,14 @@ config("msan_flags") { - if (is_msan) { - assert(is_linux || is_chromeos, - "msan only supported on linux x86_64/ChromeOS") -- if (!defined(msan_ignorelist_path)) { -- msan_ignorelist_path = -- rebase_path("//tools/msan/ignorelist.txt", root_build_dir) -+ if (!defined(msan_blacklist_path)) { -+ msan_blacklist_path = -+ rebase_path("//tools/msan/ignorelist.txt", root_build_dir) - } - cflags = [ - "-fsanitize=memory", - "-fsanitize-memory-track-origins=$msan_track_origins", -- "-fsanitize-ignorelist=$msan_ignorelist_path", -+ "-fsanitize-blacklist=$msan_blacklist_path", - ] - } - } -@@ -424,13 +424,13 @@ config("msan_flags") { - config("tsan_flags") { - if (is_tsan) { - assert(is_linux || is_chromeos, "tsan only supported on linux x86_64") -- if (!defined(tsan_ignorelist_path)) { -- tsan_ignorelist_path = -+ if (!defined(tsan_blacklist_path)) { -+ tsan_blacklist_path = - rebase_path("//tools/memory/tsan_v2/ignores.txt", root_build_dir) - } - cflags = [ - "-fsanitize=thread", -- "-fsanitize-ignorelist=$tsan_ignorelist_path", -+ "-fsanitize-blacklist=$tsan_blacklist_path", - ] - } - } -@@ -438,8 +438,8 @@ config("tsan_flags") { - config("ubsan_flags") { - cflags = [] - if (is_ubsan) { -- if (!defined(ubsan_ignorelist_path)) { -- ubsan_ignorelist_path = -+ if (!defined(ubsan_blacklist_path)) { -+ ubsan_blacklist_path = - rebase_path("//tools/ubsan/ignorelist.txt", root_build_dir) - } - cflags += [ -@@ -456,7 +456,7 @@ config("ubsan_flags") { - "-fsanitize=signed-integer-overflow", - "-fsanitize=unreachable", - "-fsanitize=vla-bound", -- "-fsanitize-ignorelist=$ubsan_ignorelist_path", -+ "-fsanitize-blacklist=$ubsan_blacklist_path", - ] - - # Chromecast ubsan builds fail to compile with these -@@ -486,8 +486,8 @@ config("ubsan_no_recover") { - - config("ubsan_security_flags") { - if (is_ubsan_security) { -- if (!defined(ubsan_security_ignorelist_path)) { -- ubsan_security_ignorelist_path = -+ if (!defined(ubsan_security_blacklist_path)) { -+ ubsan_security_blacklist_path = - rebase_path("//tools/ubsan/security_ignorelist.txt", root_build_dir) - } - cflags = [ -@@ -495,7 +495,7 @@ config("ubsan_security_flags") { - "-fsanitize=shift", - "-fsanitize=signed-integer-overflow", - "-fsanitize=vla-bound", -- "-fsanitize-ignorelist=$ubsan_security_ignorelist_path", -+ "-fsanitize-blacklist=$ubsan_security_blacklist_path", - ] - } - } -@@ -508,13 +508,13 @@ config("ubsan_null_flags") { - - config("ubsan_vptr_flags") { - if (is_ubsan_vptr) { -- if (!defined(ubsan_vptr_ignorelist_path)) { -- ubsan_vptr_ignorelist_path = -+ if (!defined(ubsan_vptr_blacklist_path)) { -+ ubsan_vptr_blacklist_path = - rebase_path("//tools/ubsan/vptr_ignorelist.txt", root_build_dir) - } - cflags = [ - "-fsanitize=vptr", -- "-fsanitize-ignorelist=$ubsan_vptr_ignorelist_path", -+ "-fsanitize-blacklist=$ubsan_vptr_blacklist_path", - ] - } - } ---- build/config/clang/BUILD.gn -+++ build/config/clang/BUILD.gn -@@ -5,7 +5,7 @@ - import("clang.gni") - - config("find_bad_constructs") { -- if (clang_use_chrome_plugins) { -+ if (false) { - cflags = [] - - # The plugin is built directly into clang, so there's no need to load it diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 11899299e78e3..ae048e6006128 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -189,7 +189,9 @@ def envoy_dependencies(skip_targets = []): _io_opencensus_cpp() _com_github_curl() _com_github_envoyproxy_sqlparser() - _com_googlesource_chromium_v8() + _v8() + _com_googlesource_chromium_base_trace_event_common() + _com_googlesource_chromium_zlib() _com_github_google_quiche() _com_googlesource_googleurl() _com_lightstep_tracer_cpp() @@ -781,16 +783,35 @@ cc_library(name = "curl", visibility = ["//visibility:public"], deps = ["@envoy/ actual = "@envoy//bazel/foreign_cc:curl", ) -def _com_googlesource_chromium_v8(): - external_genrule_repository( - name = "com_googlesource_chromium_v8", - genrule_cmd_file = "@envoy//bazel/external:wee8.genrule_cmd", - build_file = "@envoy//bazel/external:wee8.BUILD", - patches = ["@envoy//bazel/external:wee8.patch"], +def _v8(): + external_http_archive( + name = "v8", + patches = ["@envoy//bazel:v8.patch"], + patch_args = ["-p1"], ) native.bind( name = "wee8", - actual = "@com_googlesource_chromium_v8//:wee8", + actual = "@v8//:wee8", + ) + +def _com_googlesource_chromium_base_trace_event_common(): + external_http_archive( + name = "com_googlesource_chromium_base_trace_event_common", + build_file = "@v8//:bazel/BUILD.trace_event_common", + ) + native.bind( + name = "base_trace_event_common", + actual = "@com_googlesource_chromium_base_trace_event_common//:trace_event_common", + ) + +def _com_googlesource_chromium_zlib(): + external_http_archive( + name = "com_googlesource_chromium_zlib", + build_file = "@v8//:bazel/BUILD.zlib", + ) + native.bind( + name = "zlib_compression_utils", + actual = "@com_googlesource_chromium_zlib//:zlib_compression_utils", ) def _com_github_google_quiche(): diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index e279553d51a3c..0d9df8937251b 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -790,21 +790,50 @@ REPOSITORY_LOCATIONS_SPEC = dict( release_date = "2022-01-05", cpe = "cpe:2.3:a:haxx:libcurl:*", ), - com_googlesource_chromium_v8 = dict( + v8 = dict( project_name = "V8", project_desc = "Google’s open source high-performance JavaScript and WebAssembly engine, written in C++", project_url = "https://v8.dev", - version = "9.9.115.3", - # This archive was created using https://storage.googleapis.com/envoyproxy-wee8/wee8-archive.sh - # and contains complete checkout of V8 with all dependencies necessary to build wee8. - sha256 = "4f4353928d10adbc07503edcb7dbd5a20981de669225dcffc450472cbfb179c2", - urls = ["https://storage.googleapis.com/envoyproxy-wee8/wee8-{version}.tar.gz"], - strip_prefix = "wee8", + # NOTE: Update together with com_googlesource_chromium_base_trace_event_common and com_googlesource_chromium_zlib. + version = "9.9.115.5", + # Static snapshot created using https://storage.googleapis.com/envoyproxy-wee8/wee8-fetch-deps.sh. + sha256 = "60a6759069350571b24b65eb88c2c1908afed2b938dae6a92b305924f3b64e84", + urls = ["https://storage.googleapis.com/envoyproxy-wee8/v8-{version}.tar.gz"], use_category = ["dataplane_ext"], extensions = ["envoy.wasm.runtime.v8"], - release_date = "2022-01-24", + release_date = "2022-01-31", cpe = "cpe:2.3:a:google:v8:*", ), + com_googlesource_chromium_base_trace_event_common = dict( + project_name = "Chromium's trace event headers", + project_desc = "Chromium's trace event headers", + project_url = "https://chromium.googlesource.com/chromium/src/base/trace_event/common/", + # NOTE: Update together with v8 and com_googlesource_chromium_zlib. + # Use version and sha256 from https://storage.googleapis.com/envoyproxy-wee8/v8--deps.sha256. + version = "7f36dbc19d31e2aad895c60261ca8f726442bfbb", + # Static snapshot created using https://storage.googleapis.com/envoyproxy-wee8/wee8-fetch-deps.sh. + sha256 = "4e9f31f393ea87bf3987f9a5e3b1d8314ad45f00e5a79c61cdcc1ef1eed2f05b", + urls = ["https://storage.googleapis.com/envoyproxy-wee8/chromium-base_trace_event_common-{version}.tar.gz"], + use_category = ["dataplane_ext"], + extensions = ["envoy.wasm.runtime.v8"], + release_date = "2021-10-27", + cpe = "N/A", + ), + com_googlesource_chromium_zlib = dict( + project_name = "Chromium's zlib", + project_desc = "Chromium’s fork of zlib with compression utils", + project_url = "https://chromium.googlesource.com/chromium/src/third_party/zlib/", + # NOTE: Update together with v8 and com_googlesource_chromium_base_trace_event_common. + # Use version and sha256 from https://storage.googleapis.com/envoyproxy-wee8/v8--deps.sha256. + version = "fc5cfd78a357d5bb7735a58f383634faaafe706a", + # Static snapshot created using https://storage.googleapis.com/envoyproxy-wee8/wee8-fetch-deps.sh. + sha256 = "695c73750cf6472fc6c926e43952262206f1475157377364142bdbb84a1a5a83", + urls = ["https://storage.googleapis.com/envoyproxy-wee8/chromium-zlib-{version}.tar.gz"], + use_category = ["dataplane_ext"], + extensions = ["envoy.wasm.runtime.v8"], + release_date = "2022-01-12", + cpe = "N/A", + ), com_github_google_quiche = dict( project_name = "QUICHE", project_desc = "QUICHE (QUIC, HTTP/2, Etc) is Google‘s implementation of QUIC and related protocols", diff --git a/bazel/v8.patch b/bazel/v8.patch new file mode 100644 index 0000000000000..306530b1126b5 --- /dev/null +++ b/bazel/v8.patch @@ -0,0 +1,56 @@ +# 1. Use already imported python dependencies. +# 2. Fix the include path for //external:zlib. +# 3. Add support for --define=no_debug_info=1. +# 4. Disable pointer compression (https://crbug.com/v8/12592). + +diff --git a/BUILD.bazel b/BUILD.bazel +index 1cc0121e60..dedc78fbb0 100644 +--- a/BUILD.bazel ++++ b/BUILD.bazel +@@ -4,7 +4,7 @@ + + load("@bazel_skylib//lib:selects.bzl", "selects") + load("@rules_python//python:defs.bzl", "py_binary") +-load("@v8_python_deps//:requirements.bzl", "requirement") ++load("@base_pip3//:requirements.bzl", "requirement") + load( + "@v8//:bazel/defs.bzl", + "v8_binary", +@@ -161,7 +161,7 @@ v8_int( + # If no explicit value for v8_enable_pointer_compression, we set it to 'none'. + v8_string( + name = "v8_enable_pointer_compression", +- default = "none", ++ default = "False", + ) + + # Default setting for v8_enable_pointer_compression. +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index 0e9559a65f..fa0c460c48 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -151,6 +151,11 @@ def _default_args(): + "-fno-integrated-as", + ], + "//conditions:default": [], ++ }) + select({ ++ "@envoy//bazel:no_debug_info": [ ++ "-g0", ++ ], ++ "//conditions:default": [], + }), + includes = ["include"], + linkopts = select({ +diff --git a/src/snapshot/snapshot-utils.cc b/src/snapshot/snapshot-utils.cc +index 6db6698d7e..b56d31085f 100644 +--- a/src/snapshot/snapshot-utils.cc ++++ b/src/snapshot/snapshot-utils.cc +@@ -5,7 +5,7 @@ + #include "src/snapshot/snapshot-utils.h" + + #include "src/base/sanitizer/msan.h" +-#include "third_party/zlib/zlib.h" ++#include "zlib.h" + + namespace v8 { + namespace internal {