Error: Build and run tests for Syntaxnet fail on Mac OS
Couldn't start the build. Unable to run tests.
ERROR: /private/var/tmp/bazel/67774bec931188b8c444c9885d9c15ed/external/org_tensorflow/tensorflow/workspace.bzl:3:6: file '@io_bazel_rules_closure//closure:defs.bzl' does not contain symbol 'filegroup_external'. ERROR: /private/var/tmp/bazel/67774bec931188b8c444c9885d9c15ed/external/org_tensorflow/tensorflow/workspace.bzl:4:6: file '@io_bazel_rules_closure//closure:defs.bzl' does not contain symbol 'webfiles_external'. ERROR: com.google.devtools.build.lib.packages.BuildFileContainsErrorsException: error loading package '': Extension file 'tensorflow/workspace.bzl' has errors.
If possible, provide a minimal example to reproduce the problem:
bazel test --linkopt=-headerpad_max_install_names syntaxnet/... util/utf8/...
Operating System: Mac OS El Capitan ver 10.11.6
Bazel version (output of bazel info release): release 0.4.4-homebrew
Anything else, information or logs or outputs that would be helpful?
file: WORKSPACE
http_archive( name = "io_bazel_rules_closure", strip_prefix = "rules_closure-0.4.1", sha256 = "ba5e2e10cdc4027702f96e9bdc536c6595decafa94847d08ae28c6cb48225124", url = "http://bazel-mirror.storage.googleapis.com/github.com/bazelbuild/rules_closure/archive/0.4.1.tar.gz", )
load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories")
closure_repositories()
local_repository( name = "org_tensorflow", path = "tensorflow", ) load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace") tf_workspace()
load("@org_tensorflow//tensorflow:tensorflow.bzl", "check_version") check_version("0.4.3")
@coreych What version of tensorflow are you using? Have you tried TF 1.0?
@tatatodd Using tensorflow (1.0.0).
Instead, is there a problem with my ~/models/syntaxnet/WORKSPACE file?
I've no idea why the build failed and pointed to io_bazel_rules_closure error. Removing closure_repositories from WORKSPACE resulted in the following Skylark extension error:
$ bazel test --linkopt=-headerpad_max_install_names syntaxnet/... util/utf8/... ERROR: Failed to load Skylark extension '@io_bazel_rules_closure//closure:defs.bzl'. It usually happens when the repository is not defined prior to being used. Maybe repository 'io_bazel_rules_closure' was defined later in your WORKSPACE file? ERROR: cycles detected during target parsing. INFO: Elapsed time: 0.124s ERROR: Couldn't start the build. Unable to run tests.
@coreych What is the git commit hash of your models repository? Have you made any changes to it?
git commit hash: bd7e850a104898e82a45c131eeab6fbbe01be48e
same error
I've solved the io_bazel_rules_closure problem:
- download rules_closure.git from https://github.com/bazelbuild/rules_closure
- put rules_closure.git into models/syntaxnet/tensorflow/ folder
Copy and paste the following into the WORKSPACE file:
local_repository( name = "org_tensorflow", path = "tensorflow", ) local_repository( name = "io_bazel_rules_closure", path = "tensorflow/rules_closure", ) load("@io_bazel_rules_closure//closure:defs.bzl", "closure_repositories") closure_repositories() load("@org_tensorflow//tensorflow:workspace.bzl", "tf_workspace") tf_workspace(path_prefix="", tf_repo_name="org_tensorflow") load("@org_tensorflow//tensorflow:workspace.bzl", "check_version") check_version("0.4.3")
The build will work but with error: Executed 0 out of 17 tests: 1 fails to build and 16 were skipped.