From 04cdaa9984682e36e7603dd7e40309fc916edb56 Mon Sep 17 00:00:00 2001 From: Cherry Mui Date: Thu, 5 Dec 2024 13:01:32 -0500 Subject: [PATCH] cmd/go: document c-shared buildmode for building WASI library/reactor For #65199. Change-Id: Icd3ec7cf25c2d381401686333c8aeed8013b3fbd Reviewed-on: https://go-review.googlesource.com/c/go/+/633418 Reviewed-by: Michael Matloob LUCI-TryBot-Result: Go LUCI --- src/cmd/go/alldocs.go | 5 ++++- src/cmd/go/internal/help/helpdoc.go | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go index ced43b6d5b..f227d93de7 100644 --- a/src/cmd/go/alldocs.go +++ b/src/cmd/go/alldocs.go @@ -2210,7 +2210,10 @@ // Build the listed main package, plus all packages it imports, // into a C shared library. The only callable symbols will // be those functions exported using a cgo //export comment. -// Requires exactly one main package to be listed. +// On wasip1, this mode builds it to a WASI reactor/library, +// of which the callable symbols are those functions exported +// using a //go:wasmexport directive. Requires exactly one +// main package to be listed. // // -buildmode=default // Listed main packages are built into executables and listed diff --git a/src/cmd/go/internal/help/helpdoc.go b/src/cmd/go/internal/help/helpdoc.go index a64f980e5e..d373c675f6 100644 --- a/src/cmd/go/internal/help/helpdoc.go +++ b/src/cmd/go/internal/help/helpdoc.go @@ -769,7 +769,10 @@ are: Build the listed main package, plus all packages it imports, into a C shared library. The only callable symbols will be those functions exported using a cgo //export comment. - Requires exactly one main package to be listed. + On wasip1, this mode builds it to a WASI reactor/library, + of which the callable symbols are those functions exported + using a //go:wasmexport directive. Requires exactly one + main package to be listed. -buildmode=default Listed main packages are built into executables and listed -- 2.48.1