-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted
Milestone
Description
What version of Go are you using (go version
)?
$ go version go version go1.17beta1 linux/amd64
(Same in 1.16.)
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 GO111MODULE="on" GOARCH="amd64" GOBIN="" GOCACHE="/home/ainar/.cache/go-build" GOENV="/home/ainar/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOINSECURE="" GOMODCACHE="/home/ainar/go/pkg/mod" GONOPROXY="[removed]" GONOSUMDB="[removed]" GOOS="linux" GOPATH="/home/ainar/go" GOPRIVATE="[removed]" GOPROXY="https://proxy.golang.org,direct" GOROOT="/home/ainar/go/go1.17" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/home/ainar/go/go1.17/pkg/tool/linux_amd64" GOVCS="" GOVERSION="go1.17beta1" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="[removed]" 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=/tmp/go-build3876884678=/tmp/go-build -gno-record-gcc-switches"
What did you do?
go build -p=0
What did you expect to see?
Either a build with the default value of p
, as if -p=0
weren't there, or an error message and a non-zero exit code.
What did you see instead?
Binary isn't built, there are no error messages, the exit code is zero.
See the following code:
go/src/cmd/go/internal/work/exec.go
Lines 179 to 183 in dc00dc6
par := cfg.BuildP | |
if cfg.BuildN { | |
par = 1 | |
} | |
for i := 0; i < par; i++ { |
Perhaps there should be either some validation there or something like:
par := cfg.BuildP
if par <= 0 {
par = runtime.GOMAXPROCS(0)
}
EugeneOne1
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeGoCommandcmd/gocmd/goNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.help wanted