swift v2 breaking build
swift v2 released 27 days ago: https://github.com/ncw/swift/releases/tag/v2.0.0
Looks like there was some attempt to keep from running into this type of build breaking change, but didn't work for me. Here is the "migration" guidance which lines up with the build error:
https://github.com/ncw/swift#migrating-from-v1
[vagrant@xxx duplicacy]$ go build duplicacy/duplicacy_main.go
# github.com/gilbertchen/duplicacy/src
src/duplicacy_swiftstorage.go:132:31: not enough arguments in call to connection.Authenticate
have ()
want ("context".Context)
src/duplicacy_swiftstorage.go:137:34: not enough arguments in call to connection.Container
have (string)
want ("context".Context, string)
src/duplicacy_swiftstorage.go:171:47: not enough arguments in call to storage.connection.ObjectsAll
have (string, *swift.ObjectsOpts)
want ("context".Context, string, *swift.ObjectsOpts)
src/duplicacy_swiftstorage.go:193:40: not enough arguments in call to storage.connection.ObjectDelete
have (string, string)
want ("context".Context, string, string)
src/duplicacy_swiftstorage.go:198:38: not enough arguments in call to storage.connection.ObjectMove
have (string, string, string, string)
want ("context".Context, string, string, string, string)
src/duplicacy_swiftstorage.go:210:45: not enough arguments in call to storage.connection.Object
have (string, string)
want ("context".Context, string, string)
src/duplicacy_swiftstorage.go:226:47: not enough arguments in call to storage.connection.ObjectOpen
have (string, string, bool, nil)
want ("context".Context, string, string, bool, swift.Headers)
src/duplicacy_swiftstorage.go:237:39: not enough arguments in call to storage.connection.ObjectPut
have (string, string, *RateLimitedReader, bool, string, string, nil)
want ("context".Context, string, string, io.Reader, bool, string, string, swift.Headers)
Workaround was to checkout the 1.x version of swift
Can you elaborate how to do that?
Ok, here we go:
- Get into the GO-PROJECT/src/github.com/ncw/swift directory
- $ git checkout tags/v1.0.53
- build duplicacy
As the project is using go-dep, I suppose the correct way to do this would be
dep ensure -add github.com/ncw/[email protected]
I will open a PR for this later on.
Edit: go-dep seems to be deprecated, and there already is a PR suggesting to switch to go mod.
My solution is that I fork the project and I manually add "context.TODO()" as the lost argument, then modify the duplicacy_main.go to make it import from my own repo. Then it can build.