You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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, orCGO_ENABLED=0
to build a "nocgo" version of cgofuse. This is accomplished with the help ofsyscall.DLL
,syscall.Proc
andsyscall.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 FUSEinit
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)
The text was updated successfully, but these errors were encountered: