after cli.GlobalString was removed Google Cloud Print Connector cannot be built
okhadkevich opened this issue ยท 10 comments
I have an error when building Google Cloud Print Connector:
$ go get github.com/google/cloud-print-connector/...
github.com/google/cloud-print-connector/lib
go/src/github.com/google/cloud-print-connector/lib/config_unix.go:235:15: context.GlobalString undefined (type *cli.Context has no field or method GlobalString)
I have asked a question at urfave/cli#926 and I have got an answer
urfave/cli#926 (comment)
Is there any chance to fix this problem?
Ditto. Running under Fedora 30...
$ go get -insecure -u github.com/google/cloud-print-connector/...
# github.com/google/cloud-print-connector/lib
src/github.com/google/cloud-print-connector/lib/config_unix.go:235:15: context.GlobalString
undefined (type *cli.Context has no field or method GlobalString)
It used to work...
๐ Hi @okhadkevich & @rickrich, similarly to this PR #283, this repo needs to get updated with the latest changes we made to urfave/cli
.
Here's an example of someone making this update: purpleidea/mgmt#571.
Hmm. I'm trying to migrate this at jkcdarunday@ae788e8.
It currently compiles but I should do some tests first before I turn it into a PR.
Hmm. I'm trying to migrate this at jkcdarunday@ae788e8.
It currently compiles but I should do some tests first before I turn it into a PR.
With your changes @jkcdarunday , I'm now getting:
$ go get github.com/jkcdarunday/cloud-print-connector/...
# github.com/google/cloud-print-connector/lib
go\src\github.com\google\cloud-print-connector\lib\config_windows.go:162:15: context.GlobalString undefined (type *cli.Context has no field or method GlobalString)
# github.com/jkcdarunday/cloud-print-connector/lib
go\src\github.com\jkcdarunday\cloud-print-connector\lib\config_windows.go:162:15: context.GlobalString undefined (type *cli.Context has no field or method GlobalString)
Thanks
@franzhildenburg
Ahh. Looks like I missed the files targeting Windows. I've applied the windows-related changes on my fork. Now testing it on a Windows machine.
$ go get -insecure -u github.com/jkcdarunday/cloud-print-connector/...
# github.com/google/cloud-print-connector/lib
src/github.com/google/cloud-print-connector/lib/config_unix.go:235:15: context.GlobalString undefined (type *cli.Context has no field or method GlobalString)
Still doesn't work!
$ go get -insecure -u github.com/jkcdarunday/cloud-print-connector/...
# github.com/google/cloud-print-connector/lib
src/github.com/google/cloud-print-connector/lib/config_unix.go:235:15: context.GlobalString undefined (type *cli.Context has no field or method GlobalString)
Still doesn't work!
I think you have to rename the "imports" that refer to "github.com/google/cloud-print-connector" to make it work under jkcdarunday's fork.
E.g. in jkcdarunday/cloud-print-connector/blob/master/gcp-connector-util/init.go, rename "github.com/google/cloud-print-connector/lib" to "github.com/jkcdarunday/cloud-print-connector/lib".
So I should file a bug report on jkcdarunday fork, then?
Where are the Issues for jkcdarunday fork?
$ pwd
/home/rick/go
$ find . -print | grep blob
$
No "blob" at all!
$ vi ./src/github.com/jkcdarunday/cloud-print-connector/gcp-connector-util/init.go
"github.com/jkcdarunday/cloud-print-connector/gcp"
"github.com/jkcdarunday/cloud-print-connector/lib"
:wq
$ go get -insecure -u github.com/jkcdarunday/cloud-print-connector/...
# github.com/google/cloud-print-connector/lib
src/github.com/google/cloud-print-connector/lib/config_unix.go:235:15: context.GlobalString undefined (type *cli.Context has no field or method GlobalString)
You shouldn't be running go get
on the fork as it's meant as a PR to merge to this upstream repo. That's why the imports don't refer to itself and the fork won't compile.
When I'm testing the fork, what I do is the ff.:
# The ff. will fail but will pull cloud-print-connector and to your $GOPATH
go get -v github.com/google/cloud-print-connector/...
# Checkout forked branch
cd $GOPATH/src/github.com/google/cloud-print-connector/
git remote add jkcdarunday https://github.com/jkcdarunday/cloud-print-connector
git fetch --all
git checkout -b migrate-urfave-cli jkcdarunday/migrate-urfave-cli
# Build
mkdir build
go build -o build/ ./...