douba4933 2018-01-30 09:01
浏览 2193
已采纳

golang.org/x/sys/unix缺少功能主体的问题

bitbucket-pipelines.yml:

image: golang:1.9

pipelines:
  default:
    - step:
        script: # Modify the commands below to build your repository.
          - PACKAGE_PATH="${GOPATH}/src/bitbucket.org/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}"
          - mkdir -pv "${PACKAGE_PATH}"
          - tar -cO --exclude-vcs --exclude=bitbucket-pipelines.yml . | tar -xv -C "${PACKAGE_PATH}"
          - cd "${PACKAGE_PATH}"
          - go version
          - uname -a
          - make build_linux
          - go test -v ./...`enter code here`

I try to build Golang app on Bitbucket CI but got the error with golang.org/x/sys/unix:

make build_linux
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build --tags "json1" -ldflags "-s -X main.version=0.63" -a -installsuffix cgo -o dbcore_linux ./cmd/dbcore/dbcore.go
# bitbucket.org/xxx/dbcore/vendor/golang.org/x/sys/unix
vendor/golang.org/x/sys/unix/syscall_linux.go:20:6: missing function body
vendor/golang.org/x/sys/unix/syscall_linux.go:24:6: missing function body
vendor/golang.org/x/sys/unix/syscall_linux_amd64_gc.go:13:6: missing function body
vendor/golang.org/x/sys/unix/syscall_unix_gc.go:12:6: missing function body
vendor/golang.org/x/sys/unix/syscall_unix_gc.go:13:6: missing function body
vendor/golang.org/x/sys/unix/syscall_unix_gc.go:14:6: missing function body
vendor/golang.org/x/sys/unix/syscall_unix_gc.go:15:6: missing function body
make: *** [build_linux] Error 2
Makefile:7: recipe for target 'build_linux' failed

Dockerfile: https://github.com/docker-library/golang/blob/2f2f3b620d61f533484f24a568c2ca46e4fda91c/1.9/stretch/Dockerfile

I haven't issue on the local machine with MacOS. Only CI. How could I resolve that issue?

Thanks!

  • 写回答

1条回答 默认 最新

  • donglong1465 2018-01-30 15:18
    关注

    Golang dep command copy many files to the vendor folder which I wanted to skip with .gitignore rules, so .s files had been also skipped for vendor/golang.org/x/sys/ dep.

    Issue disappear after I exclude *.s files from .gitignore.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 在若依框架下实现人脸识别
  • ¥15 网络科学导论,网络控制
  • ¥100 安卓tv程序连接SQLSERVER2008问题
  • ¥15 利用Sentinel-2和Landsat8做一个水库的长时序NDVI的对比,为什么Snetinel-2计算的结果最小值特别小,而Lansat8就很平均
  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同