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

v1.6.4 broke md2man - blackfriday? #598

Closed
kevincobain2000 opened this issue Jan 5, 2020 · 14 comments · Fixed by #603
Closed

v1.6.4 broke md2man - blackfriday? #598

kevincobain2000 opened this issue Jan 5, 2020 · 14 comments · Fixed by #603
Labels

Comments

@kevincobain2000
Copy link

Describe the bug

Installation of latest version 1.6.4 fails and throws the following error.

To Reproduce

Install Latest version

95cdaaf

■ 1.6.4

╰─$ go get -u github.com/swaggo/swag/cmd/swag                                                                                                                                 2 ↵
go: finding github.com/swaggo/swag/cmd/swag latest
go: finding github.com/swaggo/swag/cmd latest
go: finding github.com/alecthomas/template latest
go: finding github.com/swaggo/files latest
go: finding golang.org/x/sys latest
go: finding golang.org/x/net latest
go: finding golang.org/x/tools latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/crypto latest
go: finding github.com/PuerkitoBio/urlesc latest
go: finding golang.org/x/xerrors latest
go: finding gopkg.in/check.v1 latest
go: finding github.com/modern-go/concurrent latest
# github.com/cpuguy83/go-md2man/md2man
../../../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

Expected behavior

Install the previous version works well


╰─$ go get -u github.com/swaggo/swag/cmd/swag@v1.6.3                                                                                                                          2 ↵
go: finding github.com/swaggo/swag/cmd/swag v1.6.3
go: finding github.com/swaggo/swag/cmd v1.6.3
go: finding github.com/alecthomas/template latest
go: finding github.com/swaggo/files latest
go: finding github.com/modern-go/concurrent latest
go: finding golang.org/x/net latest
go: finding github.com/PuerkitoBio/urlesc latest
go: finding golang.org/x/tools latest
go: finding golang.org/x/sys latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/xerrors latest
go: finding golang.org/x/crypto latest
go: finding gopkg.in/check.v1 latest
go: downloading github.com/urfave/cli v1.22.2
go: extracting github.com/urfave/cli v1.22.2

Your swag version

1.6.4

Your go version

go1.12.5

@sdghchj
Copy link
Member

sdghchj commented Jan 6, 2020

Maybe you had better to upgrade go-md2man to v2.0.0

@josephzidell
Copy link
Contributor

Same issue here. go-md2man is already at 2.0.0

@matthew-palmer
Copy link

Looks like the same issue here as well. Docker builds in our CI that were functional using go get -u github.com/swaggo/swag/cmd/swag to generate documentation that were working Before the update now fail with the same error message.

@rametta
Copy link

rametta commented Jan 6, 2020

Same issue for me. Go version 1.13

# github.com/cpuguy83/go-md2man/md2man
/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
The command '/bin/sh -c go get -u github.com/swaggo/swag/cmd/swag' returned a non-zero code: 2
Exited with code exit status 2

@rametta
Copy link

rametta commented Jan 7, 2020

Until this is fixed, I started doing go get -u github.com/swaggo/swag/cmd/swag@v1.6.3 instead to lock myself to 1.6.3

@matthew-palmer
Copy link

matthew-palmer commented Jan 7, 2020

@rametta That was my approach as well, and it does prevent issues with "latest" breaking existing code functionality.

The issue seems like the interdependencies of the latest v1.6.4 changed the target for go-md2man:

v1.6.3

Step 7/14 : RUN go get -u github.com/swaggo/swag/cmd/swag@v1.6.3
 ---> Running in c0e047a1d545
go: finding github.com/swaggo/swag/cmd/swag v1.6.3
go: finding github.com v1.6.3
go: finding github.com/swaggo/swag/cmd v1.6.3
go: finding github.com/swaggo v1.6.3
go: finding golang.org/x/net latest
go: finding github.com/urfave/cli v1.22.2
go: finding golang.org/x/tools latest
go: finding github.com/PuerkitoBio/urlesc latest
go: downloading github.com/urfave/cli v1.22.2
go: downloading golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042
go: extracting github.com/urfave/cli v1.22.2
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: extracting github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: extracting github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
go: finding github.com/cpuguy83/go-md2man/v2 v2.0.0
go: finding github.com/russross/blackfriday/v2 v2.0.1
go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0
go: extracting github.com/cpuguy83/go-md2man/v2 v2.0.0

v1.6.4

Step 7/14 : RUN go get -u github.com/swaggo/swag/cmd/swag@v1.6.4
 ---> Running in 95954107b5ed
