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

install instructions don't do a build, have to run make #846

Closed
dflock opened this issue Apr 8, 2021 · 4 comments
Closed

install instructions don't do a build, have to run make #846

dflock opened this issue Apr 8, 2021 · 4 comments

Comments

@dflock
Copy link
Contributor

dflock commented Apr 8, 2021

The current build instructions say to do this:

$ go get -u github.com/bytesparadise/libasciidoc

I do this and it works:

$ echo $GOPATH

/home/duncan/.go

$ go get -u -v github.com/bytesparadise/libasciidoc

github.com/bytesparadise/libasciidoc (download)
github.com/davecgh/go-spew (download)
github.com/pkg/errors (download)
github.com/sirupsen/logrus (download)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
get "golang.org/x/sys/internal/unsafeheader": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/internal/unsafeheader?go-get=1
get "golang.org/x/sys/internal/unsafeheader": verifying non-authoritative meta tag
get "gopkg.in/yaml.v2": found meta tag get.metaImport{Prefix:"gopkg.in/yaml.v2", VCS:"git", RepoRoot:"https://gopkg.in/yaml.v2"} at //gopkg.in/yaml.v2?go-get=1
gopkg.in/yaml.v2 (download)
github.com/alecthomas/chroma (download)
github.com/dlclark/regexp2 (download)
github.com/danwakefield/fnmatch (download)

and I get this stuff in my gopath, but no executable:

$ fd asciidoc $GOPATH

/home/duncan/.go/pkg/linux_amd64/github.com/bytesparadise/libasciidoc.a
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/cmd/libasciidoc
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc_bench_test.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc_suite_test.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc_test.go

After reading #687 and this, I ran this:

$ cd ~/.go/src/github.com/bytesparadise/libasciidoc
$ make install

go: downloading github.com/spf13/cobra v1.1.1
go: downloading github.com/sirupsen/logrus v1.7.0
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/alecthomas/chroma v0.7.1
go: downloading github.com/sergi/go-diff v1.0.0
go: downloading github.com/onsi/ginkgo v1.13.0
go: downloading github.com/onsi/gomega v1.10.1
go: downloading golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634
go: downloading github.com/spf13/pflag v1.0.5
go: downloading github.com/nxadm/tail v1.4.4
go: downloading github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964
go: downloading github.com/dlclark/regexp2 v1.1.6
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading github.com/fsnotify/fsnotify v1.4.9
generated parser is ok
go: downloading github.com/mna/pigeon v1.0.1-0.20200224192238-18953b277063
go: downloading golang.org/x/tools v0.0.0-20201013201025-64a9e34f3752
golang.org/x/mod/semver
golang.org/x/xerrors/internal
golang.org/x/xerrors
golang.org/x/tools/internal/fastwalk
github.com/mna/pigeon/ast
golang.org/x/tools/internal/event/label
golang.org/x/tools/go/ast/astutil
golang.org/x/tools/internal/event/keys
golang.org/x/tools/internal/gopathwalk
golang.org/x/mod/module
golang.org/x/tools/internal/event/core
github.com/mna/pigeon/builder
golang.org/x/tools/internal/event
golang.org/x/tools/internal/gocommand
golang.org/x/tools/internal/imports
golang.org/x/tools/imports
github.com/mna/pigeon
no need to regenerate the parser.
building /home/duncan/.go/src/github.com/bytesparadise/libasciidoc/bin/libasciidoc (commit:82bfd34 / tag:v0.6.0 / time:2021-04-08T05:37:46Z)
go: downloading golang.org/x/net v0.0.0-20200822124328-c89045814202
go: downloading golang.org/x/text v0.3.2

I now have an executable, which wasn't there before (the first result):

$ fd asciidoc $GOPATH
/home/duncan/.go/bin/libasciidoc
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc_bench_test.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc_suite_test.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/libasciidoc_test.go
/home/duncan/.go/src/github.com/bytesparadise/libasciidoc/cmd/libasciidoc
/home/duncan/.go/pkg/linux_amd64/github.com/bytesparadise/libasciidoc.a

which works:

$ libasciidoc version
version:    v0.6.0
build time: 2021-04-08T05:37:46Z

Not very experienced with go, so I don't know why this is?

$ go version
go version go1.15.7 linux/amd64

$ cat /etc/os-release | rg VERSION=
VERSION="20.04.2 LTS (Focal Fossa)"
@xcoulon
Copy link
Member

xcoulon commented Apr 8, 2021

hello @dflock and thanks for raising this issue.
You're right, you need to run make install to get a proper binary.
I will update the docs accordingly.

@dflock
Copy link
Contributor Author

dflock commented Apr 9, 2021

Like this? #847

@xcoulon xcoulon added this to the v0.7.0 milestone Mar 4, 2022
@xcoulon xcoulon closed this as completed in b4dc80e Mar 4, 2022
@DavidGamba
Copy link
Contributor

@xcoulon It would be great if the canonical Go install way would be the de-facto installation method.

This currenctly works:

$ go install github.com/bytesparadise/libasciidoc/cmd/libasciidoc@latest

$ which libasciidoc 
/Users/david/go/bin/libasciidoc

$ libasciidoc 
libasciidoc is a tool to convert from Asciidoc to HTML
...

@xcoulon
Copy link
Member

xcoulon commented Mar 4, 2022

@xcoulon It would be great if the canonical Go install way would be the de-facto installation method.

This currenctly works:

$ go install github.com/bytesparadise/libasciidoc/cmd/libasciidoc@latest

$ which libasciidoc 
/Users/david/go/bin/libasciidoc

$ libasciidoc 
libasciidoc is a tool to convert from Asciidoc to HTML
...

this works, indeed, but then you don't get the proper version:

$ libasciidoc version
commit:     
build time: 

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

No branches or pull requests

3 participants