Problems trying to build rclone from source: errors in the ftp backend

Hello everyone,

After a long time since I did it last (in 2016 or so), I'm again trying to build rclone from source.

What I did is to create an Ubuntu 20.04 VM, update it fully, manually install Golang 1.17.5 (not forgetting to set PATH, GOPATH, etc -- it's working OK, at least well enough to compile and run HelloWorld.go) and then pull rclone and its dependencies with go get, but this results in (AFAICS, I'm no Golang expert) in syntax errors in rclone's ftp backend:

$ go get github.com/rclone/rclone/...
[... long list of progress messages omitted  ...] 
go get: installing executables with 'go get' in module mode is deprecated.
        Use 'go install pkg@version' instead.
        For more information, see https://golang.org/doc/go-get-install-deprecation
        or run 'go help get' or 'go help install'.
# github.com/rclone/rclone/backend/ftp
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:331:33: undefined: ftp.DialWithShutTimeout
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:334:33: undefined: ftp.DialWithWritingMDTM
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:507:16: c.IsGetTimeSupported undefined (type *ftp.ServerConn has no field or method IsGetTimeSupported)
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:508:16: c.IsSetTimeSupported undefined (type *ftp.ServerConn has no field or method IsSetTimeSupported)
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:509:16: c.IsTimePreciseInList undefined (type *ftp.ServerConn has no field or method IsTimePreciseInList)
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:999:21: c.GetTime undefined (type *ftp.ServerConn has no field or method GetTime)
REDACTED/pkg/mod/github.com/rclone/rclone@v1.57.0/backend/ftp/ftp.go:1022:9: c.SetTime undefined (type *ftp.ServerConn has no field or method SetTime)

$

So, what am I doing wrong? Isn't go get the proper way to pull in rclone and its dependencies anymore?

Thanks in advance,
-- Durval.

Hi Durval,

The Go and rclone setup has changed since 2016.

I did my first setup in the spring and afterwards updated the contributing guide to reflect the new and easier setup. You see the guide here: rclone/CONTRIBUTING.md at master · rclone/rclone · GitHub

My best advice is to forget your old memories about GOPATH and go get, and then just follow the guide.

Hope it helps, otherwise please ask.

Happy coding,
Ole

2 Likes

Thanks for the tip, @Ole, and sorry for the delay in getting back to you.

Indeed, go get doesn't seem to work anymore; I didn't go through all the steps on CONTRIBUTING.md, but what solved it for me was simply running go build where I previously used to run go get [...] and then make: go build alone downloaded dependencies (all 776MB of them, OUCH -- back in 2016 it used to be ~250MB, so TRIPLE OUCH) and resulted in a shiny new ./rclone binary, ready for immediate execution (or at least responding as expected to ./rclone --version).

Cheers,
-- Durval.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.