Building recent version fails with "Context.App.Writer undefined (type *cli.App has no field or method Writer)"

Attempting to build recent version of duplicacy fails:

me@obsidian ~ % brew upgrade
me@obsidian ~ % go version
go version go1.16.3 darwin/amd64
me@obsidian ~ % go get -u github.com/gilbertchen/duplicacy/...
go: downloading github.com/gilbertchen/duplicacy v1.2.5
go: downloading github.com/gilbertchen/duplicacy v2.7.2+incompatible
go: downloading github.com/gilbertchen/azure-sdk-for-go v0.2.0-beta
go: downloading cloud.google.com/go/storage v1.14.0
go: downloading github.com/bkaradzic/go-lz4 v1.0.0
go: downloading github.com/aws/aws-sdk-go v1.38.17
go: downloading github.com/gilbertchen/cli v1.2.0
go: downloading github.com/gilbertchen/go-ole v1.2.0
go: downloading github.com/gilbertchen/goamz v0.0.0-20170712012135-eada9f4e8cc2
go: downloading github.com/gilbertchen/keyring v0.0.0-20170923175943-8855f5632086
go: downloading github.com/gilbertchen/gopass v0.0.0-20170109162249-bf9dde6d0d2c
go: downloading cloud.google.com/go v0.81.0
go: downloading github.com/gilbertchen/go-dropbox v0.0.0-20201103213208-2233fa1dd846
go: downloading github.com/aryann/difflib v0.0.0-20210328193216-ff5ff6dc229b
go: downloading github.com/minio/highwayhash v1.0.2
go: downloading github.com/gilbertchen/azure-sdk-for-go v14.1.1+incompatible
go: downloading github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1
go: downloading github.com/pkg/sftp v1.13.0
go: downloading github.com/ncw/swift v1.0.53
go: downloading github.com/klauspost/reedsolomon v1.9.12
go: downloading golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2
go: downloading github.com/pkg/xattr v0.4.3
go: downloading golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1
go: downloading golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602
go: downloading google.golang.org/api v0.44.0
go: downloading github.com/googleapis/gax-go/v2 v2.0.5
go: downloading google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1
go: downloading golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57
go: downloading github.com/googleapis/gax-go v1.0.3
go: downloading google.golang.org/grpc v1.36.1
go: downloading github.com/klauspost/cpuid/v2 v2.0.2
go: downloading google.golang.org/appengine v1.6.7
go: downloading github.com/kr/fs v0.1.0
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/golang/protobuf v1.5.1
go: downloading github.com/jstemmer/go-junit-report v0.9.1
go: downloading golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5
go: downloading google.golang.org/grpc v1.37.0
go: downloading github.com/klauspost/cpuid/v2 v2.0.6
go: downloading github.com/klauspost/cpuid v1.3.1
go: downloading golang.org/x/tools v0.1.0
go: downloading go.opencensus.io v0.23.0
go: downloading github.com/golang/protobuf v1.5.2
go: downloading google.golang.org/genproto v0.0.0-20210406143921-e86de6bf7a46
go: downloading golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1
go: downloading golang.org/x/term v0.0.0-20210406210042-72f3dc4e9b72
go: downloading github.com/jmespath/go-jmespath v0.4.0
go: downloading google.golang.org/protobuf v1.26.0
go: downloading github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
go: downloading golang.org/x/mod v0.4.1
go: downloading github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da
go: downloading golang.org/x/mod v0.4.2
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading golang.org/x/text v0.3.6
go: downloading github.com/Azure/go-autorest v1.1.1
go: downloading github.com/Azure/azure-sdk-for-go v0.2.0-beta
go: downloading github.com/marstr/guid v1.1.0
go: downloading github.com/satori/go.uuid v1.2.0
go: downloading github.com/Azure/go-autorest/autorest v0.11.18
go: downloading github.com/gilbertchen/go.dbus v0.0.0-20190607191240-8591994fa32f
go: downloading github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec
go: downloading github.com/Azure/go-autorest v14.2.0+incompatible
go: downloading github.com/Azure/azure-sdk-for-go v53.1.0+incompatible
go: downloading github.com/Azure/go-autorest/tracing v0.6.0
go: downloading github.com/Azure/go-autorest/autorest/adal v0.9.13
go: downloading github.com/Azure/go-autorest/logger v0.2.1
go: downloading github.com/form3tech-oss/jwt-go v3.2.2+incompatible
go: downloading github.com/Azure/go-autorest/autorest/date v0.3.0
go: downloading github.com/form3tech-oss/jwt-go v1.0.2
# github.com/gilbertchen/duplicacy/duplicacy
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:124:26: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:249:26: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:381:27: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:392:27: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:404:28: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:414:28: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:548:26: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:641:26: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:734:26: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:795:26: context.App.Writer undefined (type *cli.App has no field or method Writer)
go/pkg/mod/github.com/gilbertchen/duplicacy@v2.7.2+incompatible/duplicacy/duplicacy_main.go:795:26: too many errors

I’m not very familiar with go build process, but quick googling finds this: go modules - What does 'incompatible' in go.mod mean, will it cause harm? - Stack Overflow

Figured it out. It’s a modules thing in recent go. Switch back to legacy gopath behavior works:

GO111MODULE=off go get -u github.com/gilbertchen/duplicacy/...

I’m now hitting a different issue – but this seems to be an actual broken code.

github.com/gilbertchen/duplicacy/src
go/src/github.com/gilbertchen/duplicacy/src/duplicacy_swiftstorage.go:132:31: not enough arguments in call to connection.Authenticate
	have ()
	want ("context".Context)
go/src/github.com/gilbertchen/duplicacy/src/duplicacy_swiftstorage.go:137:34: not enough arguments in call to connection.Container
	have (string)
	want ("context".Context, string)

You need an older version of github.com/ncw/swift:

cd $GOPATH/src/github.com/ncw/swift
git checkout tags/v1.0.50
1 Like

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