Skip to content
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
10 changes: 9 additions & 1 deletion bazel/dependencies.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,19 @@
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@proxy_wasm_cpp_host//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_fetch_remote_crates")
load("@rules_python//python:pip.bzl", "pip_install")
load("@rules_rust//rust:repositories.bzl", "rust_repositories")
load("@rules_rust//rust:repositories.bzl", "rust_repositories", "rust_repository_set")

def proxy_wasm_cpp_host_dependencies():
protobuf_deps()

rust_repositories()
rust_repository_set(
name = "rust_linux_s390x",
exec_triple = "s390x-unknown-linux-gnu",
extra_target_triples = ["wasm32-unknown-unknown", "wasm32-wasi"],
version = "1.57.0",
)

proxy_wasm_cpp_host_fetch_remote_crates()

pip_install(
Expand Down
1 change: 1 addition & 0 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ def proxy_wasm_cpp_host_repositories():
name = "rules_rust",
sha256 = "8a2052e8ec707aa04a6b9e72bfc67fea44e915ecab1d2d0a4835ad51c2410c36",
strip_prefix = "rules_rust-b16c26ba5faf1c58ebe94582afd20567ce676e6d",
# NOTE: Update Rust version for Linux/s390x in bazel/dependencies.bzl.
url = "https://github.com/bazelbuild/rules_rust/archive/b16c26ba5faf1c58ebe94582afd20567ce676e6d.tar.gz",
)

Expand Down
7 changes: 6 additions & 1 deletion bazel/wasm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ wasi_rust_binary_rule = rule(
attrs = _wasm_attrs(wasi_rust_transition),
)

def wasm_rust_binary(name, tags = [], wasi = False, signing_key = [], **kwargs):
def wasm_rust_binary(name, tags = [], wasi = False, signing_key = [], rustc_flags = [], **kwargs):
wasm_name = "_wasm_" + name.replace(".", "_")
kwargs.setdefault("visibility", ["//visibility:public"])

Expand All @@ -87,6 +87,11 @@ def wasm_rust_binary(name, tags = [], wasi = False, signing_key = [], **kwargs):
crate_type = "cdylib",
out_binary = True,
tags = ["manual"],
# Rust doesn't distribute rust-lld for Linux/s390x.
rustc_flags = rustc_flags + select({
"//bazel:linux_s390x": ["-C", "linker=/usr/bin/lld"],
"//conditions:default": [],
}),
**kwargs
)

Expand Down