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

undefined: sysSparseDetect when building go 1.10 from source #24017

Closed
andrewrk opened this issue Feb 21, 2018 · 6 comments
Closed

undefined: sysSparseDetect when building go 1.10 from source #24017

andrewrk opened this issue Feb 21, 2018 · 6 comments

Comments

@andrewrk
Copy link

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8.5 linux/amd64

Does this issue reproduce with the latest release?

This issue is blocking me from obtaining the latest release.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/andy/go"
GORACE=""
GOROOT="/nix/store/0f5zavv4w9d8b70b06h7mpxbf4k46pzh-go-1.8.5/share/go"
GOTOOLDIR="/nix/store/0f5zavv4w9d8b70b06h7mpxbf4k46pzh-go-1.8.5/share/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build736175068=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

What did you do?

andy@xps ~/Downloads> wget https://dl.google.com/go/go1.10.src.tar.gz
andy@xps ~/Downloads> tar xvf go1.10.src.tar.gz 
andy@xps ~/Downloads> mv go go1.10
andy@xps ~/Downloads> cd go1.10.src/src/
andy@xps ~/D/g/src> bash all.bash 
Building Go cmd/dist using /nix/store/0f5zavv4w9d8b70b06h7mpxbf4k46pzh-go-1.8.5/share/go.
Building Go toolchain1 using /nix/store/0f5zavv4w9d8b70b06h7mpxbf4k46pzh-go-1.8.5/share/go.
Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.
Building Go toolchain2 using go_bootstrap and Go toolchain1.
Building Go toolchain3 using go_bootstrap and Go toolchain2.
Building packages and commands for linux/amd64.
# archive/tar
src/archive/tar/sparse_unix.go:17:2: undefined: sysSparseDetect
src/archive/tar/sparse_unix.go:57:22: undefined: SparseEntry
go tool dist: FAILED: /home/andy/Downloads/go1.10.src/pkg/tool/linux_amd64/go_bootstrap install -gcflags=all= -ldflags=all= std cmd: exit status 2

What did you expect to see?

I expected the build to succeed and produce go 1.10 binary.

What did you see instead?

The above error message

@bradfitz
Copy link
Contributor

You cd'ed into the wrong directory it looks like. There is no sparse_unix.go in Go 1.10. You seem to be in an old dev tree.

@dsnet
Copy link
Member

dsnet commented Feb 21, 2018

Did you have a stale checkout of the go source tree prior to extracting the tar.gz. file? The presence of the sparse_unix.go file is indicative of a checkout of the tree from several months ago.

@bradfitz
Copy link
Contributor

Or rather, nuke your go directory before you tar xvf

@andrewrk
Copy link
Author

looks like last time I downloaded a go distribution, I did not have the wisdom to mv go/ go-1.10/ like I did this time.

I'd recommend doing that in releases from now on, putting the version in the folder name inside the .tar.gz. it's pretty standard practice.

@mobilewebguru
Copy link

I've got this error on MacOS.
$ go version
go version go1.10.3 darwin/amd64
$ vgo
go requires Go 1.10 but VGOROOT=/Users/kdev/go is not a Go 1.10 source tree

@bradfitz
Copy link
Contributor

@iosandroidwebtopdev, that seems unrelated to this bug.
For questions about Go, see https://golang.org/wiki/Questions.

@golang golang locked and limited conversation to collaborators Jul 19, 2019
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

5 participants