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/refactor/rename: emacs package broken #17468

Closed
xoba opened this issue Oct 16, 2016 · 2 comments
Closed

x/tools/refactor/rename: emacs package broken #17468

xoba opened this issue Oct 16, 2016 · 2 comments

Comments

@xoba
Copy link
Contributor

xoba commented Oct 16, 2016

Please answer these questions before submitting your issue. Thanks!

What did you do?

built and installed go-rename and its emacs mode following
https://github.com/golang/tools/blob/master/refactor/rename/go-rename.el as i have usually done these last several months.

What did you expect to see?

after running go-rename within emacs mode like i've usually done, successfully renaming something in the source code.

What did you see instead?

no renaming occurred, and the following error message in emacs debug window, which is new:

Command: (gorename nil t nil -offset=/home/[elided]/src/[elided].go:#120 -to Runx):
Running gorename...
let: Symbol's function definition is void: list*

([elided] in the above means i simply removed some irrelevant private information)

Does this issue reproduce with the latest release (go1.7.1)?

n/a

System details

go version devel +4d89877 Sun Oct 16 10:31:36 2016 +0000 linux/amd64
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
TERM="dumb"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build531906202=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
uname -sr: Linux 3.13.0-37-generic
Distributor ID: LinuxMint
Description:    Linux Mint 17.1 Rebecca
Release:    17.1
Codename:   rebecca
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu EGLIBC 2.19-0ubuntu6.9) stable release version 2.19, by Roland McGrath et al.
gdb --version: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
@quentinmit quentinmit changed the title go-rename seems broken these last few days tools/refactor/rename: emacs package broken Oct 17, 2016
@quentinmit quentinmit changed the title tools/refactor/rename: emacs package broken x/tools/refactor/rename: emacs package broken Oct 17, 2016
@quentinmit quentinmit added this to the Unreleased milestone Oct 17, 2016
@xoba
Copy link
Contributor Author

xoba commented Oct 19, 2016

here's a script you can run to set up the problem reproducibly with a stock go 1.7.1:

#!/bin/bash
#
# script to test go-rename all by itself from scratch
#
# i ran it on the standard "Amazon Linux AMI 2016.09.0 (HVM), SSD Volume Type - ami-c481fad3", but should work similarly on any linux box
#
cd
yum -y install tmux emacs git hg libtool gcc patch glibc-static
wget https://storage.googleapis.com/golang/go1.7.1.linux-amd64.tar.gz
tar xf go1.7.1.linux-amd64.tar.gz
export GOROOT=`pwd`/go
export GOPATH=`pwd`
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
go get golang.org/x/tools/cmd/gorename
git clone https://github.com/dominikh/go-mode.el.git
mkdir go/misc/emacs
find . -type f -name "*.el" -exec cp \{} ~/go/misc/emacs \;
cat > ~/.emacs <<EOF
(add-to-list 'load-path "~/go/misc/emacs/" t)
(require 'go-rename)
EOF
cat > ~/test.go <<EOF
package main

import "fmt"

func main() {
        var x string
        x = "abc"
        fmt.Println(x)
}
EOF

after running this script (above), edit test.go via emacs test.go, and try to go-rename the var x by placing cursor on x and invoking go-rename the usual way... you will get the error Symbol's function definition is void: list*

@gopherbot
Copy link

CL https://golang.org/cl/31471 mentions this issue.

dominikh added a commit to dominikh/go-mode.el that referenced this issue Oct 19, 2016
go-rename.el used the cl list* macro without requiring cl. This only
worked for people who required it for other code. go-guru.el, before its
removal from the tree, changed from cl to cl-lib, indirectly breaking
go-rename.el for some users.

Switch to using cl-list* and require cl-lib.

Fixes golang/go#17468

Change-Id: I70f2052b9fd3d1a8671794d9a3954be218026af2
Reviewed-on: https://go-review.googlesource.com/31471
Reviewed-by: Alan Donovan <adonovan@google.com>
@golang golang locked and limited conversation to collaborators Oct 19, 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

3 participants