foundationdb icon indicating copy to clipboard operation
foundationdb copied to clipboard

FoundationDB’s Golang bindings can't support windows?

Open GavinYang-LR opened this issue 8 years ago • 6 comments

FoundationDB’s Golang bindings can't support windows? I find echo "At the moment, only macOS and Linux are supported by this script." in file: foundationdb/bindings/go/fdb-go-install.sh

GavinYang-LR avatar May 08 '18 14:05 GavinYang-LR

@alecgrieser Does it means i can't build and debug in windows env?

GavinYang-LR avatar May 08 '18 15:05 GavinYang-LR

It's more trying to say that the script doesn't work on Windows, though I haven't actually tried (so maybe it does work if you use the Linux subsystem?). I think the go bindings in general should work on Windows.

I don't know all the in's and out's of go on windows, but you essentially need to make sure you have the fdb_c.dll library in the path and then you need to pass the proper include and link flags to CGO at compile time.

alecgrieser avatar May 09 '18 17:05 alecgrieser

@alecgrieser Ok,Thanks,I have request MacBook Pro from it department. Every developer needs a MAC, Haha.

GavinYang-LR avatar May 10 '18 03:05 GavinYang-LR

Just tried to build from Windows Linux Subsystem using 5.2.5 tag. I got the following error message:

root@host00998:/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb/bindings/go# ./fdb-go-install.sh localinstall --fdbver 5.2.0
Building generated files.
make -C /mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb bindings/c/foundationdb/fdb_c_options.g.h
make: Entering directory `/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb'
Makefile:145: flow/actorcompiler/generated.mk: No such file or directory
Makefile:145: flow/coveragetool/generated.mk: No such file or directory
Makefile:145: fdbclient/vexillographer/generated.mk: No such file or directory
Makefile:145: flow/generated.mk: No such file or directory
Makefile:145: fdbrpc/generated.mk: No such file or directory
Makefile:145: fdbclient/generated.mk: No such file or directory
Makefile:145: fdbbackup/generated.mk: No such file or directory
Makefile:145: fdbserver/generated.mk: No such file or directory
Makefile:145: fdbcli/generated.mk: No such file or directory
Makefile:145: bindings/c/generated.mk: No such file or directory
Makefile:145: bindings/java/generated.mk: No such file or directory
Creating       FDBLibTLS/generated.mk
/bin/sh: 1: m4: not found
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
make: *** [FDBLibTLS/generated.mk] Error 127
make: Leaving directory `/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb'
Could not generate required c header
root@host00998:/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb/bindings/go# ./fdb-go-install.sh
Usage: fdb-go-install.sh <cmd>

cmd: One of the commands to run. The options are:
     install         Download the FDB go bindings and install them
     localinstall    Install a into the go path a local copy of the repo
     download        Download but do not prepare the FoundationDB bindings
     help            Print this help message and then quit

Command Line Options:
     --fdbver <version>    FoundationDB semantic version (default is 5.1.0)
     -d/--dest-dir <dest>  Local location for the repo (default is to place in go path)

Environment Variable Options:
     REMOTE          Remote repository to download from (currently github.com)
     FDBREPO         Repository of FoundationDB library to download (currently apple/foundationdb)
     FDBLIBDIR       Directory within which should be the FoundationDB c library (currently /usr/lib)
root@host00998:/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb/bindings/go# ./fdb-go-install.sh localinstall --fdbver 5.2.0
Building generated files.
make -C /mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb bindings/c/foundationdb/fdb_c_options.g.h
make: Entering directory `/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb'
Makefile:145: flow/actorcompiler/generated.mk: No such file or directory
Makefile:145: flow/coveragetool/generated.mk: No such file or directory
Makefile:145: fdbclient/vexillographer/generated.mk: No such file or directory
Makefile:145: flow/generated.mk: No such file or directory
Makefile:145: fdbrpc/generated.mk: No such file or directory
Makefile:145: fdbclient/generated.mk: No such file or directory
Makefile:145: fdbbackup/generated.mk: No such file or directory
Makefile:145: fdbserver/generated.mk: No such file or directory
Makefile:145: fdbcli/generated.mk: No such file or directory
Makefile:145: bindings/c/generated.mk: No such file or directory
Makefile:145: bindings/java/generated.mk: No such file or directory
Creating       FDBLibTLS/generated.mk
/bin/sh: 1: m4: not found
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
make: *** [FDBLibTLS/generated.mk] Error 127
make: Leaving directory `/mnt/c/Users/richard/Documents/projects/go/src/github.com/apple/foundationdb'
Could not generate required c header

rlouapre avatar Jul 09 '18 13:07 rlouapre

Yes, the script doesn't support Windows, but the bindings themselves should work. It requires a little more work to make sure you correctly handle the CGO stuff and build the required headers (though those are also distributed with our client packages).

alecgrieser avatar Jul 09 '18 17:07 alecgrieser

Oh, wait, from the Linux subsystem, sorry. Yeah, not sure what that is then.

alecgrieser avatar Jul 09 '18 17:07 alecgrieser