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

Failed to go build -o wsk using README.md instructions due to older client-go version #398

Open
nitishm opened this issue Jan 18, 2019 · 8 comments
Labels

Comments

@nitishm
Copy link

nitishm commented Jan 18, 2019

I cannot get the wsk CLI to build, following the README.md instructions page.

The go build -o wsk command fails with the following error -

go build -o wsk
# github.com/apache/incubator-openwhisk-cli/commands
commands/action.go:911:10: limits.Concurrency undefined (type *"github.com/apache/incubator-openwhisk-cli/vendor/github.com/apache/incubator-openwhisk-client-go/whisk".Limits has no field or method Concurrency)
commands/project.go:40:20: cannot use cobraCMD (type *"github.com/apache/incubator-openwhisk-cli/vendor/github.com/spf13/cobra".Command) as type *"github.com/spf13/cobra".Command in argument to cmd.Deploy
commands/project.go:51:22: cannot use cobraCMD (type *"github.com/apache/incubator-openwhisk-cli/vendor/github.com/spf13/cobra".Command) as type *"github.com/spf13/cobra".Command in argument to cmd.Undeploy
commands/project.go:63:20: cannot use cobraCMD (type *"github.com/apache/incubator-openwhisk-cli/vendor/github.com/spf13/cobra".Command) as type *"github.com/spf13/cobra".Command in argument to cmd.Deploy
commands/project.go:74:26: cannot use cobraCMD (type *"github.com/apache/incubator-openwhisk-cli/vendor/github.com/spf13/cobra".Command) as type *"github.com/spf13/cobra".Command in argument to cmd.ExportCmdImp

I can resolve the cobra errors by deleting the package from the vendor dir (not ideal), but the other issue,

go build -o wsk
# github.com/apache/incubator-openwhisk-cli/commands
commands/action.go:911:10: limits.Concurrency undefined (type *"github.com/apache/incubator-openwhisk-cli/vendor/github.com/apache/incubator-openwhisk-client-go/whisk".Limits has no field or method Concurrency)

, seems to be stemming from a mismatched client-go version.

I can see the master branch for github.com/apache/incubator-openwhisk-client-go/ now has the Concurrency field added to the Limits struct (https://github.com/apache/incubator-openwhisk-client-go/blob/master/whisk/shared.go#L100), but go get seems to fetch an older commit of the client-go library causing the build to fail.

@nitishm nitishm changed the title Failed to go build -o wsk using README.md instructions Failed to go build -o wsk using README.md instructions due to older client-go version Jan 18, 2019
@dubee
Copy link
Member

dubee commented Jan 18, 2019

@nitishm, have you tried ./gradlew compile -PnativeCompile?

@nitishm
Copy link
Author

nitishm commented Jan 18, 2019

@nitishm, have you tried ./gradlew compile -PnativeCompile?

I haven't tried that yet. I used the go get instructions to compile it myself.

@rabbah
Copy link
Member

rabbah commented Jan 26, 2019

I reproduced this same error... btw, we need to nuke gradle in this repo and just use native go build it's 1000x faster.

@rabbah rabbah added the bug label Jan 26, 2019
@rabbah
Copy link
Member

rabbah commented Jan 26, 2019

@nitishm bumping the hashes for the client resolves the concurrency issue:

diff --git a/vendor/vendor.json b/vendor/vendor.json
index 4a2176e..a738088 100644
--- a/vendor/vendor.json
+++ b/vendor/vendor.json
@@ -3,16 +3,16 @@
        "ignore": "test",
        "package": [
                {
-                       "checksumSHA1": "ASp79qek5lZJ18lexnxnnw8wQSs=",
+                       "checksumSHA1": "krP/Rb7hvLXzwRp+5spDj5WBk9g=",
                        "path": "github.com/apache/incubator-openwhisk-client-go/whisk",
-                       "revision": "d7cee96e83a1f38413a1f5286bd524dac72686c9",
-                       "revisionTime": "2018-08-03T16:52:51Z"
+                       "revision": "41bdfc4b124d7a9e419ba72ab19ce31f01338509",
+                       "revisionTime": "2019-01-21T12:59:58Z"
                },
                {
                        "checksumSHA1": "4NY5lFykxXaoN+JNMxo179L79sU=",
                        "path": "github.com/apache/incubator-openwhisk-client-go/wski18n",
-                       "revision": "d7cee96e83a1f38413a1f5286bd524dac72686c9",
-                       "revisionTime": "2018-08-03T16:52:51Z"
+                       "revision": "41bdfc4b124d7a9e419ba72ab19ce31f01338509",
+                       "revisionTime": "2019-01-21T12:59:58Z"
                },

@nitishm
Copy link
Author

nitishm commented Jan 26, 2019

Thanks @rabbah I will try that !

rabbah added a commit to rabbah/incubator-openwhisk-cli that referenced this issue Jan 26, 2019
rabbah added a commit to rabbah/incubator-openwhisk-cli that referenced this issue Jan 26, 2019
@rabbah
Copy link
Member

rabbah commented Jan 26, 2019

The problem comes about because of multiple references to the cobra package, including the offending duplication from wskdeploy. The compiler can't determine that the package in vendor and GOPATH are the same and hence the types do not match. The deduplication has to be occur before building and likely this requires some adjustments across this and the wskdeploy project.

csantanapr pushed a commit that referenced this issue Jan 26, 2019
* Update README for running tests with Go and add an action test.

* Bump vendors.

* Update docs for #398.
@dubee
Copy link
Member

dubee commented Jan 29, 2019

@rabbah, can this be closed now?

@rabbah
Copy link
Member

rabbah commented Jan 29, 2019

I documented a workaround - I don't think this is the ideal solution - there's a packaging confusion between wskdeploy and the cli that should be avoided and fixed.

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

No branches or pull requests

3 participants