From 94bbc1ca7cb0503bb4d1797d03f32d55bb978cdf Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sat, 20 Jul 2019 17:17:56 -0700 Subject: [PATCH 1/2] fix openbsd build by disabling fuse on openbsd fixes #5334 --- fuse/ipns/ipns_test.go | 2 +- fuse/ipns/ipns_unix.go | 2 +- fuse/ipns/link_unix.go | 2 +- fuse/mount/fuse.go | 3 +-- fuse/node/mount_openbsd.go | 13 +++++++++++++ fuse/node/mount_test.go | 2 +- fuse/node/mount_unix.go | 2 +- fuse/readonly/ipfs_test.go | 2 +- fuse/readonly/mount_unix.go | 2 +- fuse/readonly/readonly_unix.go | 2 +- mk/util.mk | 4 ++++ 11 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 fuse/node/mount_openbsd.go diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index cf59f65a715..457cbb21bed 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -1,4 +1,4 @@ -// +build !nofuse +// +build !nofuse,!openbsd package ipns diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index f625f25a0e6..8568f8c9667 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -1,4 +1,4 @@ -// +build !nofuse +// +build !nofuse,!openbsd // package fuse/ipns implements a fuse filesystem that interfaces // with ipns, the naming system for ipfs. diff --git a/fuse/ipns/link_unix.go b/fuse/ipns/link_unix.go index fade3692af6..5f8df2732cd 100644 --- a/fuse/ipns/link_unix.go +++ b/fuse/ipns/link_unix.go @@ -1,4 +1,4 @@ -// +build !nofuse +// +build !nofuse,!openbsd package ipns diff --git a/fuse/mount/fuse.go b/fuse/mount/fuse.go index 41d14cc3696..67a24f08f6a 100644 --- a/fuse/mount/fuse.go +++ b/fuse/mount/fuse.go @@ -1,5 +1,4 @@ -// +build !nofuse -// +build !windows +// +build !nofuse,!windows,!openbsd package mount diff --git a/fuse/node/mount_openbsd.go b/fuse/node/mount_openbsd.go new file mode 100644 index 00000000000..7edbd910f89 --- /dev/null +++ b/fuse/node/mount_openbsd.go @@ -0,0 +1,13 @@ +// +build !nofuse + +package node + +import ( + "errors" + + core "github.com/ipfs/go-ipfs/core" +) + +func Mount(node *core.IpfsNode, fsdir, nsdir string) error { + return errors.New("FUSE not supported on OpenBSD. See #5334 (https://git.io/fjMuC).") +} diff --git a/fuse/node/mount_test.go b/fuse/node/mount_test.go index a57d638199f..743d6cc2561 100644 --- a/fuse/node/mount_test.go +++ b/fuse/node/mount_test.go @@ -1,4 +1,4 @@ -// +build !nofuse +// +build !openbsd,!nofuse package node diff --git a/fuse/node/mount_unix.go b/fuse/node/mount_unix.go index 8fee8694749..1438cbe8e02 100644 --- a/fuse/node/mount_unix.go +++ b/fuse/node/mount_unix.go @@ -1,4 +1,4 @@ -// +build !windows,!nofuse +// +build !windows,!openbsd,!nofuse package node diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index bea43d2920e..7e44ca06644 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -1,4 +1,4 @@ -// +build !nofuse +// +build !nofuse,!openbsd package readonly diff --git a/fuse/readonly/mount_unix.go b/fuse/readonly/mount_unix.go index 656e23c4925..6988d8bdf7b 100644 --- a/fuse/readonly/mount_unix.go +++ b/fuse/readonly/mount_unix.go @@ -1,4 +1,4 @@ -// +build linux darwin freebsd netbsd openbsd +// +build linux darwin freebsd netbsd // +build !nofuse package readonly diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index ee4708e88ae..eeba6a1bd4e 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -1,4 +1,4 @@ -// +build linux darwin freebsd netbsd openbsd +// +build linux darwin freebsd netbsd // +build !nofuse package readonly diff --git a/mk/util.mk b/mk/util.mk index fa6eae8e443..734640d2903 100644 --- a/mk/util.mk +++ b/mk/util.mk @@ -20,8 +20,12 @@ SUPPORTED_PLATFORMS += linux-amd64 SUPPORTED_PLATFORMS += darwin-386 SUPPORTED_PLATFORMS += darwin-amd64 +SUPPORTED_PLATFORMS += freebsd-386 SUPPORTED_PLATFORMS += freebsd-amd64 +SUPPORTED_PLATFORMS += openbsd-386 +SUPPORTED_PLATFORMS += openbsd-amd64 + space:= space+= comma:=, From 90c656dc5983d8710b158e394c017acaf94ecd57 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 22 Jul 2019 16:24:32 -0700 Subject: [PATCH 2/2] fix netbsd build --- fuse/ipns/ipns_test.go | 2 +- fuse/ipns/ipns_unix.go | 2 +- fuse/ipns/link_unix.go | 2 +- fuse/mount/fuse.go | 2 +- fuse/node/{mount_openbsd.go => mount_notsupp.go} | 4 ++-- fuse/node/mount_test.go | 2 +- fuse/node/mount_unix.go | 2 +- fuse/readonly/ipfs_test.go | 2 +- fuse/readonly/mount_unix.go | 2 +- fuse/readonly/readonly_unix.go | 2 +- mk/util.mk | 3 +++ 11 files changed, 14 insertions(+), 11 deletions(-) rename fuse/node/{mount_openbsd.go => mount_notsupp.go} (50%) diff --git a/fuse/ipns/ipns_test.go b/fuse/ipns/ipns_test.go index 457cbb21bed..a9406670e11 100644 --- a/fuse/ipns/ipns_test.go +++ b/fuse/ipns/ipns_test.go @@ -1,4 +1,4 @@ -// +build !nofuse,!openbsd +// +build !nofuse,!openbsd,!netbsd package ipns diff --git a/fuse/ipns/ipns_unix.go b/fuse/ipns/ipns_unix.go index 8568f8c9667..0e3e0b73611 100644 --- a/fuse/ipns/ipns_unix.go +++ b/fuse/ipns/ipns_unix.go @@ -1,4 +1,4 @@ -// +build !nofuse,!openbsd +// +build !nofuse,!openbsd,!netbsd // package fuse/ipns implements a fuse filesystem that interfaces // with ipns, the naming system for ipfs. diff --git a/fuse/ipns/link_unix.go b/fuse/ipns/link_unix.go index 5f8df2732cd..3cc9effd645 100644 --- a/fuse/ipns/link_unix.go +++ b/fuse/ipns/link_unix.go @@ -1,4 +1,4 @@ -// +build !nofuse,!openbsd +// +build !nofuse,!openbsd,!netbsd package ipns diff --git a/fuse/mount/fuse.go b/fuse/mount/fuse.go index 67a24f08f6a..da7efb02583 100644 --- a/fuse/mount/fuse.go +++ b/fuse/mount/fuse.go @@ -1,4 +1,4 @@ -// +build !nofuse,!windows,!openbsd +// +build !nofuse,!windows,!openbsd,!netbsd package mount diff --git a/fuse/node/mount_openbsd.go b/fuse/node/mount_notsupp.go similarity index 50% rename from fuse/node/mount_openbsd.go rename to fuse/node/mount_notsupp.go index 7edbd910f89..847abb059f2 100644 --- a/fuse/node/mount_openbsd.go +++ b/fuse/node/mount_notsupp.go @@ -1,4 +1,4 @@ -// +build !nofuse +// +build !nofuse,openbsd !nofuse,netbsd package node @@ -9,5 +9,5 @@ import ( ) func Mount(node *core.IpfsNode, fsdir, nsdir string) error { - return errors.New("FUSE not supported on OpenBSD. See #5334 (https://git.io/fjMuC).") + return errors.New("FUSE not supported on OpenBSD or NetBSD. See #5334 (https://git.io/fjMuC).") } diff --git a/fuse/node/mount_test.go b/fuse/node/mount_test.go index 743d6cc2561..7b051453a90 100644 --- a/fuse/node/mount_test.go +++ b/fuse/node/mount_test.go @@ -1,4 +1,4 @@ -// +build !openbsd,!nofuse +// +build !openbsd,!nofuse,!netbsd package node diff --git a/fuse/node/mount_unix.go b/fuse/node/mount_unix.go index 1438cbe8e02..8c89c94b670 100644 --- a/fuse/node/mount_unix.go +++ b/fuse/node/mount_unix.go @@ -1,4 +1,4 @@ -// +build !windows,!openbsd,!nofuse +// +build !windows,!openbsd,!netbsd,!nofuse package node diff --git a/fuse/readonly/ipfs_test.go b/fuse/readonly/ipfs_test.go index 7e44ca06644..e6d38507e69 100644 --- a/fuse/readonly/ipfs_test.go +++ b/fuse/readonly/ipfs_test.go @@ -1,4 +1,4 @@ -// +build !nofuse,!openbsd +// +build !nofuse,!openbsd,!netbsd package readonly diff --git a/fuse/readonly/mount_unix.go b/fuse/readonly/mount_unix.go index 6988d8bdf7b..e1065a2a1cd 100644 --- a/fuse/readonly/mount_unix.go +++ b/fuse/readonly/mount_unix.go @@ -1,4 +1,4 @@ -// +build linux darwin freebsd netbsd +// +build linux darwin freebsd // +build !nofuse package readonly diff --git a/fuse/readonly/readonly_unix.go b/fuse/readonly/readonly_unix.go index eeba6a1bd4e..16863f31e45 100644 --- a/fuse/readonly/readonly_unix.go +++ b/fuse/readonly/readonly_unix.go @@ -1,4 +1,4 @@ -// +build linux darwin freebsd netbsd +// +build linux darwin freebsd // +build !nofuse package readonly diff --git a/mk/util.mk b/mk/util.mk index 734640d2903..352918402d0 100644 --- a/mk/util.mk +++ b/mk/util.mk @@ -26,6 +26,9 @@ SUPPORTED_PLATFORMS += freebsd-amd64 SUPPORTED_PLATFORMS += openbsd-386 SUPPORTED_PLATFORMS += openbsd-amd64 +SUPPORTED_PLATFORMS += netbsd-386 +SUPPORTED_PLATFORMS += netbsd-amd64 + space:= space+= comma:=,