Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: fix macos build with fuse #6235

Merged
merged 2 commits into from
Apr 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,28 @@ defaults: &defaults
- image: circleci/golang:1.12

jobs:
gobuild:
<<: *defaults
steps:
- checkout
- *make_out_dirs
- *restore_gomod
- run:
command: make cmd/ipfs-try-build
environment:
TEST_NO_FUSE: 0
- run:
command: make cmd/ipfs-try-build
environment:
TEST_NO_FUSE: 1
- *store_gomod
gotest:
<<: *defaults
steps:
- checkout
- *make_out_dirs
- *restore_gomod

- run: make cmd/ipfs-try-build
- run: |
make -j 1 test/unit/gotest.junit.xml \
&& [[ ! $(jq -s -c 'map(select(.Action == "fail")) | .[]' test/unit/gotest.json) ]]
Expand Down Expand Up @@ -96,5 +110,6 @@ workflows:
version: 2
test:
jobs:
- gobuild
- gotest
- sharness
2 changes: 0 additions & 2 deletions fuse/node/mount_nofuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
core "github.com/ipfs/go-ipfs/core"
)

type errNeedFuseVersion error // used in tests, needed in OSX

func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
return errors.New("not compiled in")
}
3 changes: 2 additions & 1 deletion fuse/node/mount_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ package node
import (
"io/ioutil"
"os"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -63,7 +64,7 @@ func TestExternalUnmount(t *testing.T) {
mkdir(t, ipnsDir)

err = Mount(node, ipfsDir, ipnsDir)
if _, ok := err.(errNeedFuseVersion); ok || err == fuse.ErrOSXFUSENotFound {
if strings.Contains(err.Error(), "unable to check fuse version") || err == fuse.ErrOSXFUSENotFound {
t.Skip(err)
}
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions fuse/node/mount_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ var platformFuseChecks = func(*core.IpfsNode) error {
return nil
}

type errNeedFuseVersion error // used in tests, needed in OSX

func Mount(node *core.IpfsNode, fsdir, nsdir string) error {
// check if we already have live mounts.
// if the user said "Mount", then there must be something wrong.
Expand Down
4 changes: 3 additions & 1 deletion mk/golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ test_go_test: $$(DEPS_GO)
$(GOCC) test $(go-flags-with-tags) $(GOTFLAGS) ./...
.PHONY: test_go_test

test_go_build: $$(TEST_GO_BUILD)

test_go_short: GOTFLAGS += -test.short
test_go_short: test_go_test
.PHONY: test_go_short
Expand All @@ -54,7 +56,7 @@ test_go_race: GOTFLAGS += -race
test_go_race: test_go_test
.PHONY: test_go_race

test_go_expensive: test_go_test $$(TEST_GO_BUILD)
test_go_expensive: test_go_test test_go_build
.PHONY: test_go_expensive
TEST_GO += test_go_expensive

Expand Down