go: finding github.com v1.6.4
go: finding github.com/swaggo/swag/cmd/swag v1.6.4
go: finding github.com/swaggo/swag/cmd v1.6.4
go: finding github.com/swaggo/swag v1.6.4
go: finding github.com/swaggo v1.6.4
go: downloading github.com/swaggo/swag v1.6.4
go: extracting github.com/swaggo/swag v1.6.4
go: finding github.com/PuerkitoBio/urlesc latest
go: finding golang.org/x/tools latest
go: finding golang.org/x/net latest
go: finding github.com/urfave/cli v1.22.2
go: downloading github.com/swaggo/cli v1.20.0
go: downloading golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042
go: extracting github.com/swaggo/cli v1.20.0
go: extracting golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042
go: finding github.com/swaggo/cli v1.22.2
go: downloading github.com/swaggo/cli v1.22.2
go: extracting github.com/swaggo/cli v1.22.2
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: extracting github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/russross/blackfriday v1.5.2
go: extracting github.com/russross/blackfriday v1.5.2
go: finding github.com/cpuguy83/go-md2man v1.0.10
go: finding github.com/russross/blackfriday v2.0.0+incompatible
go: downloading github.com/russross/blackfriday v2.0.0+incompatible
go: extracting github.com/russross/blackfriday v2.0.0+incompatible
go: downloading github.com/shurcooL/sanitized_anchor_name v1.0.0
go: extracting github.com/shurcooL/sanitized_anchor_name v1.0.0
go: finding github.com/shurcooL/sanitized_anchor_name v1.0.0
# github.com/cpuguy83/go-md2man/md2man
/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

@sdghchj
Copy link
Member

sdghchj commented Jan 8, 2020

@ubogdan

@ubogdan
Copy link
Contributor

ubogdan commented Jan 8, 2020

How do I duplicate this error?

 $ pwd
/home/bogdan
$ go version
go version go1.13.4 linux/amd64
$ env | grep GO
$ go get -u github.com/swaggo/swag/cmd/swag
$ ~/go/bin/swag
NAME:
   swag - Automatically generate RESTful API documentation with Swagger 2.0 for Go.

USAGE:
   swag [global options] command [command options] [arguments...]

VERSION:
   v1.6.4

COMMANDS:
   init, i  Create docs.go
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

@josephzidell
Copy link
Contributor

@ubogdan Looks like 1.6.4 regresses and remove the /v2 from go-md2man and blackfriday.

1.6.3:

go: downloading github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: extracting github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d
go: downloading github.com/russross/blackfriday/v2 v2.0.1
go: extracting github.com/russross/blackfriday/v2 v2.0.1

1.6.4

go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: extracting github.com/cpuguy83/go-md2man v1.0.10
go: downloading github.com/russross/blackfriday v1.5.2
go: extracting github.com/russross/blackfriday v1.5.2

@ubogdan
Copy link
Contributor

ubogdan commented Jan 8, 2020

@josephzidell there is no way I can help sine you are giving me unuseful hints. Please run the above commands and paste me the results so I can make clue what it is about.
Thanks.

@josephzidell
Copy link
Contributor

@ubogdan Sure. It gets run in a docker-compose

Step 5/9 : RUN go get -u github.com/swaggo/swag/cmd/swag
 ---> Running in 377bc60236b4
go: finding github.com/swaggo/swag v1.6.4
go: downloading github.com/swaggo/swag v1.6.4
go: extracting github.com/swaggo/swag v1.6.4
go: finding github.com/PuerkitoBio/urlesc latest
go: finding golang.org/x/net latest
go: finding golang.org/x/tools latest
go: finding github.com/urfave/cli v1.22.2
go: downloading github.com/swaggo/cli v1.20.0
go: downloading golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042
go: extracting github.com/swaggo/cli v1.20.0
go: extracting golang.org/x/tools v0.0.0-20200107184032-11e9d9cc0042
go: finding github.com/swaggo/cli v1.22.2
go: downloading github.com/swaggo/cli v1.22.2
go: extracting github.com/swaggo/cli v1.22.2
go: downloading github.com/cpuguy83/go-md2man v1.0.10
go: extracting github.com/cpuguy83/go-md2man v1.0.10
go: finding github.com/cpuguy83/go-md2man v1.0.10
# github.com/cpuguy83/go-md2man/md2man
/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
Service 'builder' failed to build: The command '/bin/sh -c go get -u github.com/swaggo/swag/cmd/swag' returned a non-zero code: 2

@sdghchj
Copy link
Member

sdghchj commented Jan 9, 2020

@ubogdan I guess https://github.com/swaggo/cli/blob/v1.22.0/go.mod#L7 is the problem , however I wonder why it downloads "github.com/swaggo/cli v1.22.2" in the case "github.com/swaggo/cli v1.20.0" specified in go.mod

@ubogdan
Copy link
Contributor

ubogdan commented Jan 9, 2020

@sdghchj I suspect the CI is cloning github.com/swaggo/ into $GOPATH/src/github.com/swaggo/ which is actually disabling VGO.
This is causing go to download the latest library version.

@easonlin404
Copy link
Member

thanks you guys promptly report this issue, I'm fixing it on #603.

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

Successfully merging a pull request may close this issue.

7 participants