Skip to content

Commit 20a2dff

Browse files
committed
wasm: final review nits
Drop the wasm example's redundant header comment and default_visibility (nothing outside the package references its targets), and document why the SDK repository pairs a rules_cc toolchain with the Swift one: it drives the bundle's own clang, resolves only for the wasm target platform, and a consumer's root-module registration takes precedence over it.
1 parent e352170 commit 20a2dff

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

examples/cross_compilation/wasm/BUILD.bazel

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
# A WebAssembly reactor written in Swift, executed under a hermetic wasmtime
2-
# and embedded in a static web app.
3-
41
load("@rules_shell//shell:sh_test.bzl", "sh_test")
52
load("//examples/embedded:transition.bzl", "transition_binary")
63
load("//swift:swift.bzl", "swift_binary", "swift_library")
74

8-
package(default_visibility = ["//visibility:public"])
9-
105
platform(
116
name = "wasm32-wasip1",
127
constraint_values = [

swift/internal/extensions/toolchains.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ toolchain(
6666
visibility = ["//visibility:public"],
6767
)
6868
69+
# The paired rules_cc toolchain drives the SDK bundle's own clang for the C
70+
# side of the build (unlike Android, where the cc toolchain comes from the
71+
# separately registered NDK). It only resolves for this wasm target platform,
72+
# and because root-module registrations take precedence in toolchain
73+
# resolution, a consumer who registers their own wasm cc toolchain wins over
74+
# this one automatically.
6975
toolchain(
7076
name = "cc_toolchain_{target}_{platform}",
7177
exec_compatible_with = {exec_compatible_with},

0 commit comments

Comments
 (0)