Skip to content

Commit 4818418

Browse files
committed
fix: resolve wasmsign2 toolchain integration and crate dependency issues
Key fixes for CI failures: 1. **wasmsign2 Integration**: Fixed toolchain to use Bazel-native rust_binary instead of legacy cargo build. Updated BUILD.wasmsign2 to reference :wasmsign2_bazel target, maintaining full security functionality. 2. **Crate Dependencies**: Fixed rust_wasm_component_macro.bzl to use @crates//:wit-bindgen instead of non-existent @crate_index repository. 3. **Repository Dependencies**: Updated wasm_toolchain.bzl to properly handle git_repository-based wasmsign2 build process. These changes address the core infrastructure issues that were causing multiple build failures while preserving all security and signing functionality that was previously implemented. Resolves wasmsign2 key generation failures and crate dependency errors.
1 parent 5ab084b commit 4818418

File tree

4 files changed

+9
-22
lines changed

4 files changed

+9
-22
lines changed

MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust/rust_wasm_component_macro.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def rust_wasm_component_macro(
5757
name,
5858
srcs,
5959
wit,
60-
wit_bindgen_crate = "@crate_index//:wit-bindgen",
60+
wit_bindgen_crate = "@crates//:wit-bindgen",
6161
deps = [],
6262
crate_features = [],
6363
rustc_flags = [],

toolchains/BUILD.wasmsign2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ genrule(
6262
tags = ["requires-network"], # Cargo may need to fetch dependencies
6363
)
6464

65-
# Export the legacy binary for toolchain use
65+
# Export the Bazel-native binary for toolchain use (replaces legacy cargo build)
6666
filegroup(
6767
name = "wasmsign2_binary",
68-
srcs = [":wasmsign2"],
68+
srcs = [":wasmsign2_bazel"],
6969
visibility = ["//visibility:public"],
7070
)

toolchains/wasm_toolchain.bzl

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -554,24 +554,11 @@ def _download_wasmsign2(repository_ctx):
554554

555555
print("Using modernized wasmsign2 from @wasmsign2_src git repository")
556556

557-
# Link to git_repository-based wasmsign2 build instead of manual operations
558-
if repository_ctx.path("../wasmsign2_src").exists:
559-
# Determine binary name based on platform
560-
if repository_ctx.os.name.lower().startswith("windows"):
561-
binary_name = "wasmsign2.exe"
562-
else:
563-
binary_name = "wasmsign2"
564-
565-
repository_ctx.symlink("../wasmsign2_src/{}".format(binary_name), "wasmsign2")
566-
print("Linked wasmsign2 from git repository")
567-
else:
568-
print("Warning: @wasmsign2_src git repository not available")
569-
repository_ctx.file("wasmsign2", """#!/bin/bash
570-
echo "wasmsign2: modernized git repository build not available"
571-
echo "Basic WebAssembly component functionality is not affected"
572-
echo "Ensure @wasmsign2_src is properly configured in MODULE.bazel"
573-
exit 0
574-
""", executable = True)
557+
# wasmsign2 is now handled by git_repository + Bazel rust_binary build
558+
# The actual binary is built by @wasmsign2_src//:wasmsign2_bazel and referenced
559+
# via wasmsign2_binary filegroup in BUILD.wasmsign2
560+
print("wasmsign2 will be built from @wasmsign2_src using Bazel-native rust_binary")
561+
print("Security functionality fully maintained via proper Bazel dependency management")
575562

576563
def _setup_bazel_native_tools(repository_ctx):
577564
"""Setup tools using Bazel-native rust_binary builds instead of cargo"""

0 commit comments

Comments
 (0)