Skip to content

Commit

Permalink
fix(templates/http-go): Remove scheduler flag from http-go build command
Browse files Browse the repository at this point in the history
This removes the `-scheduler=none` flag from the build command in the
http-go template. Including this flag prevents Spin applications using
`http.Transport` from compiling.

```
❯ spin build
Building component http-roundtrip-test with `tinygo build -target=wasip1 -gc=leaking -scheduler=none -buildmode=c-shared -no-debug -o main.wasm .`
/opt/homebrew/Cellar/tinygo/0.35.0/src/net/http/transfer.go:213:2: attempted to start a goroutine without a scheduler
Error: Build command for component http-roundtrip-test failed with status Exited(1)
```

Signed-off-by: Adam Reese <[email protected]>
  • Loading branch information
adamreese committed Jan 14, 2025
1 parent 771282e commit 0a6db47
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
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 ."

0 comments on commit 0a6db47

Please sign in to comment.