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 fails because of transitive dependency: go-md2man #861

Closed
lszucs opened this issue Aug 13, 2019 · 11 comments
Closed

Build fails because of transitive dependency: go-md2man #861

lszucs opened this issue Aug 13, 2019 · 11 comments
Labels
kind/bug describes or fixes a bug status/triage maintainers still need to look into this

Comments

@lszucs
Copy link

lszucs commented Aug 13, 2019

Recently added dependency go-md2man (maybe in 40d4a25#diff-2a0cb88ddd9482c046c169b7b242d36c ) causes compile time errors.

For some reason, the vendor folder is missing from the dependency. If I clone go-md2man I can build it fine. If I copy the vendor folder under our projects vendor, everything works as expected.

This is only an issue if depending on master branch (rev: 693af58), v1.21.0 is cool.

Issue filed in go-md2man repo: cpuguy83/go-md2man#48

@coilysiren coilysiren added the kind/bug describes or fixes a bug label Aug 14, 2019
@coilysiren
Copy link
Member

@lszucs you mention a build failing, can you provide an example of it failing on CI?

@saschagrunert
Copy link
Member

Hm, I think it can cause issues with go versions older than 1.12, because I'm not sure if this change really works: 3a41d6d

There is a hash calculation mismatch between go 1.11 and and 1.12 which might cause problems.

I tried to reproduce the issue within the latest golang:1.12.8 container, but it seems to work fine:

> docker run -it -e GO111MODULE=on golang:1.12.8 bash -c 'git clone https://github.com/urfave/cli && pushd cli && go build ./...'
Cloning into 'cli'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 4415 (delta 1), reused 1 (delta 0), pack-reused 4408
Receiving objects: 100% (4415/4415), 1.53 MiB | 3.41 MiB/s, done.
Resolving deltas: 100% (2682/2682), done.
/go/cli /go
go: finding github.com/shurcooL/vfsgen v0.0.0-20181202132449-6a9ea43bcacd
go: finding github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
go: finding github.com/BurntSushi/toml v0.3.1
go: finding github.com/cpuguy83/go-md2man v1.0.10
go: finding gopkg.in/yaml.v2 v2.2.2
go: finding github.com/russross/blackfriday v1.5.2
go: finding gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
go: downloading github.com/BurntSushi/toml v0.3.1
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: downloading gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/russross/blackfriday v1.5.2
go: extracting github.com/BurntSushi/toml v0.3.1
go: extracting gopkg.in/yaml.v2 v2.2.2
go: extracting github.com/russross/blackfriday v1.5.2

We could still vendor the dependencies in, but I'm not sure if this is a nice solution for this kind of project.

@lszucs
Copy link
Author

lszucs commented Aug 15, 2019

@lynncyrin

Sorry for not being explicit about it: I receive the same kind of error as in the referenced issue.

$ go build
# github.com/bitrise-io/bitrise/vendor/github.com/cpuguy83/go-md2man/md2man
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK
vendor/github.com/cpuguy83/go-md2man/md2man/md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions)
vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:19:9: cannot use &roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument:
        *roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED
vendor/github.com/cpuguy83/go-md2man/md2man/roff.go:102:11: too many errors

Go version is go1.12.8 darwin/amd64

Note the paths! We're using dep and vendor folders, while the referenced issue seems to use a different scheme.

../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:11:16: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:12:16: undefined: blackfriday.EXTENSION_TABLES
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:13:16: undefined: blackfriday.EXTENSION_FENCED_CODE
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:14:16: undefined: blackfriday.EXTENSION_AUTOLINK
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:15:16: undefined: blackfriday.EXTENSION_SPACE_HEADERS
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:16:16: undefined: blackfriday.EXTENSION_FOOTNOTES
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:17:16: undefined: blackfriday.EXTENSION_TITLEBLOCK
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/md2man.go:19:29: too many arguments to conversion to blackfriday.Markdown: blackfriday.Markdown(doc, renderer, extensions)
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/roff.go:19:9: cannot use &roffRenderer literal (type *roffRenderer) as type blackfriday.Renderer in return argument:
        *roffRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/roff.go:102:11: undefined: blackfriday.LIST_TYPE_ORDERED
../go/pkg/mod/github.com/cpuguy83/go-md2man@v1.0.10/md2man/roff.go:102:11: too many errors

@coilysiren
Copy link
Member

Ah, this looks like it may be the same issue as #866?

@coilysiren
Copy link
Member

@lszucs would be you able to create a sandbox github repo that reproduces this issue on CI?

@coilysiren coilysiren added status/triage maintainers still need to look into this and removed status: user feedback required labels Aug 17, 2019
@lszucs
Copy link
Author

lszucs commented Aug 22, 2019

@lszucs would be you able to create a sandbox github repo that reproduces this issue on CI?

@lynncyrin sure

https://github.com/bitrise-io/bitrise

you must checkout revision 62978c55dd201ecc250c49cc6a591de6d20e1c7e

and simply run go build

You should see the output mentioned above.

@saschagrunert
Copy link
Member

Yeah If we disable go modules, then it surely needs the dependency. We could vendor the dependency in, WDYT @lynncyrin @AudriusButkevicius ?

@AudriusButkevicius
Copy link
Contributor

It seems this issue should be raised with md2man, as there is not really much we can do if that does not correctly specify the version of the dependency? Or perhaps we can fix it in our go mod?

@coilysiren
Copy link
Member

I would prefer we not vendor dependencies - and instead figure out how to fix this using go modules.

@saschagrunert
Copy link
Member

I'm not sure if we can fix this without vendoring...

@AudriusButkevicius
Copy link
Contributor

So it works if you enable go module support, that's what we use for our package management.

The fact that someone tries to build it without go module support is somewhat a Henny Youngman problem, as essentially go modules is the thing that solves the problem they are having,

The fact that they use dep or whatever other dependency manager is completely irrelevant to us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug describes or fixes a bug status/triage maintainers still need to look into this
Projects
None yet
Development

No branches or pull requests

4 participants