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
Open

cmd/go: can't build go1.10 from source using go1.12 #30988

matloob opened this issue Mar 21, 2019 · 3 comments
Labels
modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@matloob
Copy link
Contributor

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
Copy link
Contributor

@bcmills

@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
@ALTree ALTree added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Mar 22, 2019
@bcmills bcmills added this to the Go1.13 milestone Apr 2, 2019
@bcmills bcmills self-assigned this Apr 2, 2019
@rsc
Copy link
Contributor

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 The path to resolution is known, but the work has not been done. label Apr 9, 2019
@gopherbot gopherbot removed the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Apr 9, 2019
@andybons andybons modified the milestones: Go1.13, Go1.14 Jul 8, 2019
@bcmills
Copy link
Member

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
@rsc rsc unassigned bcmills Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

7 participants