From 93433daecce69741368f856bd2c901da8d1657af Mon Sep 17 00:00:00 2001 From: Angus Dippenaar Date: Thu, 4 Aug 2022 00:37:03 +0200 Subject: [PATCH] Add nowasm tag, fix nowasm inconsistency --- internal/ext/wasm/nowasm.go | 7 +++++-- internal/ext/wasm/wasm.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/internal/ext/wasm/nowasm.go b/internal/ext/wasm/nowasm.go index e32100fcad..cd2a75ae84 100644 --- a/internal/ext/wasm/nowasm.go +++ b/internal/ext/wasm/nowasm.go @@ -1,16 +1,19 @@ -//go:build !(cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64))) +//go:build nowasm || !(cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64))) package wasm import ( "fmt" + "context" "github.com/kyleconroy/sqlc/internal/plugin" ) type Runner struct { + URL string + SHA256 string } -func (r *Runner) Generate(req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { +func (r *Runner) Generate(ctx context.Context, req *plugin.CodeGenRequest) (*plugin.CodeGenResponse, error) { return nil, fmt.Errorf("sqlc built without wasmtime support") } diff --git a/internal/ext/wasm/wasm.go b/internal/ext/wasm/wasm.go index a55d8551d1..6219d06a2b 100644 --- a/internal/ext/wasm/wasm.go +++ b/internal/ext/wasm/wasm.go @@ -1,4 +1,4 @@ -//go:build cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64)) +//go:build !nowasm && cgo && ((linux && amd64) || (linux && arm64) || (darwin && amd64) || (darwin && arm64) || (windows && amd64)) // The above build constraint is based of the cgo directives in this file: // https://github.com/bytecodealliance/wasmtime-go/blob/main/ffi.go