[x] bk-cmdb
(venv) zl@BJ-7080:~/software/go/src/configcenter/src$ make
building server...
enter directory: /home/zl/software/go/src/configcenter/src/apiserver
make[1]: Entering directory '/home/zl/software/go/src/configcenter/src/apiserver'
building the target: cmdb_apiserver...
go build -ldflags "-X configcenter/src/common/version.CCVersion=master -X configcenter/src/common/version.CCBuildTime=2022-04-14T17:53:48+0800 -X configcenter/src/common/version.CCGitHash=33f62cc760a0ac495a4732aa2a8f2c2ed9c76a94 -X configcenter/src/common/version.CCTag=master -X configcenter/src/common/version.CCDistro=community" -o /home/zl/software/go/src/configcenter/src/bin/build/master/cmdb_apiserver/cmdb_apiserver
../../vendor/github.com/rs/xid/id.go:45:2: found packages md5 (example_test.go) and main (gen.go) in /usr/local/go/src/crypto/md5
../../vendor/github.com/go-redis/redis/v7/cluster.go:5:2: found packages tls (alert.go) and main (generate_cert.go) in /usr/local/go/src/crypto/tls
../../vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go:13:2: found packages x509 (cert_pool.go) and main (x509_test_import.go) in /usr/local/go/src/crypto/x509
/usr/local/go/src/net/rpc/client.go:9:2: found packages gob (codec_test.go) and main (decgen.go) in /usr/local/go/src/encoding/gob
/usr/local/go/src/internal/reflectlite/swapper.go:8:2: import "internal/goarch" is a program, not an importable package
/usr/local/go/src/math/big/int.go:12:2: found packages rand (example_test.go) and main (gen_cooked.go) in /usr/local/go/src/math/rand
../../vendor/github.com/emicklei/go-restful/v3/compress.go:14:2: found packages http (alpn_test.go) and main (triv.go) in /usr/local/go/src/net/http
../thirdparty/monitor/plugins/blueking/gsecmdline.go:17:2: found packages exec (bench_test.go) and main (read3.go) in /usr/local/go/src/os/exec
/usr/local/go/src/internal/reflectlite/value.go:10:2: found packages runtime (abi_test.go) and main (mkduff.go) in /usr/local/go/src/runtime
/usr/local/go/src/internal/syscall/unix/at.go:10:2: found packages syscall (asan.go) and main (mkasm.go) in /usr/local/go/src/syscall
/usr/local/go/src/internal/poll/fd_poll_runtime.go:13:2: found packages time (embed.go) and main (genzabbrs.go) in /usr/local/go/src/time
/usr/local/go/src/net/interface_bsd.go:12:2: build constraints exclude all Go files in /usr/local/go/src/vendor/golang.org/x/net/route
make[1]: [/home/zl/software/go/src/configcenter/scripts/Makefile:57: cmdb_apiserver] Error 1
make[1]: Leaving directory '/home/zl/software/go/src/configcenter/src/apiserver'
make: [Makefile:12: default] Error 2
问题描述
根据https://github.com/Tencent/bk-cmdb/blob/master/docs/overview/source_compile.md 的编译指南,执行make时报错
重现方法
根据编译指南,执行make时报错
关键信息
make[1]: [/home/zl/software/go/src/configcenter/scripts/Makefile:57: cmdb_apiserver] Error 1 make[1]: Leaving directory '/home/zl/software/go/src/configcenter/src/apiserver' make: [Makefile:12: default] Error 2
请提供以下信息:
building server... enter directory: /home/zl/software/go/src/configcenter/src/apiserver make[1]: Entering directory '/home/zl/software/go/src/configcenter/src/apiserver'
building the target: cmdb_apiserver...
go build -ldflags "-X configcenter/src/common/version.CCVersion=master -X configcenter/src/common/version.CCBuildTime=2022-04-14T17:53:48+0800 -X configcenter/src/common/version.CCGitHash=33f62cc760a0ac495a4732aa2a8f2c2ed9c76a94 -X configcenter/src/common/version.CCTag=master -X configcenter/src/common/version.CCDistro=community" -o /home/zl/software/go/src/configcenter/src/bin/build/master/cmdb_apiserver/cmdb_apiserver ../../vendor/github.com/rs/xid/id.go:45:2: found packages md5 (example_test.go) and main (gen.go) in /usr/local/go/src/crypto/md5 ../../vendor/github.com/go-redis/redis/v7/cluster.go:5:2: found packages tls (alert.go) and main (generate_cert.go) in /usr/local/go/src/crypto/tls ../../vendor/go.mongodb.org/mongo-driver/mongo/options/clientoptions.go:13:2: found packages x509 (cert_pool.go) and main (x509_test_import.go) in /usr/local/go/src/crypto/x509 /usr/local/go/src/net/rpc/client.go:9:2: found packages gob (codec_test.go) and main (decgen.go) in /usr/local/go/src/encoding/gob /usr/local/go/src/internal/reflectlite/swapper.go:8:2: import "internal/goarch" is a program, not an importable package /usr/local/go/src/math/big/int.go:12:2: found packages rand (example_test.go) and main (gen_cooked.go) in /usr/local/go/src/math/rand ../../vendor/github.com/emicklei/go-restful/v3/compress.go:14:2: found packages http (alpn_test.go) and main (triv.go) in /usr/local/go/src/net/http ../thirdparty/monitor/plugins/blueking/gsecmdline.go:17:2: found packages exec (bench_test.go) and main (read3.go) in /usr/local/go/src/os/exec /usr/local/go/src/internal/reflectlite/value.go:10:2: found packages runtime (abi_test.go) and main (mkduff.go) in /usr/local/go/src/runtime /usr/local/go/src/internal/syscall/unix/at.go:10:2: found packages syscall (asan.go) and main (mkasm.go) in /usr/local/go/src/syscall /usr/local/go/src/internal/poll/fd_poll_runtime.go:13:2: found packages time (embed.go) and main (genzabbrs.go) in /usr/local/go/src/time /usr/local/go/src/net/interface_bsd.go:12:2: build constraints exclude all Go files in /usr/local/go/src/vendor/golang.org/x/net/route make[1]: [/home/zl/software/go/src/configcenter/scripts/Makefile:57: cmdb_apiserver] Error 1 make[1]: Leaving directory '/home/zl/software/go/src/configcenter/src/apiserver' make: [Makefile:12: default] Error 2