From 445267878102529befcf76aec824fc625fb9abd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 16 Oct 2024 13:30:30 +0200 Subject: [PATCH] cunative: Only pull in native deps with a tag (#211) * cunative: Only pull in native deps with a tag * only run decode_snap_test with cunative tag --- Makefile | 1 + lib/ffi/cunative/decode_sdr.go | 2 ++ lib/ffi/cunative/decode_snap.go | 2 ++ lib/ffi/cunative/decode_snap_test.go | 2 ++ lib/ffi/cunative/decode_test.go | 2 ++ lib/ffi/cunative/nonative.go | 19 +++++++++++++++++++ 6 files changed, 28 insertions(+) create mode 100644 lib/ffi/cunative/nonative.go diff --git a/Makefile b/Makefile index 4eee42436..0d79bc8eb 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,7 @@ deps: $(BUILD_DEPS) ## ldflags -s -w strips binary +curio: GOFLAGS+=-tags=cunative curio: $(BUILD_DEPS) rm -f curio GOAMD64=v3 CGO_LDFLAGS_ALLOW=$(CGO_LDFLAGS_ALLOW) $(GOCC) build $(GOFLAGS) -o curio -ldflags " -s -w \ diff --git a/lib/ffi/cunative/decode_sdr.go b/lib/ffi/cunative/decode_sdr.go index 20746645f..d4185d621 100644 --- a/lib/ffi/cunative/decode_sdr.go +++ b/lib/ffi/cunative/decode_sdr.go @@ -1,3 +1,5 @@ +//go:build cunative + package cunative /* diff --git a/lib/ffi/cunative/decode_snap.go b/lib/ffi/cunative/decode_snap.go index 25b346c3d..c2bd7a98b 100644 --- a/lib/ffi/cunative/decode_snap.go +++ b/lib/ffi/cunative/decode_snap.go @@ -1,3 +1,5 @@ +//go:build cunative + package cunative /* diff --git a/lib/ffi/cunative/decode_snap_test.go b/lib/ffi/cunative/decode_snap_test.go index 5cbac4ae6..be59b48d9 100644 --- a/lib/ffi/cunative/decode_snap_test.go +++ b/lib/ffi/cunative/decode_snap_test.go @@ -1,3 +1,5 @@ +//go:build cunative + package cunative import ( diff --git a/lib/ffi/cunative/decode_test.go b/lib/ffi/cunative/decode_test.go index afeee878f..730eb45e9 100644 --- a/lib/ffi/cunative/decode_test.go +++ b/lib/ffi/cunative/decode_test.go @@ -1,3 +1,5 @@ +//go:build cunative + package cunative import ( diff --git a/lib/ffi/cunative/nonative.go b/lib/ffi/cunative/nonative.go new file mode 100644 index 000000000..0b6924ba1 --- /dev/null +++ b/lib/ffi/cunative/nonative.go @@ -0,0 +1,19 @@ +//go:build !cunative + +package cunative + +import ( + "io" + + "github.com/ipfs/go-cid" + + "github.com/filecoin-project/go-state-types/abi" +) + +func DecodeSnap(spt abi.RegisteredSealProof, commD, commK cid.Cid, key, replica io.Reader, out io.Writer) error { + panic("DecodeSnap: cunative build tag not enabled") +} + +func Decode(replica, key io.Reader, out io.Writer) error { + panic("Decode: cunative build tag not enabled") +}