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/unix: compiler gives error code 1 on go version < 1.12 breaking higher level build systems #30670

Closed
ghost opened this issue Mar 8, 2019 · 2 comments

Comments

@ghost
Copy link

ghost commented Mar 8, 2019

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

$ go version
go version go1.11 darwin/amd64

Does this issue reproduce with the latest release?

No

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

go env Output
$ go env
GOARCH="amd64"
GOBIN="/Users/evan.zeller/go/bin"
GOCACHE="/Users/evan.zeller/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/evan.zeller/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/4l/fg606zhd2b51yn6bdrg0pd4m0000gq/T/go-build195799974=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Built my project with a custom make target that executes go build. The full go build command is:

@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s" -a -installsuffix cgo -i -v -o ${OUT_DIR}/${OUT_FILE} ${PKG}/cmd/...
$ make build
errors
internal/race
unicode/utf8
math/bits
runtime/internal/sys
runtime/internal/atomic
sync/atomic
internal/cpu
encoding
unicode
unicode/utf16
golang_org/x/net/dns/dnsmessage
internal/nettrace
container/list
crypto/internal/subtle
internal/testlog
internal/bytealg
crypto/subtle
math
golang_org/x/crypto/cryptobyte/asn1
google.golang.org/grpc/resolver
golang_org/x/crypto/curve25519
google.golang.org/grpc/resolver/passthrough
runtime
strconv
crypto/rc4
sync
internal/singleflight
google.golang.org/grpc/internal/grpcsync
io
math/rand
reflect
syscall
hash
crypto/internal/randutil
bytes
text/tabwriter
strings
crypto/cipher
crypto
hash/crc32
crypto/hmac
crypto/sha512
crypto/md5
crypto/sha1
crypto/aes
crypto/sha256
bufio
html
golang_org/x/text/transform
path
google.golang.org/grpc/encoding
golang.org/x/text/transform
internal/syscall/unix
time
google.golang.org/grpc/internal/grpcrand
google.golang.org/grpc/keepalive
internal/poll
google.golang.org/grpc/internal/backoff
encoding/binary
sort
os
regexp/syntax
golang_org/x/crypto/poly1305
golang_org/x/crypto/internal/chacha20
encoding/base64
crypto/des
encoding/pem
golang_org/x/crypto/chacha20poly1305
google.golang.org/grpc/internal/envconfig
path/filepath
fmt
io/ioutil
regexp
github.com/grpc-ecosystem/grpc-gateway/utilities
log
context
net/url
flag
text/template/parse
compress/flate
encoding/json
encoding/hex
golang.org/x/net/internal/timeseries
golang.org/x/net/context
math/big
golang_org/x/text/unicode/bidi
compress/gzip
golang_org/x/text/unicode/norm
golang_org/x/net/http2/hpack
net
mime
mime/quotedprintable
net/http/internal
text/template
google.golang.org/grpc/grpclog
google.golang.org/grpc/internal
google.golang.org/grpc/metadata
google.golang.org/grpc/connectivity
google.golang.org/grpc/codes
golang.org/x/text/unicode/bidi
golang_org/x/text/secure/bidirule
golang.org/x/text/unicode/norm
golang.org/x/net/http2/hpack
github.com/golang/protobuf/proto
google.golang.org/grpc/tap
go/token
golang.org/x/text/secure/bidirule
os/exec
go/scanner
github.com/golang/protobuf/protoc-gen-go/generator/internal/remap
go/ast
html/template
golang.org/x/net/idna
golang_org/x/net/idna
crypto/rand
crypto/elliptic
encoding/asn1
crypto/rsa
crypto/dsa
crypto/ecdsa
crypto/x509/pkix
golang_org/x/crypto/cryptobyte
go/parser
go/doc
go/printer
go/build
google.golang.org/grpc/credentials/internal
golang_org/x/net/http/httpproxy
google.golang.org/grpc/stats
net/textproto
crypto/x509
golang.org/x/sys/unix
go build golang.org/x/sys/unix: module requires Go 1.12
google.golang.org/grpc/naming
google.golang.org/grpc/resolver/dns
golang_org/x/net/http/httpguts
mime/multipart
golang.org/x/net/http/httpguts
github.com/golang/protobuf/ptypes/empty
google.golang.org/grpc/encoding/proto
github.com/golang/protobuf/ptypes/duration
github.com/golang/protobuf/ptypes/timestamp
github.com/golang/protobuf/ptypes/any
github.com/golang/protobuf/ptypes/struct
github.com/golang/protobuf/protoc-gen-go/descriptor
github.com/golang/protobuf/ptypes/wrappers
crypto/tls
google.golang.org/genproto/protobuf/field_mask
google.golang.org/genproto/googleapis/rpc/status
github.com/golang/protobuf/jsonpb
google.golang.org/grpc/binarylog/grpc_binarylog_v1
github.com/golang/protobuf/ptypes
github.com/grpc-ecosystem/grpc-gateway/internal
google.golang.org/grpc/status
github.com/golang/protobuf/protoc-gen-go/plugin
google.golang.org/genproto/googleapis/api/annotations
google.golang.org/grpc/internal/binarylog
github.com/golang/protobuf/protoc-gen-go/generator
net/http/httptrace
google.golang.org/grpc/credentials
google.golang.org/grpc/peer
google.golang.org/grpc/balancer
net/http
google.golang.org/grpc/balancer/base
google.golang.org/grpc/balancer/roundrobin
net/http/httputil
golang.org/x/net/trace
github.com/grpc-ecosystem/grpc-gateway/runtime
golang.org/x/net/http2
make: *** [build] Error 1
  

Note the outputs:

go build golang.org/x/sys/unix: module requires Go 1.12

and

make: *** [build] Error 1

What did you expect to see?

No errors, successful build.

What did you see instead?

Error code 1 returned by the compiler.

This is due to the commit merged yesterday: https://go-review.googlesource.com/c/sys/+/165751

While it is true the compilation does not actually fail, the compiler still outputs an error code of 1 breaking any higher level build systems (make, jenkins, etc).

@gopherbot gopherbot added this to the Unreleased milestone Mar 8, 2019
@ghost ghost changed the title x/sys/unix: compiler gives error code 1 on go version < 1.12 x/sys/unix: compiler gives error code 1 on go version < 1.12 breaking higher level build systems Mar 8, 2019
@bcmills
Copy link
Contributor

bcmills commented Mar 8, 2019

Upgrade from go1.11 to go1.11.5. (You should do that anyway: it's a security release.)

@ghost
Copy link
Author

ghost commented Mar 8, 2019

@bcmills Thanks, that works.

@ghost ghost closed this as completed Mar 8, 2019
@golang golang locked and limited conversation to collaborators Mar 7, 2020
This issue was closed.
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

2 participants