Skip to content

Commit c4aa295

Browse files
Merge pull request #2981 from adamreese/fix/templates-go
fix(templates/http-go): Remove scheduler flag from http-go build command
2 parents 70f2d54 + 8f80acb commit c4aa295

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

crates/componentize/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,9 @@ mod tests {
440440
let mut cmd = process::Command::new("tinygo");
441441
cmd.arg("build")
442442
.current_dir("tests/go-case")
443-
.arg("-target=wasi")
443+
.arg("-target=wasip1")
444444
.arg("-gc=leaking")
445+
.arg("-buildmode=c-shared")
445446
.arg("-no-debug")
446447
.arg("-o")
447448
.arg(out_dir.join("go_case.wasm"))

crates/componentize/tests/go-case/main.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
package main
22

33
import (
4-
"fmt"
5-
"net/http"
64
"errors"
7-
"strings"
5+
"fmt"
86
"io"
7+
"net/http"
98
"os"
9+
"strings"
1010

11-
spinredis "github.com/fermyon/spin/sdk/go/redis"
12-
spinhttp "github.com/fermyon/spin/sdk/go/http"
1311
spinconfig "github.com/fermyon/spin/sdk/go/config"
12+
spinhttp "github.com/fermyon/spin/sdk/go/http"
13+
spinredis "github.com/fermyon/spin/sdk/go/redis"
1414
)
1515

1616
func init() {
@@ -65,5 +65,3 @@ func execute(v []string) error {
6565

6666
return nil
6767
}
68-
69-
func main() {}

crates/componentize/tests/go-case/spin.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ allowed_http_hosts = []
1212
[component.trigger]
1313
route = "/..."
1414
[component.build]
15-
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go"
15+
command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."

templates/http-go/content/spin.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ component = "{{project-name | kebab_case}}"
1414
source = "main.wasm"
1515
allowed_outbound_hosts = []
1616
[component.{{project-name | kebab_case}}.build]
17-
command = "tinygo build -target=wasip1 -gc=leaking -scheduler=none -buildmode=c-shared -no-debug -o main.wasm ."
17+
command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."
1818
watch = ["**/*.go", "go.mod"]

templates/http-go/metadata/snippets/component.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ component = "{{project-name | kebab_case}}"
66
source = "{{ output-path }}/main.wasm"
77
allowed_outbound_hosts = []
88
[component.{{project-name | kebab_case}}.build]
9-
command = "tinygo build -target=wasip1 -gc=leaking -scheduler=none -buildmode=c-shared -no-debug -o main.wasm ."
9+
command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."
1010
workdir = "{{ output-path }}"
1111
watch = ["**/*.go", "go.mod"]

templates/redis-go/content/spin.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ component = "{{project-name | kebab_case}}"
1717
source = "main.wasm"
1818
allowed_outbound_hosts = []
1919
[component.{{project-name | kebab_case}}.build]
20-
command = "tinygo build -target=wasi -gc=leaking -no-debug -o main.wasm main.go"
20+
command = "tinygo build -target=wasip1 -gc=leaking -buildmode=c-shared -no-debug -o main.wasm ."

0 commit comments

Comments
 (0)