diff --git a/crates/componentize/src/lib.rs b/crates/componentize/src/lib.rs index 5728f19f21..e328245c35 100644 --- a/crates/componentize/src/lib.rs +++ b/crates/componentize/src/lib.rs @@ -440,8 +440,9 @@ mod tests { let mut cmd = process::Command::new("tinygo"); cmd.arg("build") .current_dir("tests/go-case") - .arg("-target=wasi") + .arg("-target=wasip1") .arg("-gc=leaking") + .arg("-buildmode=c-shared") .arg("-no-debug") .arg("-o") .arg(out_dir.join("go_case.wasm")) diff --git a/crates/componentize/tests/go-case/main.go b/crates/componentize/tests/go-case/main.go index cde630fc5a..690a0134a8 100644 --- a/crates/componentize/tests/go-case/main.go +++ b/crates/componentize/tests/go-case/main.go @@ -1,16 +1,16 @@ package main import ( - "fmt" - "net/http" "errors" - "strings" + "fmt" "io" + "net/http" "os" + "strings" - spinredis "github.com/fermyon/spin/sdk/go/redis" - spinhttp "github.com/fermyon/spin/sdk/go/http" spinconfig "github.com/fermyon/spin/sdk/go/config" + spinhttp "github.com/fermyon/spin/sdk/go/http" + spinredis "github.com/fermyon/spin/sdk/go/redis" ) func init() { @@ -65,5 +65,3 @@ func execute(v []string) error { return nil } - -func main() {} diff --git a/crates/componentize/tests/go-case/spin.toml b/crates/componentize/tests/go-case/spin.toml index 6597980c02..04c163b975 100644 --- a/crates/componentize/tests/go-case/spin.toml +++ b/crates/componentize/tests/go-case/spin.toml @@ -12,4 +12,4 @@ allowed_http_hosts = [] [component.trigger] route = "/..." [component.build] -command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" +command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ." diff --git a/templates/http-go/content/spin.toml b/templates/http-go/content/spin.toml index 326a5ddc81..73d06e2d14 100644 --- a/templates/http-go/content/spin.toml +++ b/templates/http-go/content/spin.toml @@ -14,5 +14,5 @@ component = "{{project-name | kebab_case}}" source = "main.wasm" allowed_outbound_hosts = [] [component.{{project-name | kebab_case}}.build] -command = "tinygo build -target=wasip1 -gc=leaking -scheduler=none -buildmode=c-shared -no-debug -o main.wasm ." +command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ." watch = ["**/*.go", "go.mod"] diff --git a/templates/http-go/metadata/snippets/component.txt b/templates/http-go/metadata/snippets/component.txt index 4fbb89ba25..54e38762d9 100644 --- a/templates/http-go/metadata/snippets/component.txt +++ b/templates/http-go/metadata/snippets/component.txt @@ -6,6 +6,6 @@ component = "{{project-name | kebab_case}}" source = "{{ output-path }}/main.wasm" allowed_outbound_hosts = [] [component.{{project-name | kebab_case}}.build] -command = "tinygo build -target=wasip1 -gc=leaking -scheduler=none -buildmode=c-shared -no-debug -o main.wasm ." +command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ." workdir = "{{ output-path }}" watch = ["**/*.go", "go.mod"] diff --git a/templates/redis-go/content/spin.toml b/templates/redis-go/content/spin.toml index 9ccc0ca3d9..7997e51fac 100644 --- a/templates/redis-go/content/spin.toml +++ b/templates/redis-go/content/spin.toml @@ -17,4 +17,4 @@ component = "{{project-name | kebab_case}}" source = "main.wasm" allowed_outbound_hosts = [] [component.{{project-name | kebab_case}}.build] -command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go" +command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."