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

"Nocgo" version of cgofuse #25

Closed
billziss-gh opened this issue May 22, 2018 · 1 comment
Closed

"Nocgo" version of cgofuse #25

billziss-gh opened this issue May 22, 2018 · 1 comment

Comments

@billziss-gh
Copy link
Collaborator

It is conceptually possible to eliminate the need for cgo under Windows. The intent is to allow building with either CGO_ENABLED=1 to build the (default) "cgo" version of cgofuse, or CGO_ENABLED=0 to build a "nocgo" version of cgofuse. This is accomplished with the help of syscall.DLL, syscall.Proc and syscall.NewCallbackCDecl and a rewrite of all Windows related C code in Go.

This work is currently in the windll branch.

Unfortunately this approach currently does not work, because of a hard bug in the Go runtime: golang/go#6751. According to that bug report callbacks created with syscall.NewCallback will hang the runtime if they are invoked in a non-Go thread. This indeed happens when the FUSE init operation is called in the "nocgo" cgofuse.

The information in golang/go#6751 suggests that doing an import "C" fixes the issue. Unfortunately it also makes the program use cgo, which is what we wanted to avoid with "nocgo". Still it might be useful to allows us to complete testing the "nocgo" version in anticipation that the runtime bug is fixed in the future.

Additional information: ipfs/kubo#5003 (comment)

@billziss-gh
Copy link
Collaborator Author

This support has now been merged into the master branch and this issue can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant