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

building failed #9048

Closed
willkk opened this issue Dec 20, 2017 · 7 comments
Closed

building failed #9048

willkk opened this issue Dec 20, 2017 · 7 comments

Comments

@willkk
Copy link

willkk commented Dec 20, 2017

go version:1.9.2
etcd version: latest master

steps:
1.git clone https://github.com/coreos/etcd.git
2.cd etcd
3. ./build
outputs:
# runtime/internal/sys
flag provided but not defined: -goversion
usage: compile [options] file.go...
-% debug non-static initializers
-+ compiling runtime
-B disable bounds checking
-D path
set relative path for local imports
-E debug symbol export
-I directory
add directory to import search path
-K debug missing line numbers
-N disable optimizations
-S print assembly listing
-V print compiler version
-W debug parse tree after type checking
-asmhdr file
write assembly header to file
-bench file
append benchmark times to file
-buildid id
record id as the build id in the export metadata
-complete
compiling complete package (no C or assembly)
-cpuprofile file
write cpu profile to file
-d list
print debug information about items in list
-dynlink
support references to Go symbols defined in other shared libraries
-e no limit on number of errors reported
-f debug stack frames
-h halt on error
-i debug line number stack
-importmap definition
add definition of the form source=actual to import map
-installsuffix suffix
set pkg directory suffix
-j debug runtime-initialized variables
-l disable inlining
-largemodel
generate code that assumes a large memory model
-linkobj file
write linker-specific object to file
-live
debug liveness analysis
-m print optimization decisions
-memprofile file
write memory profile to file
-memprofilerate rate
set runtime.MemProfileRate to rate
-msan
build code compatible with C/C++ memory sanitizer
-nolocalimports
reject local (relative) imports
-o file
write output to file
-p path
set expected package import path
-pack
write package file instead of object file
-r debug generated wrappers
-race
enable race detector
-s warn about composite literals that can be simplified
-shared
generate code that can be linked into a shared library
-traceprofile file
write an execution trace to file
-trimpath prefix
remove prefix from recorded source file paths
-u reject unsafe code
-v increase debug verbosity
-w debug type checking
-wb
enable write barrier (default true)

@gyuho
Copy link
Contributor

gyuho commented Dec 20, 2017

What's your output of go env?

@willkk
Copy link
Author

willkk commented Dec 20, 2017

# go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/root1/file_manager"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build293291111=/tmp/go-build"
CXX="g++"
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"

@gyuho
Copy link
Contributor

gyuho commented Dec 20, 2017

flag provided but not defined: -goversion

etcd is not passing -goversion... Did you modify build script?

go install -v ./cmd/etcd

in the repository root.

Builds on linux are working fine.

@gyuho gyuho closed this as completed Dec 20, 2017
@willkk
Copy link
Author

willkk commented Dec 20, 2017

No. I haven't. All etcd files are cloned from github.

@gyuho
Copy link
Contributor

gyuho commented Dec 20, 2017

@willkk Can you provide the output of

env
uname -a

@willkk
Copy link
Author

willkk commented Dec 20, 2017

[root@wxtest021vm07 etcd]# env
HOSTNAME=wxtest021vm07
SELINUX_ROLE_REQUESTED=
TERM=xterm-256color
SHELL=/bin/bash
HISTSIZE=1000
SSH_CLIENT=192.168.120.227 61468 22
SELINUX_USE_CURRENT_RANGE=
OLDPWD=/home/root1
SSH_TTY=/dev/pts/2
USER=root
LS_COLORS=rs=0:di=38;5;27:ln=38;5;51:mh=44;38;5;15:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=05;48;5;232;38;5;15:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;34:.tar=38;5;9:.tgz=38;5;9:.arj=38;5;9:.taz=38;5;9:.lzh=38;5;9:.lzma=38;5;9:.tlz=38;5;9:.txz=38;5;9:.zip=38;5;9:.z=38;5;9:.Z=38;5;9:.dz=38;5;9:.gz=38;5;9:.lz=38;5;9:.xz=38;5;9:.bz2=38;5;9:.tbz=38;5;9:.tbz2=38;5;9:.bz=38;5;9:.tz=38;5;9:.deb=38;5;9:.rpm=38;5;9:.jar=38;5;9:.rar=38;5;9:.ace=38;5;9:.zoo=38;5;9:.cpio=38;5;9:.7z=38;5;9:.rz=38;5;9:.jpg=38;5;13:.jpeg=38;5;13:.gif=38;5;13:.bmp=38;5;13:.pbm=38;5;13:.pgm=38;5;13:.ppm=38;5;13:.tga=38;5;13:.xbm=38;5;13:.xpm=38;5;13:.tif=38;5;13:.tiff=38;5;13:.png=38;5;13:.svg=38;5;13:.svgz=38;5;13:.mng=38;5;13:.pcx=38;5;13:.mov=38;5;13:.mpg=38;5;13:.mpeg=38;5;13:.m2v=38;5;13:.mkv=38;5;13:.ogm=38;5;13:.mp4=38;5;13:.m4v=38;5;13:.mp4v=38;5;13:.vob=38;5;13:.qt=38;5;13:.nuv=38;5;13:.wmv=38;5;13:.asf=38;5;13:.rm=38;5;13:.rmvb=38;5;13:.flc=38;5;13:.avi=38;5;13:.fli=38;5;13:.flv=38;5;13:.gl=38;5;13:.dl=38;5;13:.xcf=38;5;13:.xwd=38;5;13:.yuv=38;5;13:.cgm=38;5;13:.emf=38;5;13:.axv=38;5;13:.anx=38;5;13:.ogv=38;5;13:.ogx=38;5;13:.aac=38;5;45:.au=38;5;45:.flac=38;5;45:.mid=38;5;45:.midi=38;5;45:.mka=38;5;45:.mp3=38;5;45:.mpc=38;5;45:.ogg=38;5;45:.ra=38;5;45:.wav=38;5;45:.axa=38;5;45:.oga=38;5;45:.spx=38;5;45:.xspf=38;5;45:
MAIL=/var/spool/mail/root
PATH=/home/root1/go/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
GOAPTH=
PWD=/home/root1/etcd
LANG=zh_CN.UTF-8
TZ=Asia/Shanghai
SELINUX_LEVEL_REQUESTED=
HISTCONTROL=ignoredups
SHLVL=1
HOME=/home/root1
GOROOT=/usr/local/go
LOGNAME=root
CVS_RSH=ssh
SSH_CONNECTION=192.168.120.227 61468 192.168.126.36 22
GOPATH=/home/root1/file_manager
LESSOPEN=|/usr/bin/lesspipe.sh %s
G_BROKEN_FILENAMES=1
_=/bin/env

[root@wxtest021vm07 etcd]# uname -a
Linux wxtest021vm07 2.6.32-431.el6.x86_64 #1 SMP Fri Nov 22 03:15:09 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

@willkk
Copy link
Author

willkk commented Dec 20, 2017

I get it. It's GOROOT causing the error. My go1.9.2 is in another directory. Building is ok after re-setting GOROOT to go1.9.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants