Skip to content

Bazel build fails on LiteRT v1.4.0 #4530

@wajahat-abbas

Description

@wajahat-abbas

Hello,

I am trying to build target //tflite:tensorflowlite with Bazel but unsuccessful so far. Please see logs below. On a side note, I have tried building with docker also and result is the same.

I suspect this might be because the WORKSPACE file pins org_tensorflow to the tensorflow master branch. And If that’s the case, I’m a bit confused about how releases are expected to work, since the master branch changes constantly and could lead to dependency inconsistencies. This also possibly explains the issue seen by reporter in #3895.

I also tried building release v2.0.2 and it still fails.

LiteRT % bazel build -c dbg --config macos //tflite:tensorflowlite 
Starting local Bazel server and connecting to it...
WARNING: The following configs were expanded more than once: [apple-toolchain]. For repeatable flags, repeats are counted twice and may lead to unexpected behavior.
INFO: Reading 'startup' options from /Users/user/Workspace/test/LiteRT/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=195
INFO: Reading rc options for 'build' from /Users/user/Workspace/test/LiteRT/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec --experimental_repo_remote_exec --noenable_bzlmod --noincompatible_enable_cc_toolchain_resolution --noincompatible_enable_android_toolchain_resolution
INFO: Reading rc options for 'build' from /Users/user/Workspace/test/LiteRT/.bazelrc:
  'build' options: --repo_env=USE_PYWRAP_RULES=True --copt=-DGRPC_BAZEL_BUILD --host_copt=-DGRPC_BAZEL_BUILD --action_env=GRPC_BAZEL_RUNTIME=1 --repo_env=PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upb --action_env=PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=upb --repo_env=RULES_PYTHON_ENABLE_PYSTAR=0 --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --features=-force_no_whole_archive --host_features=-force_no_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility --config=v2 --config=litert_prefixes
INFO: Found applicable config definition build:short_logs in file /Users/user/Workspace/test/LiteRT/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/user/Workspace/test/LiteRT/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:litert_prefixes in file /Users/user/Workspace/test/LiteRT/.bazelrc: --define=litert_prefixes=external/org_tensorflow/
INFO: Found applicable config definition build:macos in file /Users/user/Workspace/test/LiteRT/.bazelrc: --apple_platform_type=macos --copt=-DGRPC_BAZEL_BUILD --features=archive_param_file --linkopt=-Wl,-undefined,dynamic_lookup --host_linkopt=-Wl,-undefined,dynamic_lookup --config=apple-toolchain --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
INFO: Found applicable config definition build:apple-toolchain in file /Users/user/Workspace/test/LiteRT/.bazelrc: --apple_crosstool_top=@local_config_apple_cc//:toolchain --crosstool_top=@local_config_apple_cc//:toolchain --host_crosstool_top=@local_config_apple_cc//:toolchain
INFO: Found applicable config definition build:macos in file /Users/user/Workspace/test/LiteRT/.bazelrc: --apple_platform_type=macos --copt=-DGRPC_BAZEL_BUILD --features=archive_param_file --linkopt=-Wl,-undefined,dynamic_lookup --host_linkopt=-Wl,-undefined,dynamic_lookup --config=apple-toolchain --copt=-w --define=PREFIX=/usr --define=LIBDIR=$(PREFIX)/lib --define=INCLUDEDIR=$(PREFIX)/include --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
INFO: Found applicable config definition build:apple-toolchain in file /Users/user/Workspace/test/LiteRT/.bazelrc: --apple_crosstool_top=@local_config_apple_cc//:toolchain --crosstool_top=@local_config_apple_cc//:toolchain --host_crosstool_top=@local_config_apple_cc//:toolchain
DEBUG: /private/var/tmp/_bazel_user/84cb13b957679ff723be6edb7b19358c/external/local_xla/third_party/py/python_repo.bzl:84:14: !!!Using pywrap rules instead of directly creating .so objects!!!
DEBUG: /private/var/tmp/_bazel_user/84cb13b957679ff723be6edb7b19358c/external/local_xla/third_party/py/python_repo.bzl:89:10: 
=============================
Hermetic Python configuration:
Version: "3.12"
Kind: ""
Interpreter: "default" (provided by rules_python)
Requirements_lock label: "@python_version_repo//:requirements_lock_3_12.txt"
=====================================
ERROR: Error computing the main repository mapping: at /private/var/tmp/_bazel_user/84cb13b957679ff723be6edb7b19358c/external/org_tensorflow/tensorflow/workspace0.bzl:8:6: at /private/var/tmp/_bazel_user/84cb13b957679ff723be6edb7b19358c/external/com_github_grpc_grpc/bazel/grpc_extra_deps.bzl:27:6: cannot load '@@rules_java//java:rules_java_deps.bzl': no such file
Computing main repo mapping: 
    Fetching repository @@com_google_googleapis; starting
    Fetching repository @@envoy_api; starting
    Fetching repository @@com_google_protobuf; starting
    Fetching repository @@bazel_gazelle; starting
    Fetching repository @@build_bazel_rules_apple; starting
    Fetching repository @@com_envoyproxy_protoc_gen_validate; starting
    Fetching repository @@google_cloud_cpp; starting
    Fetching repository @@build_bazel_rules_swift; starting ... (24 fetches)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions