-
Notifications
You must be signed in to change notification settings - Fork 82
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
macos: look in alternate location for macfuse/osxfuse library #54
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ncw thanks for the PR. Please see my remarks about nested comments below.
fuse/host_cgo.go
Outdated
@@ -168,7 +168,9 @@ static void *cgofuse_init_fuse(void) | |||
|
|||
void *h; | |||
#if defined(__APPLE__) | |||
h = dlopen("/usr/local/lib/libosxfuse.2.dylib", RTLD_NOW); | |||
h = dlopen("/usr/local/lib/libfuse.2.dylib", RTLD_NOW); /* MacFUSE/OSXFuse >= v4 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change the comment to a single-line comment (i.e. from /* MacFUSE/OSXFuse >= v4 */
to // MacFUSE/OSXFuse >= v4
). Otherwise Go is confused from the nested /* */
comments.
fuse/host_cgo.go
Outdated
h = dlopen("/usr/local/lib/libosxfuse.2.dylib", RTLD_NOW); | ||
h = dlopen("/usr/local/lib/libfuse.2.dylib", RTLD_NOW); /* MacFUSE/OSXFuse >= v4 */ | ||
if (0 == h) | ||
h = dlopen("/usr/local/lib/libosxfuse.2.dylib", RTLD_NOW); /* MacFUSE/OSXFuse < v4 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my earlier remark.
With MacFUSE i.e. OSXFuse 4.0, the location of the loadable library has changed to `/usr/local/lib/libfuse.2.dylib` instead of `/usr/local/lib/libosxfuse.2.dylib`. The older path is still present for backwards compatibility for the time being. This patch looks in the newer location first, then in the older location if that fails. Release Notes: https://github.com/osxfuse/osxfuse/releases/tag/macfuse-4.0.0 Fixes winfsp#52
I've fixed the comments 😊 I must have been having a regression back to C89! |
Thank you. I can confirm that this builds and runs properly on my own Macs, both with older OSXFUSE and newer macFUSE 4. |
With MacFUSE i.e. OSXFuse 4.0, the location of the loadable library
has changed to
/usr/local/lib/libfuse.2.dylib
instead of/usr/local/lib/libosxfuse.2.dylib
. The older path is still presentfor backwards compatibility for the time being.
This patch looks in the newer location first, then in the older
location if that fails.
Release Notes: https://github.com/osxfuse/osxfuse/releases/tag/macfuse-4.0.0
Fixes #52