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

Build failure with -mod=vendor #714

Closed
dmgk opened this issue Oct 22, 2019 · 1 comment
Closed

Build failure with -mod=vendor #714

dmgk opened this issue Oct 22, 2019 · 1 comment
Labels
🐛 bug "Houston, we've had a problem."

Comments

@dmgk
Copy link

dmgk commented Oct 22, 2019

When building with -mod=govendor:

$ go build -mod=vendor
build github.com/microsoft/azure-devops-go-api/azuredevops: cannot load github.com/microsoft/azure-devops-go-api/azuredevops: open /home/dg/tmp/wtf/vendor/github.com/microsoft/azure-devops-go-api/azuredevops: no such file or directory

go.mod requires github.com/microsoft/azure-devops-go-api but vendor contains github.com/Microsoft/azure-devops-go-api:

$ ls -d ./vendor/github.com/**/azure-devops-go-api
./vendor/github.com/Microsoft/azure-devops-go-api/

Renaming vendor/github.com/Microsoft to vendor/github.com/microsoft reveals another build issue:

# github.com/wtfutil/wtf/modules/devto
modules/devto/widget.go:17:13: undefined: devto.ListedArticle
# github.com/wtfutil/wtf/modules/azuredevops
modules/azuredevops/widget.go:36:14: cannot use cli (type *build.Client) as type build.Client in assignment
modules/azuredevops/widget.go:55:16: cannot convert nil to type build.Client

which requires two files to be patched:

--- modules/azuredevops/widget.go.orig  2019-10-11 19:16:00 UTC
+++ modules/azuredevops/widget.go
@@ -13,7 +13,7 @@ import (

 type Widget struct {
        view.TextWidget
-       cli           azrBuild.Client
+       cli           *azrBuild.Client
        settings      *Settings
        displayBuffer string
        ctx           context.Context
--- modules/azuredevops/widget.go.orig  2019-10-11 19:16:00 UTC
+++ modules/azuredevops/widget.go
@@ -13,7 +13,7 @@ import (

 type Widget struct {
        view.TextWidget
-       cli           azrBuild.Client
+       cli           *azrBuild.Client
        settings      *Settings
        displayBuffer string
        ctx           context.Context

$ less patch-modules_devto_widget.go
--- modules/devto/widget.go.orig        2019-10-11 19:16:00 UTC
+++ modules/devto/widget.go
@@ -14,7 +14,7 @@ import (
 type Widget struct {
        view.KeyboardWidget
        view.ScrollableWidget
-       articles []devto.ListedArticle
+       articles []devto.Article
        settings *Settings
        err      error
 }
@@ -59,7 +59,7 @@ func (widget *Widget) Refresh() {
                widget.articles = nil
                widget.SetItemCount(0)
        } else {
-               var displayArticles []devto.ListedArticle
+               var displayArticles []devto.Article
                var l int
                if len(articles) < widget.settings.numberOfArticles {
                        l = len(articles)

It seems that vendored versions of azure-devops-go-api and devto-api-go are older than expected by the source, could you please update vendored dependencies?

@senorprogrammer senorprogrammer added the 🐛 bug "Houston, we've had a problem." label Oct 24, 2019
@senorprogrammer
Copy link
Collaborator

This is fixed now. I recommend using the following so the output binary doesn't conflict with the /wtf directory at the root level:

    go build -o bin/wtfutil -mod=vendor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug "Houston, we've had a problem."
Development

No branches or pull requests

2 participants