duplicacy icon indicating copy to clipboard operation
duplicacy copied to clipboard

swift v2 breaking build

Open chaseadam opened this issue 4 years ago • 4 comments

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

chaseadam avatar Feb 18 '21 17:02 chaseadam

Can you elaborate how to do that?

Robert-M-Muench avatar May 11 '21 07:05 Robert-M-Muench

Ok, here we go:

  1. Get into the GO-PROJECT/src/github.com/ncw/swift directory
  2. $ git checkout tags/v1.0.53
  3. build duplicacy

Robert-M-Muench avatar May 11 '21 07:05 Robert-M-Muench

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.

philband avatar May 22 '21 16:05 philband

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.

Ingsuifon avatar Apr 02 '22 08:04 Ingsuifon