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: can't build go1.10 from source using go1.12 #30988

Open
matloob opened this issue Mar 21, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@matloob
Copy link
Contributor

@matloob matloob commented Mar 21, 2019

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

Go 1.12

Does this issue reproduce with the latest release?

yes

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

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/matloob/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/matloob/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
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/f4/9p58ddnj40x58zchdb36p7lr004_sl/T/go-build724269079=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

I have Go 1.12 installed on my system. I cloned the go repo and checked out the tag go1.10.8.
Then i cd'd to the go repo's src directory and ran make.bash

What did you expect to see?

a successful build

What did you see instead?

matloob-macbookpro2:src matloob$ ./make.bash
Building Go cmd/dist using /usr/local/go.
go: cannot determine module path for source directory /Users/matloob/go110 (outside GOPATH, no import comments)

But make.bash does work when GO111MODULE is unset

@josharian

This comment has been minimized.

Copy link
Contributor

@josharian josharian commented Mar 21, 2019

@ALTree ALTree changed the title can't build go1.10 from source using go1.12 cmd/go: can't build go1.10 from source using go1.12 Mar 22, 2019
@bcmills bcmills added this to the Go1.13 milestone Apr 2, 2019
@bcmills bcmills self-assigned this Apr 2, 2019
@rsc

This comment has been minimized.

Copy link
Contributor

@rsc rsc commented Apr 2, 2019

We should fix this. We want old go trees to keep building with new ones as bootstrap. cmd/dist is a single-directory main package binary.

@bcmills bcmills added the NeedsFix label Apr 9, 2019
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@bcmills

This comment has been minimized.

Copy link
Member

@bcmills bcmills commented Sep 18, 2019

I think this ties closely to #32027: we're erroring out because we do not have a module path (and therefore do not have a package path) for package in the working directory.

In theory we could proceed anyway: since the package in the current directory imports only standard-library packages, the only effects of its go.mod file would be to select the go version in use and set accurate debug information, and for most binaries those don't matter much.

@rsc rsc modified the milestones: Go1.14, Backlog Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
7 participants
You can’t perform that action at this time.