From 445c935fba78ef2558b5142fd72d8f64bd4d5175 Mon Sep 17 00:00:00 2001 From: mathetake Date: Sun, 22 Nov 2020 13:52:10 +0900 Subject: [PATCH 1/6] Clean up WORKSPACE Signed-off-by: mathetake --- BUILD | 2 +- WORKSPACE | 88 ++---------------------------- bazel/BUILD | 0 bazel/dependencies.bzl | 73 +++++++++++++++++++++++++ bazel/dependencies_extra.bzl | 10 ++++ {test/test_data => bazel}/wasm.bzl | 0 test/BUILD | 2 +- test/test_data/BUILD | 2 +- 8 files changed, 90 insertions(+), 87 deletions(-) create mode 100644 bazel/BUILD create mode 100644 bazel/dependencies.bzl create mode 100644 bazel/dependencies_extra.bzl rename {test/test_data => bazel}/wasm.bzl (100%) diff --git a/BUILD b/BUILD index e9d434b2..fb9aaa44 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,4 @@ -load("//:bazel/variables.bzl", "COPTS", "LINKOPTS") +load("@proxy_wasm_cpp_host//bazel:variables.bzl", "COPTS", "LINKOPTS") licenses(["notice"]) # Apache 2 diff --git a/WORKSPACE b/WORKSPACE index 874d39b1..86a9b70c 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,89 +1,9 @@ workspace(name = "proxy_wasm_cpp_host") -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") +load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", proxy_wasm_cpp_host_dependencies = "dependencies") -git_repository( - name = "proxy_wasm_cpp_sdk", - commit = "1b5f69ce1535b0c21f88c4af4ebf0ec51d255abe", - remote = "https://github.com/proxy-wasm/proxy-wasm-cpp-sdk", -) +proxy_wasm_cpp_host_dependencies() -http_archive( - name = "com_google_absl", - sha256 = "19391fb4882601a65cb648d638c11aa301ce5f525ef02da1a9eafd22f72d7c59", - strip_prefix = "abseil-cpp-37dd2562ec830d547a1524bb306be313ac3f2556", - # 2020-01-29 - urls = ["https://github.com/abseil/abseil-cpp/archive/37dd2562ec830d547a1524bb306be313ac3f2556.tar.gz"], -) +load("@proxy_wasm_cpp_host//bazel:dependencies_extra.bzl", proxy_wasm_cpp_host_dependencies_extra = "dependencies_extra") -# required by com_google_protobuf -http_archive( - name = "bazel_skylib", - sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - ], -) - -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") - -bazel_skylib_workspace() - -# rust rules -http_archive( - name = "io_bazel_rules_rust", - sha256 = "7401878bf966325bbec5224eeb4ff7e8762681070b401acaa168da68d383563a", - strip_prefix = "rules_rust-9741a32e50a8c50c504c0931111bb6048d6d6888", - url = "https://github.com/bazelbuild/rules_rust/archive/9741a32e50a8c50c504c0931111bb6048d6d6888.tar.gz", -) - -load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") - -rust_repositories() - -load("@io_bazel_rules_rust//:workspace.bzl", "rust_workspace") - -rust_workspace() - -load("//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_raze__fetch_remote_crates") - -proxy_wasm_cpp_host_raze__fetch_remote_crates() - -git_repository( - name = "com_google_protobuf", - commit = "655310ca192a6e3a050e0ca0b7084a2968072260", - remote = "https://github.com/protocolbuffers/protobuf", - shallow_since = "1565024848 -0700", -) - -http_archive( - name = "boringssl", - sha256 = "bb55b0ed2f0cb548b5dce6a6b8307ce37f7f748eb9f1be6bfe2d266ff2b4d52b", - strip_prefix = "boringssl-2192bbc878822cf6ab5977d4257a1339453d9d39", - urls = ["https://github.com/google/boringssl/archive/2192bbc878822cf6ab5977d4257a1339453d9d39.tar.gz"], -) - -http_archive( - name = "com_google_googletest", - sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", - strip_prefix = "googletest-release-1.10.0", - urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], -) - -http_archive( - name = "wasmtime", - build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD", - sha256 = "7874feb1026bbef06796bd5ab80e73f15b8e83752bde8dc93994f5bc039a4952", - strip_prefix = "wasmtime-0.21.0", - url = "https://github.com/bytecodealliance/wasmtime/archive/v0.21.0.tar.gz", -) - -http_archive( - name = "wasm_c_api", - build_file = "@proxy_wasm_cpp_host//bazel/external:wasm-c-api.BUILD", - sha256 = "aea8cd095e9937f1e14f2c93e026317b197eb2345e7a817fe3932062eb7b792c", - strip_prefix = "wasm-c-api-d9a80099d496b5cdba6f3fe8fc77586e0e505ddc", - url = "https://github.com/WebAssembly/wasm-c-api/archive/d9a80099d496b5cdba6f3fe8fc77586e0e505ddc.tar.gz", -) +proxy_wasm_cpp_host_dependencies_extra() diff --git a/bazel/BUILD b/bazel/BUILD new file mode 100644 index 00000000..e69de29b diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl new file mode 100644 index 00000000..c75c9ffd --- /dev/null +++ b/bazel/dependencies.bzl @@ -0,0 +1,73 @@ +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def dependencies(): + _http_archives() + +def _http_archives(): + http_archive( + name = "proxy_wasm_cpp_sdk", + sha256 = "b97e3e716b1f38dc601487aa0bde72490bbc82b8f3ad73f1f3e69733984955df", + strip_prefix = "proxy-wasm-cpp-sdk-956f0d500c380cc1656a2d861b7ee12c2515a664", + urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/956f0d500c380cc1656a2d861b7ee12c2515a664.tar.gz"], + ) + + http_archive( + name = "boringssl", + sha256 = "bb55b0ed2f0cb548b5dce6a6b8307ce37f7f748eb9f1be6bfe2d266ff2b4d52b", + strip_prefix = "boringssl-2192bbc878822cf6ab5977d4257a1339453d9d39", + urls = ["https://github.com/google/boringssl/archive/2192bbc878822cf6ab5977d4257a1339453d9d39.tar.gz"], + ) + + http_archive( + name = "com_google_googletest", + sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", + strip_prefix = "googletest-release-1.10.0", + urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], + ) + + http_archive( + name = "wasmtime", + build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD", + sha256 = "7874feb1026bbef06796bd5ab80e73f15b8e83752bde8dc93994f5bc039a4952", + strip_prefix = "wasmtime-0.21.0", + url = "https://github.com/bytecodealliance/wasmtime/archive/v0.21.0.tar.gz", + ) + + http_archive( + name = "wasm_c_api", + build_file = "@proxy_wasm_cpp_host//bazel/external:wasm-c-api.BUILD", + sha256 = "aea8cd095e9937f1e14f2c93e026317b197eb2345e7a817fe3932062eb7b792c", + strip_prefix = "wasm-c-api-d9a80099d496b5cdba6f3fe8fc77586e0e505ddc", + url = "https://github.com/WebAssembly/wasm-c-api/archive/d9a80099d496b5cdba6f3fe8fc77586e0e505ddc.tar.gz", + ) + + http_archive( + name = "com_google_absl", + sha256 = "19391fb4882601a65cb648d638c11aa301ce5f525ef02da1a9eafd22f72d7c59", + strip_prefix = "abseil-cpp-37dd2562ec830d547a1524bb306be313ac3f2556", + # 2020-01-29 + urls = ["https://github.com/abseil/abseil-cpp/archive/37dd2562ec830d547a1524bb306be313ac3f2556.tar.gz"], + ) + + http_archive( + name = "io_bazel_rules_rust", + sha256 = "7401878bf966325bbec5224eeb4ff7e8762681070b401acaa168da68d383563a", + strip_prefix = "rules_rust-9741a32e50a8c50c504c0931111bb6048d6d6888", + url = "https://github.com/bazelbuild/rules_rust/archive/9741a32e50a8c50c504c0931111bb6048d6d6888.tar.gz", + ) + + http_archive( + name = "bazel_skylib", + sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", + urls = [ + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", + ], + ) + + http_archive( + name = "com_google_protobuf", + sha256 = "59621f4011a95df270748dcc0ec1cc51946473f0e140d4848a2f20c8719e43aa", + strip_prefix = "protobuf-655310ca192a6e3a050e0ca0b7084a2968072260", + url = "https://github.com/protocolbuffers/protobuf/archive/655310ca192a6e3a050e0ca0b7084a2968072260.tar.gz", + ) diff --git a/bazel/dependencies_extra.bzl b/bazel/dependencies_extra.bzl new file mode 100644 index 00000000..25aa15b3 --- /dev/null +++ b/bazel/dependencies_extra.bzl @@ -0,0 +1,10 @@ +load("@io_bazel_rules_rust//:workspace.bzl", "rust_workspace") +load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") +load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") +load("@proxy_wasm_cpp_host//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_raze__fetch_remote_crates") + +def dependencies_extra(): + bazel_skylib_workspace() + rust_repositories() + rust_workspace() + proxy_wasm_cpp_host_raze__fetch_remote_crates() diff --git a/test/test_data/wasm.bzl b/bazel/wasm.bzl similarity index 100% rename from test/test_data/wasm.bzl rename to bazel/wasm.bzl diff --git a/test/BUILD b/test/BUILD index 803e59e9..82daf715 100644 --- a/test/BUILD +++ b/test/BUILD @@ -1,5 +1,5 @@ load("@rules_cc//cc:defs.bzl", "cc_test") -load("//:bazel/variables.bzl", "COPTS", "LINKOPTS") +load("@proxy_wasm_cpp_host//bazel:variables.bzl", "COPTS", "LINKOPTS") cc_test( name = "null_vm_test", diff --git a/test/test_data/BUILD b/test/test_data/BUILD index d6797368..051f051c 100644 --- a/test/test_data/BUILD +++ b/test/test_data/BUILD @@ -1,4 +1,4 @@ -load("//test/test_data:wasm.bzl", "wasm_rust_binary") +load("@proxy_wasm_cpp_host//bazel:wasm.bzl", "wasm_rust_binary") package(default_visibility = ["//visibility:public"]) From f0529fed32ae836b0a4c66c40593e7a6cbaf9f43 Mon Sep 17 00:00:00 2001 From: mathetake Date: Sun, 22 Nov 2020 13:57:46 +0900 Subject: [PATCH 2/6] Style: add license Signed-off-by: mathetake --- bazel/dependencies.bzl | 14 ++++++++++++++ bazel/dependencies_extra.bzl | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index c75c9ffd..739ad2ba 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -1,3 +1,17 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def dependencies(): diff --git a/bazel/dependencies_extra.bzl b/bazel/dependencies_extra.bzl index 25aa15b3..2653c1fb 100644 --- a/bazel/dependencies_extra.bzl +++ b/bazel/dependencies_extra.bzl @@ -1,3 +1,17 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + load("@io_bazel_rules_rust//:workspace.bzl", "rust_workspace") load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") From 2e53e223509c07c406a5fcd61d396a0c392af5c0 Mon Sep 17 00:00:00 2001 From: mathetake Date: Sun, 22 Nov 2020 14:05:04 +0900 Subject: [PATCH 3/6] Style: explicit load of cc_library Signed-off-by: mathetake --- BUILD | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BUILD b/BUILD index fb9aaa44..840ccd3a 100644 --- a/BUILD +++ b/BUILD @@ -1,4 +1,5 @@ -load("@proxy_wasm_cpp_host//bazel:variables.bzl", "COPTS", "LINKOPTS") +load("@rules_cc//cc:defs.bzl", "cc_library") +load("@proxy_wasm_cpp_host//bazel:variables.bzl", "COPTS") licenses(["notice"]) # Apache 2 From b8c9f3de47a64030a73b8c38af519b2679e34ab7 Mon Sep 17 00:00:00 2001 From: mathetake Date: Fri, 4 Dec 2020 15:58:54 +0900 Subject: [PATCH 4/6] Review: update rules_rust Signed-off-by: mathetake --- bazel/dependencies.bzl | 15 +++------------ bazel/dependencies_extra.bzl | 4 ---- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index 739ad2ba..fe51cbb9 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -65,18 +65,9 @@ def _http_archives(): http_archive( name = "io_bazel_rules_rust", - sha256 = "7401878bf966325bbec5224eeb4ff7e8762681070b401acaa168da68d383563a", - strip_prefix = "rules_rust-9741a32e50a8c50c504c0931111bb6048d6d6888", - url = "https://github.com/bazelbuild/rules_rust/archive/9741a32e50a8c50c504c0931111bb6048d6d6888.tar.gz", - ) - - http_archive( - name = "bazel_skylib", - sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - ], + sha256 = "442a102e2a6f6c75e10d43f21c0c30218947a3e827d91529ced7380c5fec05f0", + strip_prefix = "rules_rust-39523e32ac0bd64f5d60154114a42e61e58ffd17", + url = "https://github.com/bazelbuild/rules_rust/archive/39523e32ac0bd64f5d60154114a42e61e58ffd17.tar.gz", ) http_archive( diff --git a/bazel/dependencies_extra.bzl b/bazel/dependencies_extra.bzl index 2653c1fb..e1cd987c 100644 --- a/bazel/dependencies_extra.bzl +++ b/bazel/dependencies_extra.bzl @@ -12,13 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@io_bazel_rules_rust//:workspace.bzl", "rust_workspace") load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") load("@proxy_wasm_cpp_host//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_raze__fetch_remote_crates") def dependencies_extra(): - bazel_skylib_workspace() rust_repositories() - rust_workspace() proxy_wasm_cpp_host_raze__fetch_remote_crates() From 6cbcc9017c88b01196b0525b0a96d00092ebb400 Mon Sep 17 00:00:00 2001 From: mathetake Date: Sun, 6 Dec 2020 20:59:15 +0900 Subject: [PATCH 5/6] Review: rename dependencies{,_extra}.bzl Signed-off-by: mathetake --- WORKSPACE | 8 ++-- bazel/dependencies.bzl | 68 +++----------------------------- bazel/dependencies_extra.bzl | 20 ---------- bazel/repositories.bzl | 75 ++++++++++++++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 87 deletions(-) delete mode 100644 bazel/dependencies_extra.bzl create mode 100644 bazel/repositories.bzl diff --git a/WORKSPACE b/WORKSPACE index 86a9b70c..77ecd3a0 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,9 +1,9 @@ workspace(name = "proxy_wasm_cpp_host") -load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", proxy_wasm_cpp_host_dependencies = "dependencies") +load("@proxy_wasm_cpp_host//bazel:repositories.bzl", "proxy_wasm_cpp_host_repositories") -proxy_wasm_cpp_host_dependencies() +proxy_wasm_cpp_host_repositories() -load("@proxy_wasm_cpp_host//bazel:dependencies_extra.bzl", proxy_wasm_cpp_host_dependencies_extra = "dependencies_extra") +load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", "proxy_wasm_cpp_host_dependencies") -proxy_wasm_cpp_host_dependencies_extra() +proxy_wasm_cpp_host_dependencies() diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index fe51cbb9..ef2163cf 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -12,67 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") +load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") +load("@proxy_wasm_cpp_host//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_raze__fetch_remote_crates") -def dependencies(): - _http_archives() - -def _http_archives(): - http_archive( - name = "proxy_wasm_cpp_sdk", - sha256 = "b97e3e716b1f38dc601487aa0bde72490bbc82b8f3ad73f1f3e69733984955df", - strip_prefix = "proxy-wasm-cpp-sdk-956f0d500c380cc1656a2d861b7ee12c2515a664", - urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/956f0d500c380cc1656a2d861b7ee12c2515a664.tar.gz"], - ) - - http_archive( - name = "boringssl", - sha256 = "bb55b0ed2f0cb548b5dce6a6b8307ce37f7f748eb9f1be6bfe2d266ff2b4d52b", - strip_prefix = "boringssl-2192bbc878822cf6ab5977d4257a1339453d9d39", - urls = ["https://github.com/google/boringssl/archive/2192bbc878822cf6ab5977d4257a1339453d9d39.tar.gz"], - ) - - http_archive( - name = "com_google_googletest", - sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", - strip_prefix = "googletest-release-1.10.0", - urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], - ) - - http_archive( - name = "wasmtime", - build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD", - sha256 = "7874feb1026bbef06796bd5ab80e73f15b8e83752bde8dc93994f5bc039a4952", - strip_prefix = "wasmtime-0.21.0", - url = "https://github.com/bytecodealliance/wasmtime/archive/v0.21.0.tar.gz", - ) - - http_archive( - name = "wasm_c_api", - build_file = "@proxy_wasm_cpp_host//bazel/external:wasm-c-api.BUILD", - sha256 = "aea8cd095e9937f1e14f2c93e026317b197eb2345e7a817fe3932062eb7b792c", - strip_prefix = "wasm-c-api-d9a80099d496b5cdba6f3fe8fc77586e0e505ddc", - url = "https://github.com/WebAssembly/wasm-c-api/archive/d9a80099d496b5cdba6f3fe8fc77586e0e505ddc.tar.gz", - ) - - http_archive( - name = "com_google_absl", - sha256 = "19391fb4882601a65cb648d638c11aa301ce5f525ef02da1a9eafd22f72d7c59", - strip_prefix = "abseil-cpp-37dd2562ec830d547a1524bb306be313ac3f2556", - # 2020-01-29 - urls = ["https://github.com/abseil/abseil-cpp/archive/37dd2562ec830d547a1524bb306be313ac3f2556.tar.gz"], - ) - - http_archive( - name = "io_bazel_rules_rust", - sha256 = "442a102e2a6f6c75e10d43f21c0c30218947a3e827d91529ced7380c5fec05f0", - strip_prefix = "rules_rust-39523e32ac0bd64f5d60154114a42e61e58ffd17", - url = "https://github.com/bazelbuild/rules_rust/archive/39523e32ac0bd64f5d60154114a42e61e58ffd17.tar.gz", - ) - - http_archive( - name = "com_google_protobuf", - sha256 = "59621f4011a95df270748dcc0ec1cc51946473f0e140d4848a2f20c8719e43aa", - strip_prefix = "protobuf-655310ca192a6e3a050e0ca0b7084a2968072260", - url = "https://github.com/protocolbuffers/protobuf/archive/655310ca192a6e3a050e0ca0b7084a2968072260.tar.gz", - ) +def proxy_wasm_cpp_host_dependencies(): + rust_repositories() + proxy_wasm_cpp_host_raze__fetch_remote_crates() diff --git a/bazel/dependencies_extra.bzl b/bazel/dependencies_extra.bzl deleted file mode 100644 index e1cd987c..00000000 --- a/bazel/dependencies_extra.bzl +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2020 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") -load("@proxy_wasm_cpp_host//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_raze__fetch_remote_crates") - -def dependencies_extra(): - rust_repositories() - proxy_wasm_cpp_host_raze__fetch_remote_crates() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl new file mode 100644 index 00000000..93eabfe1 --- /dev/null +++ b/bazel/repositories.bzl @@ -0,0 +1,75 @@ +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def proxy_wasm_cpp_host_repositories(): + http_archive( + name = "proxy_wasm_cpp_sdk", + sha256 = "b97e3e716b1f38dc601487aa0bde72490bbc82b8f3ad73f1f3e69733984955df", + strip_prefix = "proxy-wasm-cpp-sdk-956f0d500c380cc1656a2d861b7ee12c2515a664", + urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/956f0d500c380cc1656a2d861b7ee12c2515a664.tar.gz"], + ) + + http_archive( + name = "boringssl", + sha256 = "bb55b0ed2f0cb548b5dce6a6b8307ce37f7f748eb9f1be6bfe2d266ff2b4d52b", + strip_prefix = "boringssl-2192bbc878822cf6ab5977d4257a1339453d9d39", + urls = ["https://github.com/google/boringssl/archive/2192bbc878822cf6ab5977d4257a1339453d9d39.tar.gz"], + ) + + http_archive( + name = "com_google_googletest", + sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb", + strip_prefix = "googletest-release-1.10.0", + urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"], + ) + + http_archive( + name = "wasmtime", + build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD", + sha256 = "7874feb1026bbef06796bd5ab80e73f15b8e83752bde8dc93994f5bc039a4952", + strip_prefix = "wasmtime-0.21.0", + url = "https://github.com/bytecodealliance/wasmtime/archive/v0.21.0.tar.gz", + ) + + http_archive( + name = "wasm_c_api", + build_file = "@proxy_wasm_cpp_host//bazel/external:wasm-c-api.BUILD", + sha256 = "aea8cd095e9937f1e14f2c93e026317b197eb2345e7a817fe3932062eb7b792c", + strip_prefix = "wasm-c-api-d9a80099d496b5cdba6f3fe8fc77586e0e505ddc", + url = "https://github.com/WebAssembly/wasm-c-api/archive/d9a80099d496b5cdba6f3fe8fc77586e0e505ddc.tar.gz", + ) + + http_archive( + name = "com_google_absl", + sha256 = "19391fb4882601a65cb648d638c11aa301ce5f525ef02da1a9eafd22f72d7c59", + strip_prefix = "abseil-cpp-37dd2562ec830d547a1524bb306be313ac3f2556", + # 2020-01-29 + urls = ["https://github.com/abseil/abseil-cpp/archive/37dd2562ec830d547a1524bb306be313ac3f2556.tar.gz"], + ) + + http_archive( + name = "io_bazel_rules_rust", + sha256 = "442a102e2a6f6c75e10d43f21c0c30218947a3e827d91529ced7380c5fec05f0", + strip_prefix = "rules_rust-39523e32ac0bd64f5d60154114a42e61e58ffd17", + url = "https://github.com/bazelbuild/rules_rust/archive/39523e32ac0bd64f5d60154114a42e61e58ffd17.tar.gz", + ) + + http_archive( + name = "com_google_protobuf", + sha256 = "59621f4011a95df270748dcc0ec1cc51946473f0e140d4848a2f20c8719e43aa", + strip_prefix = "protobuf-655310ca192a6e3a050e0ca0b7084a2968072260", + url = "https://github.com/protocolbuffers/protobuf/archive/655310ca192a6e3a050e0ca0b7084a2968072260.tar.gz", + ) From ad3332110b8e52b24621cdb4db5c603f7eb5dd08 Mon Sep 17 00:00:00 2001 From: mathetake Date: Sun, 6 Dec 2020 21:22:05 +0900 Subject: [PATCH 6/6] Suppress rustc warning Signed-off-by: mathetake --- test/test_data/trap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_data/trap.rs b/test/test_data/trap.rs index 8fb2a413..2be4cab2 100644 --- a/test/test_data/trap.rs +++ b/test/test_data/trap.rs @@ -17,7 +17,7 @@ pub extern "C" fn trigger() { one(); } #[no_mangle] -pub extern "C" fn trigger2(val: i32) -> i32 { +pub extern "C" fn trigger2(_val: i32) -> i32 { three(); 0 }