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

x/tools/cmd/guru: go-guru-build-tags in go-guru.el does not work #16756

Closed
nwidger opened this issue Aug 17, 2016 · 2 comments
Closed

x/tools/cmd/guru: go-guru-build-tags in go-guru.el does not work #16756

nwidger opened this issue Aug 17, 2016 · 2 comments

Comments

@nwidger
Copy link
Contributor

nwidger commented Aug 17, 2016

Please answer these questions before submitting your issue. Thanks!

  1. What version of Go are you using (go version)?
go version go1.7 darwin/amd64
  1. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/niels/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bb/xxdvfvm103n8p4vktz66d7d40000gn/T/go-build040892158=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"

I'm using go-guru with Emacs 24.5.1 from emacsformacosx.com, here's my M-x version RET output:

GNU Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21) of 2015-04-10 on builder10-9.porkrind.org
  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    A complete runnable program is good.
    A link on play.golang.org is best.
  • Open Emacs with go-guru.el from this commit loaded
  • Type M-x customize-group RET go-guru RET
  • Type M-x eval-expression RET (setq go-guru-build-tags "one") RET
  • Type M-x toggle-debug-on-error RET
  • Run any go-guru command that calls go-guru--command
  1. What did you expect to see?

Normal guru output.

  1. What did you see instead?

The following stacktrace is produced:

Debugger entered--Lisp error: (wrong-type-argument sequencep 111)
  mapconcat(identity "one" ",")
  (format "-tags=%s" (mapconcat (quote identity) go-guru-build-tags ","))
  eval((format "-tags=%s" (mapconcat (quote identity) go-guru-build-tags ",")) nil)
  eval-expression((format "-tags=%s" (mapconcat (quote identity) go-guru-build-tags ",")) nil)
  call-interactively(eval-expression nil nil)
  command-execute(eval-expression)

This seems to have been broken by this commit. Note that the stacktrace is only produced if go-guru-build-tags is a non-empty string, which explains why this bug was not immediately noticed.

I see a few possible solutions.

  1. Change the following line in go-guru--command from
(format "-tags=%s" (mapconcat 'identity go-guru-build-tags ","))

back to just

"-tags" go-guru-build-tags

If choosing this solution it would probably be good to expand the docstring for go-guru-build-tags to indicate that the value must be comma-separated when including multiple build tags.

  1. Change the declaration for go-guru-build-tags to a list of strings
(defcustom go-guru-build-tags '()
  "Build tags passed to guru."
  :type '(repeat string)
  :group 'go-guru)

and leave go-guru--command as it currently is. This solution seems better except that it would break anyone currently setting go-guru-build-tags as a string. Therefore, I'm not sure which one should be preferred.

/cc @alandonovan, @dominikh

@quentinmit quentinmit modified the milestone: Unreleased Sep 6, 2016
@dominikh
Copy link
Member

@nwidger Want to send a patch to https://github.com/dominikh/go-mode.el? That's the new home of the Emacs guru integration. In either case the issue should be refiled there, and this one closed.

@nwidger
Copy link
Contributor Author

nwidger commented Oct 22, 2016

Sure, I'll submit a PR to the new repo soon.

@nwidger nwidger closed this as completed Oct 22, 2016
@golang golang locked and limited conversation to collaborators Oct 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants