Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

swift v2 breaking build #618

Open
chaseadam opened this issue Feb 18, 2021 · 4 comments
Open

swift v2 breaking build #618

chaseadam opened this issue Feb 18, 2021 · 4 comments

Comments

@chaseadam
Copy link

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

@Robert-M-Muench
Copy link

Robert-M-Muench commented May 11, 2021

Can you elaborate how to do that?

@Robert-M-Muench
Copy link

Robert-M-Muench commented May 11, 2021

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

@philband
Copy link
Contributor

philband commented May 22, 2021

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.

@Ingsuifon
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants