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

markdown: fails to build in module mode because latest version of github.com/russross/blackfriday is v2.0.0+incompatible, which isn't compatible #47

Closed
julieqiu opened this issue Mar 24, 2019 · 3 comments

Comments

@julieqiu
Copy link

go version

go version go1.12.1 darwin/amd64

go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/julie/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/julie/go:/Users/julie/bin:/usr/local/opt/go/libexec"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/0_/k0p673rx4r9789jf0pm9425r0000gn/T/go-build590769926=/tmp/go-build -gno-record-gcc-switches -fno-common"

Output of go get -u github.com/shurcooL/markdownfmt

julie@Julies-Air|/tmp/mdtest
) go get -u github.com/shurcooL/markdownfmt

go: finding github.com/shurcooL/markdownfmt latest
go: finding github.com/shurcooL/go/indentwriter latest
go: finding github.com/shurcooL/go latest
go: finding golang.org/x/crypto/ssh/terminal latest
go: finding golang.org/x/crypto/ssh latest
go: finding golang.org/x/crypto latest
# github.com/shurcooL/markdownfmt/markdown
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:136:11: undefined: blackfriday.LIST_TYPE_ORDERED
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:145:11: undefined: blackfriday.LIST_TYPE_ORDERED
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:155:12: undefined: blackfriday.LIST_ITEM_END_OF_LIST
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:188:30: undefined: blackfriday.TABLE_ALIGNMENT_LEFT
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:196:30: undefined: blackfriday.TABLE_ALIGNMENT_RIGHT
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:212:9: undefined: blackfriday.TABLE_ALIGNMENT_LEFT
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:217:9: undefined: blackfriday.TABLE_ALIGNMENT_CENTER
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:226:9: undefined: blackfriday.TABLE_ALIGNMENT_RIGHT
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:467:2: cannot use mr (type *markdownRenderer) as type blackfriday.Renderer in return argument:
	*markdownRenderer does not implement blackfriday.Renderer (missing RenderFooter method)
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:487:21: undefined: blackfriday.EXTENSION_NO_INTRA_EMPHASIS
/Users/julie/go/pkg/mod/github.com/shurcoo!l/[email protected]/markdown/main.go:487:21: too many errors
@julieqiu julieqiu changed the title issue with undefined blackfriday variables when running go get -u issue with undefined blackfriday variables when installing Mar 24, 2019
@julieqiu julieqiu changed the title issue with undefined blackfriday variables when installing errors with undefined blackfriday variables when installing Mar 24, 2019
@dmitshur
Copy link
Member

Thanks for reporting.

The problem is that the package github.com/shurcooL/markdownfmt/markdown imports github.com/russross/blackfriday with the intention of getting the blackfriday v1 API. Unfortunately, the blackfriday v2 API made a v2.0.0 tag before modules came out (it was for the purpose of working with gopkg.in), and it results in the "latest" version of github.com/russross/blackfriday according to cmd/go to be v2.0.0+incompatible instead of something that's actually v1, e.g., v1.5.2.

I'm not sure if it's possible for blackfriday to fix the "latest" version of the github.com/russross/blackfriday import path so that it provides the v1 API rather than v2 (which is meant to be available at the github.com/russross/blackfriday/v2 import path). /cc @bcmills

I can fix it in this project by explicitly requiring an older compatible version v1.5.2 of github.com/russross/blackfriday. This issue and the fix are very similar to shurcooL/github_flavored_markdown#22.

@dmitshur dmitshur changed the title errors with undefined blackfriday variables when installing markdown: fails to build in module mode because latest version of github.com/russross/blackfriday is v2.0.0+incompatible, which isn't compatible Mar 24, 2019
@dmitshur
Copy link
Member

dmitshur commented Mar 24, 2019

It turns out I can't use v1.5.2 because it's too old and doesn't include the fix for russross/blackfriday#495, which this project depends on.

@dmitshur
Copy link
Member

dmitshur commented Mar 24, 2019

I'll use the latest pseudo-version of v1 API for now, and open an issue for blackfriday to make a newer v1 release version. Opened russross/blackfriday#533 for that.

dmitshur added a commit that referenced this issue Jan 17, 2021
There is now a released version of blackfriday v1 that includes the
bug fix for russross/blackfriday#495 that
our tests rely on. Start using it instead of an older pseudo-version.

Updates #47.
Updates russross/blackfriday#587.
dmitshur added a commit that referenced this issue Jan 17, 2021
There is now a released version of blackfriday v1 that includes the
bug fix for russross/blackfriday#495 that
our tests rely on. Start using it instead of an older pseudo-version.

Updates #47.
Updates russross/blackfriday#587.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants