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

cmd/go: clean on module uses directory name #26991

Open
DeedleFake opened this issue Aug 14, 2018 · 3 comments
Open

cmd/go: clean on module uses directory name #26991

DeedleFake opened this issue Aug 14, 2018 · 3 comments
Labels
modules NeedsFix
Milestone

Comments

@DeedleFake
Copy link

@DeedleFake DeedleFake commented Aug 14, 2018

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

go version go1.11rc1 darwin/amd64

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

GOARCH="amd64"
GOBIN=""
GOCACHE="$HOME/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="$HOME/go"
GOPROXY=""
GORACE=""
GOROOT="$HOME/sdk/go1.11rc1"
GOTMPDIR=""
GOTOOLDIR="/Users/moquality/sdk/go1.11rc1/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/var/folders/6b/nk1h2bp93yn4_c35zvn2845c0000gq/T/tmp.kodrU4ryxD/node/go.mod"
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/6b/nk1h2bp93yn4_c35zvn2845c0000gq/T/go-build046724770=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

mkdir example
cd example
go mod init modname
echo 'package main; func main() {println("This is an example.")}' > example.go
go build -v # This produces a file called 'modname'.
go clean -x # This attempts to delete a file called 'example'.

What did you expect to see?

go clean should use the module name to delete rather than the directory name.

What did you see instead?

go clean attempted to use the directory name to delete the previously created executable.

@andybons andybons added NeedsInvestigation modules labels Aug 15, 2018
@andybons andybons added this to the Unplanned milestone Aug 15, 2018
@andybons
Copy link
Member

@andybons andybons commented Aug 15, 2018

@rsc @bcmills @ianlancetaylor

@rsc rsc removed this from the Unplanned milestone Aug 18, 2018
@rsc rsc added this to the Go1.12 milestone Aug 18, 2018
@bcmills bcmills added the NeedsFix label Sep 13, 2018
@gopherbot gopherbot removed the NeedsInvestigation label Sep 13, 2018
@bcmills
Copy link
Member

@bcmills bcmills commented Sep 13, 2018

Likely the same root cause as #27283.

@rsc
Copy link
Contributor

@rsc rsc commented Oct 25, 2018

Possibly same root cause but possibly not. In any event I agree it should use the final (non-version) element of the module path.

@andybons andybons removed this from the Go1.12 milestone Feb 12, 2019
@andybons andybons added this to the Go1.13 milestone Feb 12, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@andybons andybons added this to the Go1.14 milestone Jul 8, 2019
@rsc rsc removed this from the Go1.14 milestone Oct 9, 2019
@rsc rsc added this to the Backlog milestone Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsFix
Projects
None yet
Development

No branches or pull requests

5 participants