Selectively build TFLite for iOS failure
Attached the toy model that you can use to reproduce this issue.

[toy_tflite_model_20230308.tflite.zip](https://github.com/tensorflow/tensorflow/files/11054748/toy_tflite_model_20230308.tflite.zip)
 
Hi @heguanyu I was successfully able to build the TFLite framework.  Please refer the screenshot here. 

<img width="744" alt="Screenshot 2023-03-24 at 9 48 04 PM" src="https://user-images.githubusercontent.com/118897289/227583969-4a39c87e-58c8-424e-b88a-5980cdde7e33.png">

I have used `toy_tflite_model_20230308.tflite` which is provided as a toy model rather than `tflite_model_vocab_changes_run_18026681_full_dataset.tflite` which is mentioned in the command which I don't think is an issue.

Can you try at your end again freshly and let us know if the issue still persists?

Thanks. Yes it still persist with a brand new git cloned repo

![image](https://user-images.githubusercontent.com/5394318/227593663-78a4265d-a3ec-42e5-89bc-ac44ad83682e.png)
 @heguanyu Thanks for the information.

@sachinprasadhs Could you please look into this issue. Thanks.
 Hi @sachinprasadhs after updating to the latest tensorflow code base, I'm now seeing another different error.. can you please take a look? Thanks

```
ERROR: /private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/external/llvm-project/mlir/BUILD.bazel:5691:11: Compiling mlir/lib/Transforms/Utils/OneToNTypeConversion.cpp [for host] failed: (Aborted): wrapped_clang_pp failed: error executing command external/local_config_cc/wrapped_clang_pp '-D_FORTIFY_SOURCE=1' -fstack-protector -fcolor-diagnostics -Wall -Wthread-safety -Wself-assign -fno-omit-frame-pointer -g0 -O2 -DNDEBUG ... (remaining 122 arguments skipped)
external/llvm-project/mlir/lib/Transforms/Utils/OneToNTypeConversion.cpp:98:21: error: no template named 'unordered_map' in namespace 'std'
  static const std::unordered_map<CastKind, StringRef> castKindNames = {
               ~~~~~^
1 error generated.
Error in child process '/usr/bin/xcrun'. 1
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 275.224s, Critical Path: 36.37s
INFO: 1413 processes: 12 internal, 1401 local.
FAILED: Build did NOT complete successfully
``` @yishuangP , As per your comment here https://github.com/tensorflow/tensorflow/issues/59853#issuecomment-1481642687, Could you pleas let me know what part of Tensorflow has to be looked into, so that I can assign it to the specific team. Thanks! I did a git pull again this morning and the error is back to the `declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule.`

I'd updated the python to python3.10 but error persist.

can someone help? Thanks

```
$ bash tensorflow/lite/ios/build_frameworks.sh --input_models=toy_tflite_model_20230308.tflite --target_archs=x86_64,armv7,arm64
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=316
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 --action_env PYTHON_LIB_PATH=/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages --python_path=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/c6a132a8023db649a658aeceb2edaf046097dbff.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteC_framework (144 packages loaded, 7613 targets configured).
INFO: Found 1 target...
Target //tensorflow/lite/ios/tmp:TensorFlowLiteC_framework up-to-date:
  bazel-out/applebin_ios-ios_x86_64-opt-ST-74bbdaf492e7/bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip
INFO: Elapsed time: 94.481s, Critical Path: 13.92s
INFO: 389 processes: 2 internal, 387 local.
INFO: Build completed successfully, 389 total actions
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=316
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 --action_env PYTHON_LIB_PATH=/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages --python_path=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:monolithic in file /Users/ghe/projects/tensorflow/.bazelrc: --define framework_shared_object=false --define tsl_protobuf_header_only=false --experimental_link_static_libraries_once=false
INFO: Found applicable config definition build:macos in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=macos --copt=-DGRPC_BAZEL_BUILD --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
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/c6a132a8023db649a658aeceb2edaf046097dbff.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 1 more have changed, discarding analysis cache.
INFO: Analyzed target //tensorflow/lite/tools:list_flex_ops_no_kernel_main (7 packages loaded, 1243 targets configured).
INFO: Found 1 target...
Target //tensorflow/lite/tools:list_flex_ops_no_kernel_main up-to-date:
  bazel-bin/tensorflow/lite/tools/list_flex_ops_no_kernel_main
INFO: Elapsed time: 3.091s, Critical Path: 1.62s
INFO: 37 processes: 1 internal, 36 local.
INFO: Build completed successfully, 37 total actions
~/projects/tensorflow/tensorflow/lite/ios/tmp ~/projects/tensorflow
~/projects/tensorflow
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=316
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 --action_env PYTHON_LIB_PATH=/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages --python_path=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/c6a132a8023db649a658aeceb2edaf046097dbff.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 2 more have changed, discarding analysis cache.
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework (436 packages loaded, 36598 targets configured).
INFO: Found 1 target...
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: Executing genrule //tensorflow:libtensorflow_framework.2.dylib_sym [for host] failed: not all outputs were created or valid
realpath: illegal option -- -
usage: realpath [-q] [path ...]
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 845.682s, Critical Path: 65.05s
INFO: 7414 processes: 158 internal, 7256 local.
FAILED: Build did NOT complete successfully
``` Hey @sachinprasadhs, the error we are getting are from tensorflow/BUILD file. looks like the error occurred when we generate the tensorflow shared library `tensorflow/libtensorflow_framework.2.dylib`. Could you help triage to someone from the tensorflow side? I don't know if this is a build config issue or something changed. Thanks
```
tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
```
Also @heguanyu, can you try if tesorflow 2.11.0 has this issue? Thanks! @nitins17 , Could you please look into this.
cc: @learning-to-play 

> Hey @sachinprasadhs, the error we are getting are from tensorflow/BUILD file. looks like the error occurred when we generate the tensorflow shared library `tensorflow/libtensorflow_framework.2.dylib`. Could you help triage to someone from the tensorflow side? I don't know if this is a build config issue or something changed. Thanks
> 
> ```
> tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
> ```
> 
> Also @heguanyu, can you try if tesorflow 2.11.0 has this issue? Thanks!

 From the logs, it might possibly be a realpath issue I have seen in one of our other builds. 
```
realpath: illegal option -- -
usage: realpath [-q] [path ...]
```

Are you using the GNU version of realpath? If not, could you [install it](https://formulae.brew.sh/formula/coreutils) and try building again? Hi @nitins17 I tried installing coreutils as your suggestion, but not getting luck. Is version 9.2 correct? 

```
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 2 more have changed, discarding analysis cache.
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework (437 packages loaded, 36613 targets configured).
INFO: Found 1 target...
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: Executing genrule //tensorflow:libtensorflow_framework.2.dylib_sym [for host] failed: not all outputs were created or valid
realpath: illegal option -- -
usage: realpath [-q] [path ...]
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1345.515s, Critical Path: 91.51s
INFO: 9646 processes: 191 internal, 9455 local.
FAILED: Build did NOT complete successfully
ghe-mn2:tensorflow ghe:master]$ brew install coreutils
==> Downloading https://formulae.brew.sh/api/formula.jws.json
##O#-#                                                                        
==> Downloading https://formulae.brew.sh/api/cask.jws.json
#=#=#                                                                         
Warning: coreutils 9.2 is already installed and up-to-date.
To reinstall 9.2, run:
  brew reinstall coreutils
ghe-mn2:tensorflow ghe:master]$ 
``` Yeah, I believe the latest version should work. Note that the GNU utilities are installed with a 'g' prefix. That is, the gnu version is `grealpath` where as Bazel runs using just `realpath` so it is possible that the macOS version is still getting picked up. Can you try [replacing the macOS utilities with the GNU utilities](https://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities)?

Once you have replaced the defaults with GNU utilities, run `realpath --help`. If it points to the GNU version, it should print out its usage and other info. The default macOS version just throws an error like the one above in https://github.com/tensorflow/tensorflow/issues/60088#issuecomment-1499766349.  > Hey @sachinprasadhs, the error we are getting are from tensorflow/BUILD file. looks like the error occurred when we generate the tensorflow shared library `tensorflow/libtensorflow_framework.2.dylib`. Could you help triage to someone from the tensorflow side? I don't know if this is a build config issue or something changed. Thanks
> 
> ```
> tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
> ```
> 
> Also @heguanyu, can you try if tesorflow 2.11.0 has this issue? Thanks!

Sorry but no luck when I tried the same command after `git checkout v2.11.0`  @nitins17 Thanks for the guide. After installing realpath according to your instruction, previous error was gone, however it now shows another error.. `ModuleNotFoundError: No module named 'packaging'
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build`

@yishuangP is this specific to SelectTfOps? I'm using v2.11.0. 

```
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 2 more have changed, discarding analysis cache.
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework (395 packages loaded, 34048 targets configured).
INFO: Found 1 target...
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1426:19: Executing genrule //tensorflow:tf_python_api_gen_v2 [for host] failed: (Exit 1): bash failed: error executing command /bin/bash -c ... (remaining 1 argument skipped)
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/tools/api/generator/create_python_api.py", line 22, in <module>
    from tensorflow.python.tools.api.generator import doc_srcs
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/__init__.py", line 42, in <module>
    from tensorflow.python import data
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/data/__init__.py", line 21, in <module>
    from tensorflow.python.data import experimental
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/data/experimental/__init__.py", line 96, in <module>
    from tensorflow.python.data.experimental import service
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/data/experimental/service/__init__.py", line 419, in <module>
    from tensorflow.python.data.experimental.ops.data_service_ops import distribute
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/data/experimental/ops/data_service_ops.py", line 22, in <module>
    from tensorflow.python.data.experimental.ops import compression_ops
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/data/experimental/ops/compression_ops.py", line 16, in <module>
    from tensorflow.python.data.util import structure
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/data/util/structure.py", line 29, in <module>
    from tensorflow.python.ops import resource_variable_ops
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/ops/resource_variable_ops.py", line 38, in <module>
    from tensorflow.python.framework import meta_graph
  File "/private/var/tmp/_bazel_ghe/a40be6b67c18b5da908566b099777def/execroot/org_tensorflow/bazel-out/host/bin/tensorflow/create_tensorflow.python_api_tf_python_api_gen_v2.runfiles/org_tensorflow/tensorflow/python/framework/meta_graph.py", line 18, in <module>
    from packaging import version as packaging_version  # pylint: disable=g-bad-import-order
ModuleNotFoundError: No module named 'packaging'
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /Users/ghe/projects/tensorflow/tensorflow/python/tools/BUILD:281:10 Middleman _middlemen/tensorflow_Spython_Stools_Sprint_Uselective_Uregistration_Uheader-runfiles failed: (Exit 1): bash failed: error executing command /bin/bash -c ... (remaining 1 argument skipped)
INFO: Elapsed time: 1781.743s, Critical Path: 157.11s
INFO: 10487 processes: 243 internal, 10244 local.
FAILED: Build did NOT complete successfully
``` Yeah this new error is specific to SelectTfOps. This seems like a python issue? The error is in `tensorflow/python/tools/BUILD`. @nitins17 do you have any idea what might be the issue here? ```
ModuleNotFoundError: No module named 'packaging'
```

Is the [packaging](https://pypi.org/project/packaging/) module installed?  @nitins17 

I haven't installed `packaging`. As an iOS engineer, python is not often used, so the python is pretty much in vanilla state. 

After installing it and rerunning the script, now it asks me to install `requests` module...
```
ModuleNotFoundError: No module named 'requests'
```
With both modules pip installed, I'm finally build successfully! However still seeing another issue

```
INFO: Elapsed time: 711.042s, Critical Path: 174.60s
INFO: 2046 processes: 3 internal, 2043 local.
INFO: Build completed successfully, 2046 total actions
Output can be found here:
ls: cannot access '/Users/ghe/projects/tensorflow/bazel-out/applebin_ios-ios_sim_arm64-opt-ST-f882807c96e5/bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip': No such file or directory
```

I tried looking for the file, according to the instruction, at `bazel-bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip` and it was also missing..(there is no tmp directory). Any idea what's the reason and where should look for this file? 

```
ghe-mn2:ios ghe]$ pwd
/Users/ghe/projects/tensorflow/bazel-bin/tensorflow/lite/ios
ghe-mn2:ios ghe]$ ls -al
total 0
drwxrwxrwx  2 ghe wheel   64 Apr  7 13:36 .
drwxrwxrwx 45 ghe wheel 1440 Apr  6 18:43 ..
```




Also, can your team please add these dependencies, along with the above gnu utility tricks, to either Pre-requisites in the [official instruction](https://www.tensorflow.org/lite/guide/build_ios#selectively_build_tflite_frameworks), or just put them into the build scripts? I asked my colleagues and they are seeing same errors as myself. I believe this would be beneficial to a lot more people in ios-TF community.  > With both modules pip installed, I'm finally build successfully! However still seeing another issue
> 
> ```
> INFO: Elapsed time: 711.042s, Critical Path: 174.60s
> INFO: 2046 processes: 3 internal, 2043 local.
> INFO: Build completed successfully, 2046 total actions
> Output can be found here:
> ls: cannot access '/Users/ghe/projects/tensorflow/bazel-out/applebin_ios-ios_sim_arm64-opt-ST-f882807c96e5/bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip': No such file or directory
> ```
> 
> I tried looking for the file, according to the instruction, at `bazel-bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip` and it was also missing..(there is no tmp directory). Any idea what's the reason and where should look for this file?
> 

Sorry but I don't know whats happening here. @yishuangP do you know?

> Also, can your team please add these dependencies, along with the above gnu utility tricks, to either Pre-requisites in the [official instruction](https://www.tensorflow.org/lite/guide/build_ios#selectively_build_tflite_frameworks), or just put them into the build scripts? I asked my colleagues and they are seeing same errors as myself. I believe this would be beneficial to a lot more people in ios-TF community.

Thanks for letting us know! Maybe it would be useful to put these in a FAQs or as comments in the build scripts but I'll leave the decision up to @yishuangP and the TF Lite team. Thanks [nitins17](https://github.com/nitins17) for the help!

Hi [heguanyu](https://github.com/heguanyu), sorry for the inconvenience. Glad to hear that it finally build successfully! Since you already have the build file under `tensorflow/lite/ios/tmp/`, can you just try running this command `bazel build -c opt --config=ios --ios_multi_cpus=arm64 --use_top_level_targets_for_symlinks --define=tflite_with_xnnpack=false //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework`?


I think all these problems might come from different MacOs versions. The build command works fine for an older OS version.

> Also, can your team please add these dependencies, along with the above gnu utility tricks, to either Pre-requisites in the [official instruction](https://www.tensorflow.org/lite/guide/build_ios#selectively_build_tflite_frameworks), or just put them into the build scripts? I asked my colleagues and they are seeing same errors as myself. I believe this would be beneficial to a lot more people in ios-TF community.

Thanks for the suggestion! We'll update our public website. @yishuangP I think the BUILD file in tmp was deleted after the build is successful, seeing

```
ghe-mn2:tensorflow ghe:(v2.11.0)]$ bazel build -c opt --config=ios --ios_multi_cpus=arm64 --use_top_level_targets_for_symlinks --define=tflite_with_xnnpack=false //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=312
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 --action_env PYTHON_LIB_PATH=/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages --python_path=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
ERROR: Skipping '//tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework': no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/ghe/projects/tensorflow/tensorflow/lite/ios/tmp
WARNING: Target pattern parsing failed.
ERROR: no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/ghe/projects/tensorflow/tensorflow/lite/ios/tmp
INFO: Elapsed time: 2.316s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
``` Just pulled from master branch and still seeing the file not found error. 

```
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/e2b15ec235fed7e4ff1f99193c7bbffe830d4934.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 2 more have changed, discarding analysis cache.
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/b9d4073a6913891ce9cbd8965c8d506075d2a45a.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/openxla/stablehlo/archive/1d6a8587ea959db3574c1311905a8bf1ef509db0.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework (437 packages loaded, 36804 targets configured).
INFO: Found 1 target...
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework up-to-date:
  bazel-out/applebin_ios-ios_x86_64-opt-ST-74bbdaf492e7/bin/tensorflow/lite/ios/tmp/TensorFlowLiteSelectTfOps_framework.zip
INFO: Elapsed time: 2668.454s, Critical Path: 299.53s
INFO: 13599 processes: 944 internal, 12655 local.
INFO: Build completed successfully, 13599 total actions
Output can be found here:
ls: cannot access '/Users/ghe/projects/tensorflow/bazel-out/applebin_ios-ios_sim_arm64-opt-ST-f882807c96e5/bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip': No such file or directory

ghe-mn2:tensorflow ghe:master]$ bazel build -c opt --config=ios --ios_multi_cpus=arm64 --use_top_level_targets_for_symlinks --define=tflite_with_xnnpack=false //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=312
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3 --action_env PYTHON_LIB_PATH=/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages --python_path=/Library/Frameworks/Python.framework/Versions/3.10/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/e2b15ec235fed7e4ff1f99193c7bbffe830d4934.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
ERROR: Skipping '//tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework': no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/ghe/projects/tensorflow/tensorflow/lite/ios/tmp
WARNING: Target pattern parsing failed.
ERROR: no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/ghe/projects/tensorflow/tensorflow/lite/ios/tmp
INFO: Elapsed time: 0.135s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
``` Hi @nitins17 @yishuangP Bumping up this thread again - can you help checking what might be the issue that file get missing?

Thank you! I am able to replicate on r2.13 branch:

```
bazel build -c opt --config=ios --ios_multi_cpus=arm64 --use_top_level_targets_for_symlinks --define=tflite_with_xnnpack=false //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework
Starting local Bazel server and connecting to it...
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=178
INFO: Reading rc options for 'build' from /Users/pisethk/git/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/pisethk/git/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/pisethk/git/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Users/pisethk/miniforge3/bin/python3 --action_env PYTHON_LIB_PATH=/Users/pisethk/miniforge3/lib/python3.10/site-packages --python_path=/Users/pisethk/miniforge3/bin/python3
INFO: Reading rc options for 'build' from /Users/pisethk/git/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils,tensorflow/core/tfrt/utils/debug
INFO: Found applicable config definition build:short_logs in file /Users/pisethk/git/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/pisethk/git/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/pisethk/git/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
ERROR: Skipping '//tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework': no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/pisethk/git/tensorflow/tensorflow/lite/ios/tmp
WARNING: Target pattern parsing failed.
ERROR: no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
 - /Users/pisethk/git/tensorflow/tensorflow/lite/ios/tmp
INFO: Elapsed time: 2.798s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
``` Hi, just to clarify, how are you running the script? The following command works for me.  Are you running the command under `/Users/pisethk/git/tensorflow`? 
```
bash tensorflow/lite/ios/build_frameworks.sh   --input_models="${PWD}/tensorflow/lite/testdata/softplus_flex.bin"   --target_archs=x86_64,arm64
```

Looking at the error you got, it seems that the tmp directly is not successfully created.
```
ERROR: Skipping '//tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework': no such package 'tensorflow/lite/ios/tmp': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package.
``` > Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework up-to-date:
>   bazel-out/applebin_ios-ios_x86_64-opt-ST-74bbdaf492e7/bin/tensorflow/lite/ios/tmp/TensorFlowLiteSelectTfOps_framework.zip

Hi really sorry for the late reply. If you look at the log, the framework is already successfully built and the artifact can be found at  `bazel-out/applebin_ios-ios_x86_64-opt-ST-74bbdaf492e7/bin/tensorflow/lite/ios/tmp/TensorFlowLiteSelectTfOps_framework.zip`. The script tensorflow/lite/ios/build_frameworks.sh will always delete the temporary directory `tensorflow/lite/ios/tmp/` at the end of the script, so your next command failed.
```
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework up-to-date:
  bazel-out/applebin_ios-ios_x86_64-opt-ST-74bbdaf492e7/bin/tensorflow/lite/ios/tmp/TensorFlowLiteSelectTfOps_framework.zip
``` Hi @yishuangP Thanks! I do find it in that folder! 2 more question tho:

1. I noticed the size is huge(180+MB for zip file, and 738MB after decompress), is this expected at all? The original framework size is only around 4MB... 

```
➜  tmp ls -al
total 200872
drwxrwxrwx 9 ghe       288 Jun 12 10:26 .
drwxrwxrwx 6 ghe       192 Jun  6 16:25 ..
drwxrwxrwx 7 ghe       224 Jun  6 16:25 TensorFlowLiteC_framework-intermediates
drwxr-xr-x 3 ghe        96 Jun  6 16:22 TensorFlowLiteC_framework.modulemaps-intermediates
-r-xr-xr-x 1 ghe  20355185 Jun  6 16:25 TensorFlowLiteC_framework.zip
drwxr-xr-x 3 ghe        96 Jun  6 16:25 TensorFlowLiteC_framework_archive-root
drwxrwxrwx 6 ghe       192 Jun 12 10:26 TensorFlowLiteSelectTfOps_framework-intermediates
-r-xr-xr-x 1 ghe 182243080 Jun 12 10:26 TensorFlowLiteSelectTfOps_framework.zip
drwxr-xr-x 3 ghe        96 Jun 12 10:26 TensorFlowLiteSelectTfOps_framework_archive-root
```

3. Is it possible to fix the script so that the zip file will be copied to some fixed location, instead of a temporary path that I have to look up from the stdout everytime? That will help automating some processes in the CD pipeline. 


Thank you! > I noticed the size is huge(180+MB for zip file, and 738MB after decompress), is this expected at all? The original framework size is only around 4MB...

Hi @heguanyu, yes unfortunately the binary size with selected ops will be larger because it links in TF kernels. What are the targeted archs you built for? You probably only need `arm64`?
 @yishuangP We noticed that the bazel script logic is that - if it detects any select operators in the model, it will add ALL select operators into the binary, whether or not it is being used in the model. Is there any way to ONLY include the operators that being used by the tflite model?

As per your 2nd suggestion, limiting the architect to only arm64 will just cut the size in half - down to 364MB - but it is still too huge for a iOS device... Hi @heguanyu this is what the script is supposed to do. Here we only generate targets for your models https://github.com/tensorflow/tensorflow/blob/54751245dfb6c551e5118c6bd279baf806f784cb/tensorflow/lite/ios/build_frameworks.sh#L92 .  Could you run the following command and check if the ops_list.txt contains exactly the ops you need?
```
FLAG_MODELS= <your model>
TMP_DIR=<your temporary directory>
bazel build -c opt --config=monolithic //tensorflow/lite/tools:list_flex_ops_no_kernel_main
bazel-bin/tensorflow/lite/tools/list_flex_ops_no_kernel_main --graphs=${FLAG_MODELS} > ${TMP_DIR}/ops_list.txt
``` This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you.
<details><summary>Click to expand!</summary> 
 
 ### Issue Type

Build/Install

### Have you reproduced the bug with TF nightly?

Yes

### Source

source

### Tensorflow Version

2.12.0

### Custom Code

No

### OS Platform and Distribution

MacOS Ventura 13.1

### Mobile device

N/A

### Python version

3.9.16

### Bazel version

5.3

### GCC/Compiler version

14.0.0

### CUDA/cuDNN version

N/A

### GPU model and memory

N/A

### Current Behaviour?

```shell
This was a subsequence bug from another issue(https://github.com/tensorflow/tensorflow/issues/59853#issuecomment-1481642687) and @yishuangP asked me to file a separate issue for Tensorflow Tools.

I'm trying to build a tf framework from certain tflite model to reduce framework size. However I keep seeing below error. The command I'm using is `bash tensorflow/lite/ios/build_frameworks.sh --input_models=tflite_model_vocab_changes_run_18026681_full_dataset.tflite --target_archs=x86_64,armv7,arm64`


ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: Executing genrule //tensorflow:libtensorflow_framework.2.dylib_sym [for host] failed: not all outputs were created or valid
realpath: illegal option -- -
usage: realpath [-q] [path ...]
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1046.736s, Critical Path: 138.53s
INFO: 3339 processes: 25 internal, 3314 local.
FAILED: Build did NOT complete successfully
```
```


### Standalone code to reproduce the issue

```shell
There is no code involved. To reproduce:

1. git fetch a new project
2. Copy the toy model I provided into its root directory
3. Run `bash tensorflow/lite/ios/build_frameworks.sh --input_models=tflite_model_vocab_changes_run_18026681_full_dataset.tflite --target_archs=x86_64,armv7,arm64` command

It will compile for a couple minutes, and fail finally.
```


### Relevant log output

```shell
$ bash tensorflow/lite/ios/build_frameworks.sh --input_models=tflite_model_vocab_changes_run_18026681_full_dataset.tflite --target_archs=x86_64,armv7,arm64
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=314
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/python3 --action_env PYTHON_LIB_PATH= /Library/Python/3.9/site-packages --python_path=/Applications/Xcode.app/Contents/Developer/usr/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/55dd04f6bcf797b4ff20e74158377bcc912b9870.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteC_framework (144 packages loaded, 7602 targets configured).
INFO: Found 1 target...
Target //tensorflow/lite/ios/tmp:TensorFlowLiteC_framework up-to-date:
  bazel-out/applebin_ios-ios_x86_64-opt-ST-74bbdaf492e7/bin/tensorflow/lite/ios/tmp/TensorFlowLiteC_framework.zip
INFO: Elapsed time: 38.614s, Critical Path: 5.29s
INFO: 13 processes: 2 internal, 11 local.
INFO: Build completed successfully, 13 total actions
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=314
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/python3 --action_env PYTHON_LIB_PATH= /Library/Python/3.9/site-packages --python_path=/Applications/Xcode.app/Contents/Developer/usr/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:monolithic in file /Users/ghe/projects/tensorflow/.bazelrc: --define framework_shared_object=false --define tsl_protobuf_header_only=false --experimental_link_static_libraries_once=false
INFO: Found applicable config definition build:macos in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=macos --copt=-DGRPC_BAZEL_BUILD --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
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/55dd04f6bcf797b4ff20e74158377bcc912b9870.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 1 more have changed, discarding analysis cache.
INFO: Analyzed target //tensorflow/lite/tools:list_flex_ops_no_kernel_main (7 packages loaded, 1231 targets configured).
INFO: Found 1 target...
Target //tensorflow/lite/tools:list_flex_ops_no_kernel_main up-to-date:
  bazel-bin/tensorflow/lite/tools/list_flex_ops_no_kernel_main
INFO: Elapsed time: 0.292s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
~/projects/tensorflow/tensorflow/lite/ios/tmp ~/projects/tensorflow
~/projects/tensorflow
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=314
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --define framework_shared_object=true --define tsl_protobuf_header_only=true --define=use_fast_cpp_protos=true --define=allow_oversize_protos=true --spawn_strategy=standalone -c opt --announce_rc --define=grpc_no_ares=true --noincompatible_remove_legacy_whole_archive --enable_platform_specific_config --define=with_xla_support=true --config=short_logs --config=v2 --define=no_aws_support=true --define=no_hdfs_support=true --experimental_cc_shared_library --experimental_link_static_libraries_once=false --incompatible_enforce_config_setting_visibility
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/Applications/Xcode.app/Contents/Developer/usr/bin/python3 --action_env PYTHON_LIB_PATH= /Library/Python/3.9/site-packages --python_path=/Applications/Xcode.app/Contents/Developer/usr/bin/python3
INFO: Reading rc options for 'build' from /Users/ghe/projects/tensorflow/.bazelrc:
  'build' options: --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils
INFO: Found applicable config definition build:short_logs in file /Users/ghe/projects/tensorflow/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /Users/ghe/projects/tensorflow/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:ios in file /Users/ghe/projects/tensorflow/.bazelrc: --apple_platform_type=ios --apple_bitcode=embedded --copt=-fembed-bitcode --copt=-Wno-c++11-narrowing --noenable_platform_specific_config --copt=-w --cxxopt=-std=c++17 --host_cxxopt=-std=c++17 --define=with_xla_support=false
WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/55dd04f6bcf797b4ff20e74158377bcc912b9870.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 2 more have changed, discarding analysis cache.
INFO: Analyzed target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework (435 packages loaded, 36544 targets configured).
INFO: Found 1 target...
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: declared output 'tensorflow/libtensorflow_framework.2.dylib' was not created by genrule. This is probably because the genrule actually didn't create this output, or because the output was a directory and the genrule was run remotely (note that only the contents of declared file outputs are copied from genrules run remotely)
ERROR: /Users/ghe/projects/tensorflow/tensorflow/BUILD:1128:21: Executing genrule //tensorflow:libtensorflow_framework.2.dylib_sym [for host] failed: not all outputs were created or valid
realpath: illegal option -- -
usage: realpath [-q] [path ...]
Target //tensorflow/lite/ios/tmp:TensorFlowLiteSelectTfOps_framework failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1046.736s, Critical Path: 138.53s
INFO: 3339 processes: 25 internal, 3314 local.
FAILED: Build did NOT complete successfully
```
</details>