bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.38k stars 656 forks source link

Support GOOS=wasip1 #4046

Closed rockwotj closed 1 month ago

rockwotj commented 2 months ago

What version of rules_go are you using?

0.49

What version of gazelle are you using?

N/A

What version of Bazel are you using?

7.2.0

Does this issue reproduce with the latest releases of all the above?

Yes

What operating system and processor architecture are you using?

Linux x86_64

Any other potentially useful information about your toolchain?

What did you do?

$ cat BUILD --plain
load("@rules_go//go:def.bzl", "go_binary", "go_cross_binary")

go_binary(
    name = "identity",
    srcs = ["identity/transform.go"],
    visibility = ["//visibility:public"],
    deps = [
        "//src/transform-sdk/go/transform",
    ],
    goos = "wasip1",
    goarch = "wasm",
)

What did you expect to see?

Build succeed

What did you see instead?

$ bazel build :all
ERROR: Traceback (most recent call last):
        File "/home/rockwood/.cache/bazel/_bazel_rockwood/b506f161a590090dd4787cd25d4e79f8/external/rules_go~/go/private/rules/transition.bzl", line 105, column 17, in _go_transition_impl
                fail("invalid goos, goarch pair: {}, {}".format(goos, goarch))
Error in fail: invalid goos, goarch pair: wasip1, wasm
ERROR: /home/rockwood/code/redpanda/src/transform-sdk/go/transform/internal/testdata/identity/BUILD:3:10: On dependency edge //src/transform-sdk/go/transform/internal/testdata/identity:identity (e6c94e9) -|deps|-> //src/transform-sdk/go/transform:transform: Errors encountered while applying Starlark transition
INFO: Analyzed target //src/transform-sdk/go/transform/internal/testdata/identity:identity (1 packages loaded, 1 target configured).
WARNING: errors encountered while analyzing target '//src/transform-sdk/go/transform/internal/testdata/identity:identity', it will not be built.