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

fuse: Parse OSX fuse version properly #3413

Merged
merged 3 commits into from
Dec 6, 2016
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
24 changes: 20 additions & 4 deletions fuse/node/mount_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import (
"syscall"

core "github.com/ipfs/go-ipfs/core"

"gx/ipfs/QmU1N5xVAUXgo3XRTt6GhJ2SuJEbxj2zRgMS7FpjSR2U83/semver"
)

func init() {
Expand All @@ -29,7 +31,7 @@ var fuseVersionPkg = "github.com/jbenet/go-fuse-version/fuse-version"
var errStrFuseRequired = `OSXFUSE not found.

OSXFUSE is required to mount, please install it.
NOTE: Version 2.7.2 or higher required; prior versions are known to kernel panic!
NOTE: Version in between 2.7.2 and 3.0.0 is required; prior versions are known to kernel panic!
It is recommended you install it from the OSXFUSE website:

http://osxfuse.github.io/
Expand All @@ -54,6 +56,9 @@ It is recommended you install it from the OSXFUSE website:
For more help, see:

https://github.com/ipfs/go-ipfs/issues/177

OSXFUSE versions >3.0.0 are not compatible with version of FUSE library in current use.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"This will be fixed in the near future, see issue number XYZ..."

This will be fixed in near future, see https://github.com/ipfs/go-ipfs/issues/3471
`

var errStrNeedFuseVersion = `unable to check fuse version.
Expand Down Expand Up @@ -138,11 +143,22 @@ func darwinFuseCheckVersion(node *core.IpfsNode) error {
}

log.Debug("mount: osxfuse version:", ov)
if strings.HasPrefix(ov, "2.7.") || strings.HasPrefix(ov, "2.8.") {
return nil

min := semver.MustParse("2.7.2")
max := semver.MustParse("3.0.0")
curr, err := semver.Make(ov)
if err != nil {
return err
}

return fmt.Errorf(errStrUpgradeFuse, ov)
if curr.LT(min) {
return fmt.Errorf(errStrUpgradeFuse, ov)
}
// TODO: Upgrade fuse lib and work nice with 3.0.0+
if curr.GE(max) {
return fmt.Errorf(errStrUpgradeFuse, ov)
}
return nil
}

func tryGFV() (string, error) {
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@
"hash": "QmXGevGDVTqeKdisBzaxEK4CJZqfxeXiVSWLaXaVWcG5on",
"name": "go-smux-multiplex",
"version": "1.1.4"
},
{
"author": "blang",
"hash": "QmU1N5xVAUXgo3XRTt6GhJ2SuJEbxj2zRgMS7FpjSR2U83",
"name": "semver",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we not already have a semver package being used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but you use this one in gx source code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, okay

"version": "3.3.0"
}
],
"gxVersion": "0.4.0",
Expand Down