Bazel: Bazel build failure on @org_golang_x_sys//unix

Created on 6 Jun 2017  路  5Comments  路  Source: bazelbuild/bazel

Description of the problem / feature request / question:

When running a bazel build on this workspace it fails with the following error:

+ bazel build //...
INFO: Found 41 targets...
ERROR: /private/var/tmp/_bazel_liam/9586a0d1a7804298899944d9204a8df3/external/org_golang_x_sys/unix/BUILD.bazel:3:1: error executing shell command: 'bazel-out/local-fastbuild/bin/external/org_golang_x_sys/unix/bazel-out/local-fastbuild/genfiles/external/org_golang_x_sys/unix/cgo_default_library.cgo.dir.CGoCodeGenFile.params' failed: bash failed: error executing command
  (exec env - \
    CGO_LDFLAGS='' \
    GOARCH=amd64 \
    GOOS=darwin \
    GOROOT=/private/var/tmp/_bazel_liam/9586a0d1a7804298899944d9204a8df3/external/go1.8.3.darwin-amd64 \
  /bin/bash -c bazel-out/local-fastbuild/bin/external/org_golang_x_sys/unix/bazel-out/local-fastbuild/genfiles/external/org_golang_x_sys/unix/cgo_default_library.cgo.dir.CGoCodeGenFile.params)

no buildable Go source files in @org_golang_x_sys//unix:cgo_default_library.cgo
INFO: Elapsed time: 1.674s, Critical Path: 1.25s

It seems to have been cause by upgrading to the latest commit of io_bazel_rules_go.

If possible, provide a minimal example to reproduce the problem:

Run a bazel build //... in repo root

Environment info

  • Operating System: OSX (locally) also failing on Ubuntu (Pipeline)

  • Bazel version (output of bazel info release): 0.4.5-homebrew

All 5 comments

Unfortunately, this is a known issue. See bazelbuild/rules_go#399. The fix is pretty complicated, but it's nearly finished, and we hope to have this resolved soon. See also bazelbuild/rules_go#409 and bazelbuild/rules_go#510, which are blocking issues.

@jayconrod any estimates on an ETA? Any ideas on which commit introduced this issue? Maybe I can use the commit prior to it to solve my gazelle perf issues and this issue.

@liamawhite The most recent commit I could find where we could build golang.org/x/sys/unix was 84382d5163b44286680176fb1fdf00e4afdb2b88 (April 17). Be advised that BUILD files generated with this version are platform-specific.

For ETA, I'm hoping to close bazelbuild/rules_go#510 and bazelbuild/rules_go#409 this week. I don't know of any other issues preventing golang.org/x/sys/unix from building, but if anything does come up, it will be a high priority.

This should be reopened on bazelbuild/rules_go and closed here, I think.

@jayconrod just picked up the latest commit. All working, thanks!

Was this page helpful?
0 / 5 - 0 ratings