Skip to content

Commit 7e6317f

Browse files
committed
fix: resolve remaining build failures for wit-bindgen and wasmsign2
Critical fixes for final 10 failing targets: 1. **wit-bindgen dependency**: Added wit-bindgen 0.43.0 to checksum_updater Cargo.toml to make @crates//:wit-bindgen available for macro usage. Updated Cargo.lock with proper dependency resolution. 2. **wasmsign2 wrapper**: Created proper wrapper script that executes the Bazel-native rust_binary build (@wasmsign2_src//:wasmsign2_bazel). Maintains full security functionality while using proper dependency management. 3. **Toolchain integration**: Fixed wasmsign2 file creation in toolchain repository to ensure signing rules can access the binary properly. These changes should resolve the "missing input file" errors for wasmsign2 and the "no such target" errors for wit-bindgen, moving us closer to 100% build success rate.
1 parent 4818418 commit 7e6317f

File tree

4 files changed

+278
-78
lines changed

4 files changed

+278
-78
lines changed

MODULE.bazel.lock

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

toolchains/wasm_toolchain.bzl

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

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

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")
557+
# Create wasmsign2 wrapper that executes the Bazel-built binary
558+
# This approach maintains full security functionality via proper dependency management
559+
repository_ctx.file("wasmsign2", """#!/bin/bash
560+
# wasmsign2 wrapper that executes the Bazel-native rust_binary
561+
# This ensures proper dependency resolution through @wasmsign2_crates
562+
563+
set -euo pipefail
564+
565+
# Get the directory where this script is located (toolchain repository)
566+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
567+
568+
# Use relative path to find the wasmsign2_bazel binary built by Bazel
569+
# The actual binary will be built by @wasmsign2_src//:wasmsign2_bazel
570+
WASMSIGN2_BINARY="${SCRIPT_DIR}/../wasmsign2_src/bazel-bin/wasmsign2_bazel"
571+
572+
# If the binary doesn't exist, try to build it
573+
if [[ ! -f "$WASMSIGN2_BINARY" ]]; then
574+
echo "Building wasmsign2 using Bazel-native approach..." >&2
575+
cd "${SCRIPT_DIR}/.."
576+
bazel build @wasmsign2_src//:wasmsign2_bazel >&2
577+
fi
578+
579+
# Execute the built binary with all arguments
580+
exec "$WASMSIGN2_BINARY" "$@"
581+
""", executable = True)
582+
583+
print("Created wasmsign2 wrapper for Bazel-native rust_binary build")
584+
print("Security functionality fully maintained via proper dependency management")
562585

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

0 commit comments

Comments
 (0)