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: move-to strictly respects build tags #30097

Open
elagergren-spideroak opened this Issue Feb 5, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@elagergren-spideroak
Copy link

elagergren-spideroak commented Feb 5, 2019

What version of Go are you using (go version)?

$ go version
go version go1.11.5 darwin/amd64

Does this issue reproduce with the latest release?

Yeah.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN="/Users/elagergren/gopath/bin"
GOCACHE="/Users/elagergren/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/elagergren/gopath"
GOPROXY=""
GORACE="history_size=7"
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="/Users/elagergren/gopath/src/treehouse.spideroak.com/flow/openssl/lib/darwin/fips2.0/bin/fipsld_clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/2b/74fz3jhd4wz4vnbf4z7ywzww0000gp/T/go-build009059339=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ tree
.
├── package.go
├── package_windows.go (imports windows1)
└── windows1
    ├── windows2
    │   └── windows2.go
    └── windows1.go (imports windows2)

gomvpkg -from repo/package -to repo/elsewhere/package -vcs_mv_cmd 'git mv {{ .Src }} {{ .Dst }}

What did you expect to see?

Files that would otherwise be excluded from compilation via build tags have their imports changed.

What did you see instead?

They didn't.


To be specific: on macOS I moved a package containing package_windows.go. That file imported a sub-package. While the macOS/Unix/etc. code (e.g., package.go) had its imports updated, the code in package_windows.go did not.

I assume the XXX_windows.go files were excluded because of build constraints.

@gopherbot gopherbot added this to the Unreleased milestone Feb 5, 2019

@andybons andybons changed the title x/tools/refactor/rename: Move too strictly respects build tags x/tools/refactor/rename: move-to strictly respects build tags Feb 6, 2019

@elagergren-spideroak

This comment has been minimized.

Copy link
Author

elagergren-spideroak commented Feb 6, 2019

Seems to be related to or a dupe of #27145.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.