winfsp / cgofuse

Cross-platform FUSE library for Go - Works on Windows, macOS, Linux, FreeBSD, NetBSD, OpenBSD
https://winfsp.dev
MIT License
514 stars 82 forks source link

"platform not supported" under Docker / GOX #23

Closed AlbinoGeek closed 4 years ago

AlbinoGeek commented 6 years ago

Cannot compile under Docker or any cross environment

--> windows/386 error: exit status 2
Stderr: # runtime/cgo
gcc_libinit_windows.c: In function 'x_cgo_sys_thread_create':
gcc_libinit_windows.c:56:12: error: implicit declaration of function '_beginthread' [-Werror=implicit-function-declaration]
  thandle = _beginthread(func, 0, arg);
            ^~~~~~~~~~~~
gcc_libinit_windows.c:58:69: error: 'errno' undeclared (first use in this function)
   fprintf(stderr, "runtime: failed to create new OS thread (%d)\n", errno);
                                                                     ^~~~~
gcc_libinit_windows.c:58:69: note: each undeclared identifier is reported only once for each function it appears in
cc1: all warnings being treated as errors
--> windows/amd64 error: exit status 2
Stderr: # github.com/billziss-gh/cgofuse/fuse
..\..\..\github.com\billziss-gh\cgofuse\fuse\fsop.go:28:2: error: #error platform not supported
 #error platform not supported
  ^~~~~
--> linux/386 error: exit status 2
Stderr: # runtime/cgo
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lpthread
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc_s.dll.a when searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc_s.dll.a when searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lgcc_s
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc.a when searching for -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc.a when searching for -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc.a when searching for -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lmsys-2.0
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libadvapi32.a when searching for -ladvapi32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -ladvapi32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libshell32.a when searching for -lshell32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libshell32.a when searching for -lshell32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libshell32.a when searching for -lshell32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lshell32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libuser32.a when searching for -luser32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libuser32.a when searching for -luser32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libuser32.a when searching for -luser32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -luser32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libkernel32.a when searching for -lkernel32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libkernel32.a when searching for -lkernel32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/w32api/libkernel32.a when searching for -lkernel32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lkernel32
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc_s.dll.a when searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc_s.dll.a when searching for -lgcc_s
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lgcc_s
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc.a when searching for -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc.a when searching for -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-pc-msys/6.4.0/libgcc.a when searching for -lgcc
/usr/lib/gcc/x86_64-pc-msys/6.4.0/../../../../x86_64-pc-msys/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status

Stderr: # github.com/billziss-gh/cgofuse/fuse
..\..\..\github.com\billziss-gh\cgofuse\fuse\fsop.go:28:2: error: #error platform not supported
 #error platform not supported
  ^~~~~```
billziss-gh commented 6 years ago

Which docker environment are you using?

This works for me on Docker for macOS and it is regularly tested via CircleCI.

billziss-gh commented 6 years ago

Also are you pulling my docker image billziss/xgo-cgofuse are you attempting to rebuild it?

AlbinoGeek commented 6 years ago

Please see my other issue for XGO , this one is about GOX .

For GOX, it has no option to choose an image to build out of.

I am building from Windows 10 (Host) via Docker CE , Hyper-V (MobyOS)

This is generally equiv. to a typical Docker environment, except the Moby part (Windows-specific Hyper-V virtual machine that hosts the Docker Machine you speak with from your Windows client. Otherwise, all docker commands execute 100% as expected on any other platform.)

e.g.: If cgofuse built inside "just any" CentOS 7 or Ubuntu VM, it would work here too. Exception: If it requires gcc or libfuse to be available on the Docker HOST -- this would be MobyOS in my situation, which is much harder to accomplish. However, you can access libfuse locally, as it's installed in the Docker CONTAINER.

billziss-gh commented 6 years ago

Apologies for the confusion. I am not familiar with GOX and have never attempted to build cgofuse with it.