How to install x/tools/cmd/goyacc?

1,122 views
Skip to first unread message

Jan Mercl

unread,
Mar 9, 2017, 4:12:59 PM3/9/17
to golang-nuts
I am not able to help with an issue reported (https://github.com/cznic/goyacc/issues/23). I suggested to do

$ go get -u golang.org/x/tools/cmd/goyacc

but that does not seem to work. I tried this:

----

jnml@4670:~$ go get -u -v -x golang.org/x/tools/cmd/goyacc
cd /home/jnml/src/golang.org/x/tools
git config remote.origin.url
Fetching https://golang.org/x/tools/cmd/goyacc?go-get=1
Parsing meta tags from https://golang.org/x/tools/cmd/goyacc?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/goyacc": found meta tag main.metaImport{Prefix:"golang.org/x/tools", VCS:"git", RepoRoot:"https://go.googlesource.com/tools"} at https://golang.org/x/tools/cmd/goyacc?go-get=1
get "golang.org/x/tools/cmd/goyacc": verifying non-authoritative meta tag
Fetching https://golang.org/x/tools?go-get=1
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
golang.org/x/tools (download)
cd /home/jnml/src/golang.org/x/tools
git pull --ff-only
cd /home/jnml/src/golang.org/x/tools
git submodule update --init --recursive
cd /home/jnml/src/golang.org/x/tools
git show-ref
cd /home/jnml/src/golang.org/x/tools
git submodule update --init --recursive
WORK=/tmp/go-build019120220
jnml@4670:~$ cd ~/src/golang.org/x/tools/cmd/goyacc/
jnml@4670:~/src/golang.org/x/tools/cmd/goyacc$ go build -v -x
WORK=/tmp/go-build119161632
golang.org/x/tools/cmd/goyacc
mkdir -p $WORK/golang.org/x/tools/cmd/goyacc/_obj/
mkdir -p $WORK/golang.org/x/tools/cmd/goyacc/_obj/exe/
cd /home/jnml/src/golang.org/x/tools/cmd/goyacc
/home/jnml/go/pkg/tool/linux_amd64/compile -o $WORK/golang.org/x/tools/cmd/goyacc.a -trimpath $WORK -p main -complete -buildid 5078f1c3d92c16b0654b76337f8d332af20e83b0 -D _/home/jnml/src/golang.org/x/tools/cmd/goyacc -I $WORK -pack ./doc.go ./yacc.go
cd .
/home/jnml/go/pkg/tool/linux_amd64/link -o $WORK/golang.org/x/tools/cmd/goyacc/_obj/exe/a.out -L $WORK -extld=gcc -buildmode=exe -buildid=5078f1c3d92c16b0654b76337f8d332af20e83b0 $WORK/golang.org/x/tools/cmd/goyacc.a
mv $WORK/golang.org/x/tools/cmd/goyacc/_obj/exe/a.out goyacc
jnml@4670:~/src/golang.org/x/tools/cmd/goyacc$ ll
celkem 2820
-rw-rw-r-- 1 jnml jnml 2461 pro 16 00:36 doc.go
-rwxrwxr-x 1 jnml jnml 2802522 bře 9 22:09 goyacc*
drwxrwxr-x 3 jnml jnml 4096 pro 16 00:36 testdata/
-rw-rw-r-- 1 jnml jnml 71321 bře 9 22:01 yacc.go
jnml@4670:~/src/golang.org/x/tools/cmd/goyacc$ go install -v -x
WORK=/tmp/go-build989477661
jnml@4670:~/src/golang.org/x/tools/cmd/goyacc$ go tool yacc
go tool: no such tool "yacc"
jnml@4670:~/src/golang.org/x/tools/cmd/goyacc$ go tool goyacc
go tool: no such tool "goyacc"
jnml@4670:~/src/golang.org/x/tools/cmd/goyacc$

----

I'm sure I'm missing something, thanks in advance to anyone enlightening me.

--

-j

Bakul Shah

unread,
Mar 9, 2017, 4:32:50 PM3/9/17
to Jan Mercl, golang-nuts
On Thu, 09 Mar 2017 21:12:20 GMT Jan Mercl <0xj...@gmail.com> wrote:
>
> I am not able to help with an issue reported (
> https://github.com/cznic/goyacc/issues/23). I suggested to do
>
> $ go get -u golang.org/x/tools/cmd/goyacc
>
> but that does not seem to work. I tried this:

go get -u ... works fine on FreeBSD with go-1.8 but "go tool"
shows that yacc is not supported. ktrace/kdump reveals it is
looking for yacc in /usr/local/go/pkg/tool/freebsd_amd64/yacc
I'd suggest changing the Makefile rules for processing goyacc
files.
Reply all
Reply to author
Forward
0 new messages