Skip to content
Open
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 @@
6.5.0
7.7.1
1 change: 1 addition & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
run: |
bazel run //bazel/cargo/wasmsign:crates_vendor
bazel run //bazel/cargo/wasmtime:crates_vendor
perl -pi -e 's/rust_library/rust_static_library/g' bazel/cargo/wasmtime/remote/BUILD.wasmtime-c-api-impl-*.bazel
git diff --exit-code

clang_format:
Expand Down
62 changes: 1 addition & 61 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ cc_library(
name = "wasmtime_lib",
srcs = [
"src/common/types.h",
"src/wasmtime/types.h",
"src/wasmtime/wasmtime.cc",
],
hdrs = ["include/proxy-wasm/wasmtime.h"],
Expand All @@ -197,6 +196,7 @@ cc_library(
"PROXY_WASM_HAS_RUNTIME_WASMTIME",
"PROXY_WASM_HOST_ENGINE_WASMTIME",
],
includes = ["@com_github_bytecodealliance_wasmtime//:wasmtime_lib"],
# See: https://bytecodealliance.github.io/wasmtime/c-api/
linkopts = select({
"@platforms//os:macos": [],
Expand All @@ -221,65 +221,6 @@ cc_library(
],
)

genrule(
name = "prefixed_wasmtime_sources",
srcs = [
"src/wasmtime/types.h",
"src/wasmtime/wasmtime.cc",
],
outs = [
"src/wasmtime/prefixed_types.h",
"src/wasmtime/prefixed_wasmtime.cc",
],
cmd = """
for file in $(SRCS); do
sed -e 's/wasm_/wasmtime_wasm_/g' \
-e 's/include\\/wasm.h/include\\/prefixed_wasm.h/g' \
-e 's/wasmtime\\/types.h/wasmtime\\/prefixed_types.h/g' \
$$file >$(@D)/$$(dirname $$file)/prefixed_$$(basename $$file)
done
""",
)

cc_library(
name = "prefixed_wasmtime_lib",
srcs = [
"src/common/types.h",
"src/wasmtime/prefixed_types.h",
"src/wasmtime/prefixed_wasmtime.cc",
],
hdrs = ["include/proxy-wasm/wasmtime.h"],
copts = [
"-DWASM_API_EXTERN=",
],
defines = [
"PROXY_WASM_HAS_RUNTIME_WASMTIME",
"PROXY_WASM_HOST_ENGINE_WASMTIME",
],
# See: https://bytecodealliance.github.io/wasmtime/c-api/
linkopts = select({
"@platforms//os:macos": [],
"@platforms//os:windows": [
"ws2_32.lib",
"advapi32.lib",
"userenv.lib",
"ntdll.lib",
"shell32.lib",
"ole32.lib",
"bcrypt.lib",
],
"//conditions:default": [
"-ldl",
"-lm",
"-lpthread",
],
}),
deps = [
":wasm_vm_headers",
"//external:prefixed_wasmtime",
],
)

cc_library(
name = "lib",
deps = [
Expand All @@ -294,6 +235,5 @@ cc_library(
[":wasmedge_lib"],
) + proxy_wasm_select_engine_wasmtime(
[":wasmtime_lib"],
[":prefixed_wasmtime_lib"],
),
)
11 changes: 10 additions & 1 deletion bazel/cargo/wasmsign/remote/BUILD.ansi_term-0.12.1.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
# bazel run @//bazel/cargo/wasmsign:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_toml_env_vars")
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

cargo_toml_env_vars(
name = "cargo_toml_env_vars",
src = "Cargo.toml",
)

rust_library(
name = "ansi_term",
srcs = glob(
include = ["**/*.rs"],
allow_empty = False,
allow_empty = True,
),
compile_data = glob(
include = ["**"],
Expand All @@ -30,6 +36,9 @@ rust_library(
),
crate_root = "src/lib.rs",
edition = "2015",
rustc_env_files = [
":cargo_toml_env_vars",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand Down
39 changes: 34 additions & 5 deletions bazel/cargo/wasmsign/remote/BUILD.anyhow-1.0.86.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,25 @@
# bazel run @//bazel/cargo/wasmsign:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
load(
"@rules_rust//cargo:defs.bzl",
"cargo_build_script",
"cargo_toml_env_vars",
)
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

cargo_toml_env_vars(
name = "cargo_toml_env_vars",
src = "Cargo.toml",
)

rust_library(
name = "anyhow",
srcs = glob(
include = ["**/*.rs"],
allow_empty = False,
allow_empty = True,
),
compile_data = glob(
include = ["**"],
Expand All @@ -35,6 +44,9 @@ rust_library(
],
crate_root = "src/lib.rs",
edition = "2018",
rustc_env_files = [
":cargo_toml_env_vars",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand All @@ -52,10 +64,23 @@ rust_library(
)

cargo_build_script(
name = "anyhow_bs",
name = "_bs",
srcs = glob(
include = ["**/*.rs"],
allow_empty = False,
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
"**/*.rs",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"default",
Expand All @@ -76,6 +101,10 @@ cargo_build_script(
],
),
edition = "2018",
pkg_name = "anyhow",
rustc_env_files = [
":cargo_toml_env_vars",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand All @@ -92,6 +121,6 @@ cargo_build_script(

alias(
name = "build_script_build",
actual = ":anyhow_bs",
actual = ":_bs",
tags = ["manual"],
)
29 changes: 22 additions & 7 deletions bazel/cargo/wasmsign/remote/BUILD.atty-0.2.14.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
# bazel run @//bazel/cargo/wasmsign:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_toml_env_vars")
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

cargo_toml_env_vars(
name = "cargo_toml_env_vars",
src = "Cargo.toml",
)

rust_library(
name = "atty",
srcs = glob(
include = ["**/*.rs"],
allow_empty = False,
allow_empty = True,
),
compile_data = glob(
include = ["**"],
Expand All @@ -30,6 +36,9 @@ rust_library(
),
crate_root = "src/lib.rs",
edition = "2015",
rustc_env_files = [
":cargo_toml_env_vars",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand All @@ -51,15 +60,15 @@ rust_library(
"@rules_rust//rust/platform:aarch64-apple-ios-sim": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:aarch64-fuchsia": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:aarch64-linux-android": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:aarch64-pc-windows-msvc": [
"@cu__winapi-0.3.9//:winapi", # cfg(windows)
],
"@rules_rust//rust/platform:aarch64-unknown-fuchsia": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
Expand Down Expand Up @@ -96,16 +105,19 @@ rust_library(
"@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:riscv64gc-unknown-linux-gnu": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:s390x-unknown-linux-gnu": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:x86_64-apple-darwin": [
"@rules_rust//rust/platform:wasm32-unknown-emscripten": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:x86_64-apple-ios": [
"@rules_rust//rust/platform:x86_64-apple-darwin": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:x86_64-fuchsia": [
"@rules_rust//rust/platform:x86_64-apple-ios": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:x86_64-linux-android": [
Expand All @@ -117,6 +129,9 @@ rust_library(
"@rules_rust//rust/platform:x86_64-unknown-freebsd": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:x86_64-unknown-fuchsia": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
"@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [
"@cu__libc-0.2.155//:libc", # cfg(unix)
],
Expand Down
6 changes: 6 additions & 0 deletions bazel/cargo/wasmsign/remote/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ filegroup(
)

# Workspace Member Dependencies
alias(
name = "wasmsign-0.1.2",
actual = "@cu__wasmsign-0.1.2//:wasmsign",
tags = ["manual"],
)

alias(
name = "wasmsign",
actual = "@cu__wasmsign-0.1.2//:wasmsign",
Expand Down
11 changes: 10 additions & 1 deletion bazel/cargo/wasmsign/remote/BUILD.bitflags-1.3.2.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
# bazel run @//bazel/cargo/wasmsign:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_toml_env_vars")
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

cargo_toml_env_vars(
name = "cargo_toml_env_vars",
src = "Cargo.toml",
)

rust_library(
name = "bitflags",
srcs = glob(
include = ["**/*.rs"],
allow_empty = False,
allow_empty = True,
),
compile_data = glob(
include = ["**"],
Expand All @@ -33,6 +39,9 @@ rust_library(
],
crate_root = "src/lib.rs",
edition = "2018",
rustc_env_files = [
":cargo_toml_env_vars",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand Down
11 changes: 10 additions & 1 deletion bazel/cargo/wasmsign/remote/BUILD.byteorder-1.5.0.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,21 @@
# bazel run @//bazel/cargo/wasmsign:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_toml_env_vars")
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

cargo_toml_env_vars(
name = "cargo_toml_env_vars",
src = "Cargo.toml",
)

rust_library(
name = "byteorder",
srcs = glob(
include = ["**/*.rs"],
allow_empty = False,
allow_empty = True,
),
compile_data = glob(
include = ["**"],
Expand All @@ -34,6 +40,9 @@ rust_library(
],
crate_root = "src/lib.rs",
edition = "2021",
rustc_env_files = [
":cargo_toml_env_vars",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand Down
Loading
Loading