Repository navigation
Description
I am getting bazel errors when building from Master.
At first, with my original bazel version "bazel 3.1.0"
INFO: Found applicable config definition build:macos in file /Users/jbclarke/Code/tensorflow/java/tensorflow-core/tensorflow-core-api/.bazelrc: --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
ERROR: /private/var/tmp/_bazel_jbclarke/6d259067b5cfdcb6df27dfdfc33b3066/external/org_tensorflow/tensorflow/core/kernels/mlir_generated/build_defs.bzl:175:24: rule() got unexpected keyword argument 'incompatible_use_toolchain_transition'
ERROR: Analysis of target '@org_tensorflow//tensorflow/tools/lib_package:jnilicenses_generate' failed; build aborted: error loading package '@org_tensorflow//tensorflow/core/kernels': Extension file 'tensorflow/core/kernels/mlir_generated/build_defs.bzl' has errors
The first errors where in the TensorFlow build itself, so I updated to baselisk as per the build instructions for TensorFlow.
Build from source.
After that I started getting errors in tensorflow-core-api.
INFO: Found applicable config definition build:macos in file /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/.bazelrc: --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++14 --host_cxxopt=-std=c++14
ERROR: /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/WORKSPACE:18:84: invalid escape sequence: \(. You can enable unknown escape sequences by passing the flag --incompatible_restrict_string_escapes=false
ERROR: /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/WORKSPACE:18:109: invalid escape sequence: \.. You can enable unknown escape sequences by passing the flag --incompatible_restrict_string_escapes=false
ERROR: /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/WORKSPACE:18:121: invalid escape sequence: \.. You can enable unknown escape sequences by passing the flag --incompatible_restrict_string_escapes=false
ERROR: /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/WORKSPACE:18:123: invalid escape sequence: \). You can enable unknown escape sequences by passing the flag --incompatible_restrict_string_escapes=false
ERROR: /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/WORKSPACE:18:125: invalid escape sequence: \(. You can enable unknown escape sequences by passing the flag --incompatible_restrict_string_escapes=false
ERROR: /Users/jbclarke/Code/java/tensorflow-core/tensorflow-core-api/WORKSPACE:18:131: invalid escape sequence: \). You can enable unknown escape sequences by passing the flag --incompatible_restrict_string_escapes=false
ERROR: error loading package 'external': Failed to parse WORKSPACE file
I tried to add -incompatible_restrict_string_escapes=false to build.sh
"BUILD_FLAGS="$BUILD_FLAGS --experimental_repo_remote_exec --python_path="$PYTHON_BIN_PATH" --output_filter=DONT_MATCH_ANYTHING --verbose_failures -incompatible_restrict_string_escapes=false"
But the build did not recognize the option -incompatible_restrict_string_escapes
Finally, I had to copy the .bazelversion file (presently version 3.7.2) from the @org_tensorflow source, to tensorflow-core-api/.bazelversion.
Shouldn't we update out build system to match the current TensorFlow build (e.g copy .bazelversion to tensorflow-core-api/?
TensorFlow only requires the bazel version to be between _TF_MIN_BAZEL_VERSION and _TF_MAX_BAZEL_VERSION, as defined in @org_tensorflow/configure.py.
Presently defined as:
_TF_MIN_BAZEL_VERSION = '3.7.2'
_TF_MAX_BAZEL_VERSION = '3.99.0'
Activity
karllessard commentedon Jun 14, 2021
Yes @JimClarke5 , since we've migrated to TF2.5, a newer version of Bazel is now required. The CI build now uses 3.7.2. So you just need to update it on your side as well.
Sorry I just have sent a communication about this, we probably need to update the contributor guide to specify it but even there you would not have been notified.
JimClarke5 commentedon Jun 14, 2021
Thanks @karllessard.
How about adding
tensorflow-core-api/.bazelversionto the repository?karllessard commentedon Jun 15, 2021
Sure! Want to add it up?
JimClarke5 commentedon Jun 15, 2021
I pushed it in the latest Metrics PR #337. If you think that will take too long to merge, I can do a standalone PR just for that.
karllessard commentedon Jun 16, 2021
Yes if you can make a separate PR just for this @JimClarke5 , that would be great. Closing this issue now.
rnett commentedon Jun 16, 2021
@JimClarke5 I can add it to #235, I had it there at one point.