Skip to content

Commit bab2ef1

Browse files
authored
Update Bazel to v5.0.0. (#235)
Signed-off-by: Piotr Sikora <[email protected]>
1 parent b42c336 commit bab2ef1

File tree

5 files changed

+51
-3
lines changed

5 files changed

+51
-3
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.2.2
1+
5.0.0

.github/workflows/cpp.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ jobs:
103103
os: ubuntu-20.04
104104
arch: aarch64
105105
action: build
106-
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
106+
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
107107
- name: 'Wasmtime on Linux/s390x'
108108
runtime: 'wasmtime'
109109
repo: 'com_github_bytecodealliance_wasmtime'
110110
os: ubuntu-20.04
111111
arch: s390x
112112
action: build
113-
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
113+
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
114114
- name: 'Wasmtime on macOS/x86_64'
115115
runtime: 'wasmtime'
116116
repo: 'com_github_bytecodealliance_wasmtime'

bazel/external/llvm.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Workaround for different linkers used in cmake()'s generate and build steps.
2+
# See: https://github.com/bazelbuild/rules_foreign_cc/issues/863
3+
4+
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
5+
index 5d4d692a70ac..0a2e441b1b94 100644
6+
--- a/cmake/modules/HandleLLVMOptions.cmake
7+
+++ b/cmake/modules/HandleLLVMOptions.cmake
8+
@@ -843,14 +843,6 @@ if (UNIX AND
9+
append("-fdiagnostics-color" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
10+
endif()
11+
12+
-# lld doesn't print colored diagnostics when invoked from Ninja
13+
-if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
14+
- include(CheckLinkerFlag)
15+
- check_linker_flag("-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS)
16+
- append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics"
17+
- CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
18+
-endif()
19+
-
20+
# Add flags for add_dead_strip().
21+
# FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF?
22+
# But MinSizeRel seems to add that automatically, so maybe disable these

bazel/external/llvm13.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Workaround for different linkers used in cmake()'s generate and build steps.
2+
# See: https://github.com/bazelbuild/rules_foreign_cc/issues/863
3+
4+
diff --git a/cmake/modules/HandleLLVMOptions.cmake b/cmake/modules/HandleLLVMOptions.cmake
5+
index 0c3419390c27..352e9402d808 100644
6+
--- a/cmake/modules/HandleLLVMOptions.cmake
7+
+++ b/cmake/modules/HandleLLVMOptions.cmake
8+
@@ -917,14 +917,6 @@ if (UNIX AND
9+
append("-fdiagnostics-color" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
10+
endif()
11+
12+
-# lld doesn't print colored diagnostics when invoked from Ninja
13+
-if (UNIX AND CMAKE_GENERATOR STREQUAL "Ninja")
14+
- include(LLVMCheckLinkerFlag)
15+
- llvm_check_linker_flag(CXX "-Wl,--color-diagnostics" LINKER_SUPPORTS_COLOR_DIAGNOSTICS)
16+
- append_if(LINKER_SUPPORTS_COLOR_DIAGNOSTICS "-Wl,--color-diagnostics"
17+
- CMAKE_EXE_LINKER_FLAGS CMAKE_MODULE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
18+
-endif()
19+
-
20+
# Add flags for add_dead_strip().
21+
# FIXME: With MSVS, consider compiling with /Gy and linking with /OPT:REF?
22+
# But MinSizeRel seems to add that automatically, so maybe disable these

bazel/repositories.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,8 @@ def proxy_wasm_cpp_host_repositories():
162162
sha256 = "408d11708643ea826f519ff79761fcdfc12d641a2510229eec459e72f8163020",
163163
strip_prefix = "llvm-13.0.0.src",
164164
url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/llvm-13.0.0.src.tar.xz",
165+
patches = ["@proxy_wasm_cpp_host//bazel/external:llvm13.patch"],
166+
patch_args = ["-p1"],
165167
)
166168

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

0 commit comments

Comments
 (0)