Skip to content

Commit 6dd9b0e

Browse files
authored
Add nowasm tag, fix nowasm inconsistency (#1772)
1 parent ff06f10 commit 6dd9b0e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

internal/ext/wasm/nowasm.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
//go:build !(cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64)))
1+
//go:build nowasm || !(cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64)))
22

33
package wasm
44

55
import (
66
"fmt"
7+
"context"
78

89
"github.com/kyleconroy/sqlc/internal/plugin"
910
)
1011

1112
type Runner struct {
13+
URL string
14+
SHA256 string
1215
}
1316

14-
func (r *Runner) Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) {
17+
func (r *Runner) Generate(ctx context.Context, req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) {
1518
return nil, fmt.Errorf("sqlc built without wasmtime support")
1619
}

internal/ext/wasm/wasm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//go:build cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64))
1+
//go:build !nowasm && cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64))
22

33
// The above build constraint is based of the cgo directives in this file:
44
// https://github.com/bytecodealliance/wasmtime-go/blob/main/ffi.go

0 commit comments

Comments
 (0)