Skip to content

Update Bazel to v5.0.0. #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.2
5.0.0
4 changes: 2 additions & 2 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ jobs:
os: ubuntu-20.04
arch: aarch64
action: build
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/arm64 piotrsikora/build-tools:bazel-4.2.2-clang-13-gcc-11
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/arm64 piotrsikora/build-tools:bazel-5.0.0-clang-13-gcc-11
- name: 'Wasmtime on Linux/s390x'
runtime: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
os: ubuntu-20.04
arch: s390x
action: build
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-4.2.2-clang-13-gcc-11
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-5.0.0-clang-13-gcc-11
- name: 'Wasmtime on macOS/x86_64'
runtime: 'wasmtime'
repo: 'com_github_bytecodealliance_wasmtime'
Expand Down
22 changes: 22 additions & 0 deletions bazel/external/llvm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Workaround for different linkers used in cmake()'s generate and build steps.
# See: https://github.com/bazelbuild/rules_foreign_cc/issues/863

diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 5d4d692a70ac..0a2e441b1b94 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -843,14 +843,6 @@ if (UNIX AND
append("-fdiagnostics-color" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()

-# lld doesn't print colored diagnostics when invoked from Ninja
-if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
- include(CheckLinkerFlag)
- check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS)
- append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics"
- CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-endif()
-
# Add flags for add_dead_strip().
# FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF?
# But MinSizeRel seems to add that automatically, so maybe disable these
22 changes: 22 additions & 0 deletions bazel/external/llvm13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Workaround for different linkers used in cmake()'s generate and build steps.
# See: https://github.com/bazelbuild/rules_foreign_cc/issues/863

diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
index 0c3419390c27..352e9402d808 100644
--- a/cmake/modules/HandleLLVMOptions.cmake
+++ b/cmake/modules/HandleLLVMOptions.cmake
@@ -917,14 +917,6 @@ if (UNIX AND
append("-fdiagnostics-color" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
endif()

-# lld doesn't print colored diagnostics when invoked from Ninja
-if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
- include(LLVMCheckLinkerFlag)
- llvm_check_linker_flag(CXX "-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS)
- append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics"
- CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
-endif()
-
# Add flags for add_dead_strip().
# FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF?
# But MinSizeRel seems to add that automatically, so maybe disable these
4 changes: 4 additions & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ def proxy_wasm_cpp_host_repositories():
sha256 = "408d11708643ea826f519ff79761fcdfc12d641a2510229eec459e72f8163020",
strip_prefix = "llvm-13.0.0.src",
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz",
patches = ["@proxy_wasm_cpp_host//bazel/external:llvm13.patch"],
patch_args = ["-p1"],
)

# Wasmtime with dependencies.
Expand Down Expand Up @@ -214,4 +216,6 @@ def proxy_wasm_cpp_host_repositories():
sha256 = "7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf",
strip_prefix = "llvm-12.0.1.src",
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-12.0.1.src.tar.xz",
patches = ["@proxy_wasm_cpp_host//bazel/external:llvm.patch"],
patch_args = ["-p1"],
)