Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/componentize/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
12 changes: 5 additions & 7 deletions crates/componentize/tests/go-case/main.go
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -65,5 +65,3 @@ func execute(v []string) error {

return nil
}

func main() {}
2 changes: 1 addition & 1 deletion crates/componentize/tests/go-case/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ."
2 changes: 1 addition & 1 deletion templates/http-go/content/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion templates/http-go/metadata/snippets/component.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion templates/redis-go/content/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ."
Loading