diff --git a/bazel/external/rules_rust.patch b/bazel/external/rules_rust.patch deleted file mode 100644 index cae9965b..00000000 --- a/bazel/external/rules_rust.patch +++ /dev/null @@ -1,15 +0,0 @@ -# https://github.com/bazelbuild/rules_rust/pull/1315 - -diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl -index f2fe58c2c..6e55c2c35 100644 ---- a/rust/private/rustc.bzl -+++ b/rust/private/rustc.bzl -@@ -1634,7 +1634,7 @@ def rustc_compile_action( - **crate_info_dict - ) - -- if crate_info.type in ["staticlib", "cdylib"]: -+ if crate_info.type in ["staticlib", "cdylib"] and not out_binary: - # These rules are not supposed to be depended on by other rust targets, and - # as such they shouldn't provide a CrateInfo. However, one may still want to - # write a rust_test for them, so we provide the CrateInfo wrapped in a provider diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index d5742540..e7a29712 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -139,8 +139,6 @@ def proxy_wasm_cpp_host_repositories(): name = "rules_rust", integrity = "sha256-u8dkwlLQYSgbI1knek1GSA4tz69yr8HObgCtpYzL/Uw=", urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.69.0/rules_rust-0.69.0.tar.gz"], - patches = ["@proxy_wasm_cpp_host//bazel/external:rules_rust.patch"], - patch_args = ["-p1"], ) # Core deps. Keep them updated. diff --git a/bazel/wasm.bzl b/bazel/wasm.bzl index 5580e01f..1afd8df0 100644 --- a/bazel/wasm.bzl +++ b/bazel/wasm.bzl @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_rust//rust:defs.bzl", "rust_binary") +load("@rules_rust//rust:defs.bzl", "rust_shared_library") def _wasm_rust_transition_impl(settings, attr): return { @@ -81,11 +81,9 @@ def wasm_rust_binary(name, tags = [], wasi = False, signing_key = [], **kwargs): wasm_name = "_wasm_" + name.replace(".", "_") kwargs.setdefault("visibility", ["//visibility:public"]) - rust_binary( + rust_shared_library( name = wasm_name, edition = "2018", - crate_type = "cdylib", - out_binary = True, tags = ["manual"], **kwargs )