google / cloud-print-connector

Google Cloud Print Connector
BSD 3-Clause "New" or "Revised" License
764 stars 184 forks source link

after cli.GlobalString was removed Google Cloud Print Connector cannot be built #466

Closed okhadkevich closed 4 years ago

okhadkevich commented 4 years ago

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 https://github.com/urfave/cli/issues/926 and I have got an answer https://github.com/urfave/cli/issues/926#issuecomment-552437957

Is there any chance to fix this problem?

rickrich commented 4 years ago

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...

coilysiren commented 4 years ago

👋 Hi @okhadkevich & @rickrich, similarly to this PR https://github.com/google/cloud-print-connector/pull/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: https://github.com/purpleidea/mgmt/pull/571.

jkcdarunday commented 4 years ago

Hmm. I'm trying to migrate this at https://github.com/jkcdarunday/cloud-print-connector/commit/ae788e8d731e06e57f08a5be55d8b021ac595987.

It currently compiles but I should do some tests first before I turn it into a PR.

franzhildenburg commented 4 years ago

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

jkcdarunday commented 4 years ago

@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.

rickrich commented 4 years ago

$ 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!

franzhildenburg commented 4 years ago

$ 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".

rickrich commented 4 years ago

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)

jkcdarunday commented 4 years ago

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.

jkcdarunday commented 4 years ago

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/ ./...