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/sys: CPUSet addition breaks Go 1.8 compatibility by requiring math/bits #23353

Closed
marklshep opened this issue Jan 5, 2018 · 4 comments
Closed
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@marklshep
Copy link

marklshep commented Jan 5, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.8.3 linux/amd64

Does this issue reproduce with the latest release?

It should not.

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

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go:/switchboard/utils/golang/:/switchboard/services/golang/"
GORACE=""
GOROOT="/opt/ecr/external/go"
GOTOOLDIR="/opt/ecr/external/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build826031598=/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?

Attempted to build a go program that uses affinity_linux.go.

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

This should be reproducible with any program that will cause affinity_linux.go to build while running go1.8.3 on a unix machine.

What did you expect to see?

I expected the program to build.

What did you see instead?

root@ubuntu:/myGoProject# bash /my/path/module-build.sh
package math/bits: unrecognized import path "math/bits" (import path does not begin with hostname)

I believe that Go enforces backwards compatibility strictly, so the import should either not exist or be protected against older versions. I may be mistaken as I recently started using Go.

Sorry for not following any formatting rules y'all have. I was rushing to get it out to save other folks some time.

@marklshep marklshep changed the title Commit 12d9d5b2 appears to break backward compatibility, breaks if not using v1.9 Commit 12d9d5b2 appears to break backward compatibility by importing math/bits Jan 5, 2018
@marklshep marklshep changed the title Commit 12d9d5b2 appears to break backward compatibility by importing math/bits Commit 12d9d5b2 in golang/sys/ appears to break backward compatibility by importing math/bits Jan 5, 2018
@bradfitz bradfitz changed the title Commit 12d9d5b2 in golang/sys/ appears to break backward compatibility by importing math/bits x/sys: CPUSet addition breaks Go 1.8 compatibility by requiring math/bits Jan 5, 2018
@gopherbot gopherbot added this to the Unreleased milestone Jan 5, 2018
@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Jan 5, 2018
@bradfitz
Copy link
Contributor

bradfitz commented Jan 5, 2018

Yes, we still need to support Go 1.8 for another few weeks.

@tklauser, can you hide that file behind +build go1.9?

@bradfitz
Copy link
Contributor

bradfitz commented Jan 5, 2018

or copy the portable OneCount64 into that file behind a build tag. either way.

@bradfitz bradfitz self-assigned this Jan 6, 2018
@gopherbot
Copy link

Change https://golang.org/cl/86477 mentions this issue: unix: fix build on Go 1.8

@gopherbot
Copy link

Change https://golang.org/cl/96275 mentions this issue: unix: use bits.OnesCount64 instead of local copy

@golang golang locked and limited conversation to collaborators Feb 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants