From 7979d7ef9681c0a9cd66b048bacbf90dcc26ea2b Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Tue, 15 Mar 2022 14:37:52 +1100 Subject: [PATCH] Fix 386 cross compile and wasm build for crawshaw --- storage/default-dir-piece-completion-boltdb.go | 3 ++- storage/default-dir-piece-completion-other.go | 4 ++-- storage/sqlite-piece-completion.go | 1 + storage/sqlite/deprecated.go | 3 +++ storage/sqlite/direct.go | 3 +++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/storage/default-dir-piece-completion-boltdb.go b/storage/default-dir-piece-completion-boltdb.go index 5573fc8d..3ac6a77d 100644 --- a/storage/default-dir-piece-completion-boltdb.go +++ b/storage/default-dir-piece-completion-boltdb.go @@ -1,7 +1,8 @@ // Bolt piece completion is available, and sqlite is not. -//go:build !noboltdb && (!cgo || nosqlite) +//go:build !noboltdb && (!cgo || nosqlite) && !wasm // +build !noboltdb // +build !cgo nosqlite +// +build !wasm package storage diff --git a/storage/default-dir-piece-completion-other.go b/storage/default-dir-piece-completion-other.go index a0564bf4..3cd42fb7 100644 --- a/storage/default-dir-piece-completion-other.go +++ b/storage/default-dir-piece-completion-other.go @@ -1,7 +1,7 @@ // Bolt piece completion is not available, and neither is sqlite. -//go:build (!cgo || nosqlite) && noboltdb +//go:build (!cgo || nosqlite) && (noboltdb || wasm) // +build !cgo nosqlite -// +build noboltdb +// +build noboltdb wasm package storage diff --git a/storage/sqlite-piece-completion.go b/storage/sqlite-piece-completion.go index 153e51e7..eb2e1c3d 100644 --- a/storage/sqlite-piece-completion.go +++ b/storage/sqlite-piece-completion.go @@ -1,5 +1,6 @@ // modernc.org/sqlite depends on modernc.org/libc which doesn't work for JS (and probably wasm but I // think JS is the stronger signal). + //go:build cgo && !nosqlite // +build cgo,!nosqlite diff --git a/storage/sqlite/deprecated.go b/storage/sqlite/deprecated.go index a1b1df14..47698ef0 100644 --- a/storage/sqlite/deprecated.go +++ b/storage/sqlite/deprecated.go @@ -1,3 +1,6 @@ +//go:build cgo +// +build cgo + package sqliteStorage import ( diff --git a/storage/sqlite/direct.go b/storage/sqlite/direct.go index 4256996a..3d51fd31 100644 --- a/storage/sqlite/direct.go +++ b/storage/sqlite/direct.go @@ -1,3 +1,6 @@ +//go:build cgo +// +build cgo + package sqliteStorage import (