models icon indicating copy to clipboard operation
models copied to clipboard

Error: Build and run tests for Syntaxnet fail on Mac OS

Open reishin0 opened this issue 9 years ago • 5 comments

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")

reishin0 avatar Feb 27 '17 12:02 reishin0

@coreych What version of tensorflow are you using? Have you tried TF 1.0?

tatatodd avatar Mar 01 '17 02:03 tatatodd

@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.

reishin0 avatar Mar 01 '17 14:03 reishin0

@coreych What is the git commit hash of your models repository? Have you made any changes to it?

tatatodd avatar Mar 03 '17 19:03 tatatodd

git commit hash: bd7e850a104898e82a45c131eeab6fbbe01be48e

same error

reishin0 avatar Mar 04 '17 02:03 reishin0

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.

reishin0 avatar Mar 05 '17 14:03 reishin0