I was wondering, are there any instructions for building on Windows now? With the addition of FUSE for Windows from WinFsp and mingw-w64, the original way of compiling rclone (go install) is now a bit more complicated. I’ve tried to hack it together based off the .appveyor.yml file, but I’m still at a loss on how its all setup. I’ve looked around for a doc or instructions, but haven’t found anything yet. Thanks!
Here’s what I was able to get to build a windows binary. Note the following, however:
- I’ve never used Go before, and I’m sure I made many silly/rookie mistakes
- I don’t have the GIT binary installed on my Windows PC
- I have very little GIT experience
- the rclone.exe file that was created was 25MB vs the download exe of 14MB file
If you’re still reading this…
-
download/install the Go compiler from:
https://golang.org/doc/install?download=go1.9.2.windows-amd64.msi -
create a GoLang directory/folder and the subdirs/folders bin, pkg, and src in the GoLang dir/folder:
+ golang
| + bin
| + pkg
| + src -
download the rclone source from
https://github.com/ncw/rclone/archive/v1.38.zip -
unpack this zip into the src subdir/subfolder
-
(Note - the following is probably my biggest assumption/error.)
Because I think I have all of the 1.38 source, and do not have a git binary, create the new folder:
GoLang\src\rclone-1.38\vendor\github.com\ncw\rclone
-
move the 25 dirs/folders from rclone-1.38 to this new "
vendor\github.com\ncw\rclone"
subdir
amazonclouddrive
azureblob
b2
box
cmd
crypt
dircache
drive
dropbox
fs
fstest
ftp
googlecloudstorage
http
hubic
local
oauthutil
onedrive
pacer
qingstor
rest
s3
sftp
swift
yandex -
open a cmd window and switch to it
-
set the GOPATH environment variable to the GoLang directory, such as:
SET GOPATH="C:\Pg1\Temp\GoLang"
-
switch to the rclone directory:
cd /d c:\pg1\temp\GoLang\src\rclone1-38
-
build rclone via:
go build
Note in the bin directory there is the .bat file I use to set the environment up on windows
The best way of getting the rclone source is to install go, and git, set the GOPATH (see that bat file) then type go get -u -v github.com/ncw/rclone
changing into the rclone source directory %GOPATH%/src/github.com/ncw/rclone
then running go build
or go install
will build the binary.
If you want mount too, then you’ll have to make sure you have mingw installed, the winfsp developemnt kit, and build with go build -tags cmount
.
Hope that helps!