Selectively Build TensorFlow Lite with Docker ends with an error.
### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

latest

### Custom code

No

### OS platform and distribution

AWS m5a.xlarge: CPU 4, Memory 16, Linux Ubuntu 24.04 LTS

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Hi there,
I'm trying to reduce TensorFlow Lite binary size, [selectively building TensorFlow Lite with Docker using the guide](https://www.tensorflow.org/lite/guide/reduce_binary_size#selectively_build_tensorflow_lite_with_docker).

I have the same error log as in [the issue](https://github.com/tensorflow/tensorflow/issues/61101#issuecomment-1613075866), which was closed due to inactivity, and I'm not sure how to proceed.



### Standalone code to reproduce the issue

```shell
1. I downloaded the file: `https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/lite/tools/tflite-android.Dockerfile  `
2. run: ` docker build . -t tflite-builder -f tflite-android.Dockerfile`
3. Downloaded the script for building TensorFlow with Docker by running:

curl -o build_aar_with_docker.sh \
https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/lite/tools/build_aar_with_docker.sh &&
chmod +x build_aar_with_docker.sh
```
4. Downloaded the TensorFlow Git repository and stay on the master branch `https://github.com/tensorflow/tensorflow.git` 
5. Run the build_aar_with_docker.sh script with params (check log output)
```


### Relevant log output

```shell
ubuntu:~/tflite$ ./build_aar_with_docker.sh \
--input_models=/home/ubuntu/tflite/models/model.tflite \
 --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a \
--src_dir=/home/ubuntu/tflite/tensorflow
+++ dirname ./build_aar_with_docker.sh
++ cd .
++ pwd
+ SCRIPT_DIR=/home/ubuntu/tflite
+ ARGUMENTS='--input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a --src_dir=/home/ubuntu/tflite/tensorflow'
+ BUILD_FLAGS=
+ TARGET_ARCHS=x86,x86_64,arm64-v8a,armeabi-v7a
+ FLAG_SRC_DIR=
+ '[' 3 -gt 5 ']'
+ for i in "$@"
+ case $i in
+ FLAG_MODELS=/home/ubuntu/tflite/models/model.tflite
+ BUILD_FLAGS=' --input_models=/home/ubuntu/tflite/models/model.tflite'
+ shift
+ for i in "$@"
+ case $i in
+ TARGET_ARCHS=x86,x86_64,arm64-v8a,armeabi-v7a
+ BUILD_FLAGS=' --input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a'
+ shift
+ for i in "$@"
+ case $i in
+ FLAG_SRC_DIR=/home/ubuntu/tflite/tensorflow
+ shift
+ '[' '!' -d /tensorflow_src ']'
++ echo /home/ubuntu/tflite/models/model.tflite
++ sed 's/,/ /g'
+ for model in $(echo ${FLAG_MODELS} | sed "s/,/ /g")
+ FLAG_DIR=' -v /home/ubuntu/tflite/models/model.tflite:/home/ubuntu/tflite/models/model.tflite'
+ '[' -z ']'
+ mkdir -p bazel-build-cache
+ BAZEL_CACHE_DIR=/home/ubuntu/tflite/bazel-build-cache
+ ARGUMENTS='--input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a --src_dir=/home/ubuntu/tflite/tensorflow --cache_dir=/home/ubuntu/tflite/bazel-build-cache'
+ FLAG_DIR=' -v /home/ubuntu/tflite/models/model.tflite:/home/ubuntu/tflite/models/model.tflite -v /home/ubuntu/tflite/bazel-build-cache:/home/ubuntu/tflite/bazel-build-cache'
+ docker run --rm -it -v /home/ubuntu/tflite/tensorflow:/tensorflow_src -v /home/ubuntu/tflite:/host_dir -v /home/ubuntu/tflite:/script_dir -v /home/ubuntu/tflite/models/model.tflite:/home/ubuntu/tflite/models/model.tflite -v /home/ubuntu/tflite/bazel-build-cache:/home/ubuntu/tflite/bazel-build-cache --entrypoint /script_dir/build_aar_with_docker.sh tflite-builder --input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a --src_dir=/home/ubuntu/tflite/tensorflow --cache_dir=/home/ubuntu/tflite/bazel-build-cache
+++ dirname /script_dir/build_aar_with_docker.sh
++ cd /script_dir
++ pwd
+ SCRIPT_DIR=/script_dir
+ ARGUMENTS='--input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a --src_dir=/home/ubuntu/tflite/tensorflow --cache_dir=/home/ubuntu/tflite/bazel-build-cache'
+ BUILD_FLAGS=
+ TARGET_ARCHS=x86,x86_64,arm64-v8a,armeabi-v7a
+ FLAG_SRC_DIR=
+ '[' 4 -gt 5 ']'
+ for i in "$@"
+ case $i in
+ FLAG_MODELS=/home/ubuntu/tflite/models/model.tflite
+ BUILD_FLAGS=' --input_models=/home/ubuntu/tflite/models/model.tflite'
+ shift
+ for i in "$@"
+ case $i in
+ TARGET_ARCHS=x86,x86_64,arm64-v8a,armeabi-v7a
+ BUILD_FLAGS=' --input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a'
+ shift
+ for i in "$@"
+ case $i in
+ FLAG_SRC_DIR=/home/ubuntu/tflite/tensorflow
+ shift
+ for i in "$@"
+ case $i in
+ BAZEL_CACHE_DIR=/home/ubuntu/tflite/bazel-build-cache
+ shift
+ '[' '!' -d /tensorflow_src ']'
+ sdkmanager --licenses
6 of 6 SDK package licenses not accepted. 100% Computing updates...             
Review licenses that have not been accepted (y/N)? N

+ sdkmanager 'build-tools;31.0.0' platform-tools 'platforms;android-30'
License android-sdk-license:            ] 10% Computing updates...              
---------------------------------------
Terms and Conditions

This is the Android Software Development Kit License Agreement

1. Introduction

1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.

1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.

1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS).

1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.


2. Accepting the License Agreement

2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement.

2.2 By clicking to accept, you hereby agree to the terms of the License Agreement.

2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK.

2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.


4. SDK License from Google

3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android.

3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose.

3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.

3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK.

3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement.

3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.

3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.

3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.


6. Use of the SDK by You

4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.

4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).

4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.

4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.

4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.

4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.

7. Your Developer Credentials

5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.

8. Privacy and Information

6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.

6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.


9. Third Party Applications

7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.

7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.

7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.


10. Using Android APIs

8.1 Google Data APIs

8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.

8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so. If you use the Android Recognition Service API, documented at the following URL: https://developer.android.com/reference/android/speech/RecognitionService, as updated from time to time, you acknowledge that the use of the API is subject to the Data Processing Addendum for Products where Google is a Data Processor, which is located at the following URL: https://privacy.google.com/businesses/gdprprocessorterms/, as updated from time to time. By clicking to accept, you hereby agree to the terms of the Data Processing Addendum for Products where Google is a Data Processor.


11. Terminating the License Agreement

9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below.

9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.

9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.

9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.


12. DISCLAIMER OF WARRANTIES

10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.

10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.

10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.


13. LIMITATION OF LIABILITY

11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.


14. Indemnification

12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.


15. Changes to the License Agreement

13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.


16. General Legal Terms

14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.

14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.

14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable.

14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement.

14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.

14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party.

14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.


January 16, 2019
---------------------------------------
Accept? (y/N): y
[=======================================] 100% Unzipping... android-11/framework
+ cd /tensorflow_src
+ configs=('/usr/bin/python3' '/usr/lib/python3/dist-packages' 'N' 'N' 'Y' '/usr/lib/llvm-17/bin/clang' '-Wno-sign-compare -Wno-c++20-designator -Wno-gnu-inline-cpp-without-extern' 'y' '/android/sdk')
+ printf '%s\n' /usr/bin/python3 /usr/lib/python3/dist-packages N N Y /usr/lib/llvm-17/bin/clang '-Wno-sign-compare -Wno-c++20-designator -Wno-gnu-inline-cpp-without-extern' y /android/sdk
+ ./configure
You have bazel 6.5.0 installed.
Please specify the location of python. [Default is /usr/bin/python3]: 

Found possible Python library paths:
  /usr/lib/python3/dist-packages
  /usr/local/lib/python3.11/dist-packages
Please input the desired Python library path to use.  Default is [/usr/lib/python3/dist-packages]
Do you wish to build TensorFlow with ROCm support? [y/N]: No ROCm support will be enabled for TensorFlow.

Do you wish to build TensorFlow with CUDA support? [y/N]: No CUDA support will be enabled for TensorFlow.

Do you want to use Clang to build TensorFlow? [Y/n]: Clang will be used to compile TensorFlow.

Please specify the path to clang executable. [Default is /usr/lib/llvm-17/bin/clang]: 

You have Clang 17.0.6 installed.

Please specify optimization flags to use during compilation when bazel option "--config=opt" is specified [Default is -Wno-sign-compare]: 

Would you like to interactively configure ./WORKSPACE for Android builds? [y/N]: Searching for NDK and SDK installations.

Preconfigured Bazel build configs. You can use any of the below by adding "--config=<>" to your build command. See .bazelrc for more details.
	--config=mkl         	# Build with MKL support.
	--config=mkl_aarch64 	# Build with oneDNN and Compute Library for the Arm Architecture (ACL).
	--config=monolithic  	# Config for mostly static monolithic build.
	--config=numa        	# Build with NUMA support.
	--config=dynamic_kernels	# (Experimental) Build kernels into separate shared objects.
	--config=v1          	# Build with TensorFlow 1 API instead of TF 2 API.
Preconfigured Bazel build configs to DISABLE default on features:
	--config=nogcp       	# Disable GCP support.
	--config=nonccl      	# Disable NVIDIA NCCL support.
Configuration finished
+ source tensorflow/tools/ci_build/release/common.sh
++ LATEST_BAZEL_VERSION=6.5.0
++ MAC_CPU_MAX_WHL_SIZE=240M
++ WIN_CPU_MAX_WHL_SIZE=170M
++ WIN_GPU_MAX_WHL_SIZE=360M
+ install_bazelisk
+ date
Tue Jun 11 14:14:34 UTC 2024
+ case "$(uname -s)" in
++ uname -s
+ case "$(uname -m)" in
++ uname -m
+ local name=bazelisk-linux-amd64
+ mkdir -p /root/bin
+ wget --no-verbose -O /root/bin/bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64
2024-06-11 14:14:35 URL:https://objects.githubusercontent.com/github-production-release-asset-2e65be/149661467/ac07a1b6-24bb-4857-868a-4a1816401ade?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20240611%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240611T141434Z&X-Amz-Expires=300&X-Amz-Signature=bc61841b4193c4e31a6710e370097aef186bbef0875fb541c3dd7c71e3449069&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=149661467&response-content-disposition=attachment%3B%20filename%3Dbazelisk-linux-amd64&response-content-type=application%2Foctet-stream [5152768/5152768] -> "/root/bin/bazel" [1]
+ chmod u+x /root/bin/bazel
+ [[ ! :/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/android/sdk/cmdline-tools/latest/bin:/android/sdk/platform-tools:/android/ndk: =~ :/root/bin/?: ]]
+ PATH=/root/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/android/sdk/cmdline-tools/latest/bin:/android/sdk/platform-tools:/android/ndk
+ set_bazel_outdir
+ mkdir -p /tmpfs/bazel_output
+ export TEST_TMPDIR=/tmpfs/bazel_output
+ TEST_TMPDIR=/tmpfs/bazel_output
+ which bazel
/root/bin/bazel
+ bazel version
Bazelisk version: v1.11.0
$TEST_TMPDIR defined: output root default is '/tmpfs/bazel_output' and max_idle_secs default is '15'.
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
Build label: 6.5.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 23 16:44:21 2024 (1706028261)
Build timestamp: 1706028261
Build timestamp as int: 1706028261
+ date
Tue Jun 11 14:14:40 UTC 2024
+ export BAZEL_CACHE_DIR=/home/ubuntu/tflite/bazel-build-cache
+ BAZEL_CACHE_DIR=/home/ubuntu/tflite/bazel-build-cache
+ export OMIT_PRINTING_OUTPUT_PATHS=YES
+ OMIT_PRINTING_OUTPUT_PATHS=YES
+ '[' '' = true ']'
+ bash /tensorflow_src/tensorflow/lite/tools/build_aar.sh --input_models=/home/ubuntu/tflite/models/model.tflite --target_archs=x86,x86_64,arm64-v8a,armeabi-v7a
+++ dirname /tensorflow_src/tensorflow/lite/tools/build_aar.sh
++ cd /tensorflow_src/tensorflow/lite/tools
++ pwd
+ SCRIPT_DIR=/tensorflow_src/tensorflow/lite/tools
++ cd /tensorflow_src/tensorflow/lite/tools/../../../
++ pwd
+ ROOT_DIR=/tensorflow_src
+ TARGET_ARCHS=x86,x86_64,arm64-v8a,armeabi-v7a
+ '[' '!' -z /home/ubuntu/tflite/bazel-build-cache ']'
+ CACHE_DIR_FLAG=--output_user_root=/home/ubuntu/tflite/bazel-build-cache/cache
+ '[' 2 -gt 4 ']'
+ for i in "$@"
+ case $i in
+ FLAG_MODELS=/home/ubuntu/tflite/models/model.tflite
+ shift
+ for i in "$@"
+ case $i in
+ TARGET_ARCHS=x86,x86_64,arm64-v8a,armeabi-v7a
+ shift
+ cd /tensorflow_src
+ '[' '!' -f /tensorflow_src/.tf_configure.bazelrc ']'
+ grep -q ANDROID_SDK_HOME /tensorflow_src/.tf_configure.bazelrc
+ '[' -z /home/ubuntu/tflite/models/model.tflite ']'
+ TMP_DIR=/tensorflow_src/tmp/
+ rm -rf /tensorflow_src/tmp/
+ mkdir -p /tensorflow_src/tmp/
+ MODEL_NAMES=
++ echo /home/ubuntu/tflite/models/model.tflite
++ sed 's/,/ /g'
+ for model in $(echo ${FLAG_MODELS} | sed "s/,/ /g")
+ cp /home/ubuntu/tflite/models/model.tflite /tensorflow_src/tmp/
++ basename /home/ubuntu/tflite/models/model.tflite
+ MODEL_NAMES=,model.tflite
+ TFLITE_OPS_SRCS=
++ echo
++ sed 's/,/ /g'
+ generate_tflite_aar
+ pushd /tensorflow_src/tmp/
+ message=('load("//tensorflow/lite:build_def.bzl", "tflite_custom_android_library")' 'load("//tensorflow/lite/java:aar_with_jni.bzl", "aar_with_jni")' '' 'tflite_custom_android_library(' '    name = "custom_tensorflowlite",')
+ message+=('    '$(generate_list_field "models" $MODEL_NAMES))
++ generate_list_field models ,model.tflite
++ local name=models
++ local list_string=,model.tflite
++ list=('model.tflite')
++ local list
++ message=('models=[')
++ local message
++ for item in "${list[@]}"
++ message+=("\"$item\",")
++ message+=('],')
++ printf %s 'models=[' '"model.tflite",' '],'
+ message+=('    '$(generate_list_field "srcs" $TFLITE_OPS_SRCS))
++ generate_list_field srcs
++ local name=srcs
++ local list_string=
++ list=()
++ local list
++ message=('srcs=[')
++ local message
++ message+=('],')
++ printf %s 'srcs=[' '],'
+ message+=('    '$(generate_list_field "deps" $FLAG_TFLITE_OPS_DEPS))
++ generate_list_field deps
++ local name=deps
++ local list_string=
++ list=()
++ local list
++ message=('deps=[')
++ local message
++ message+=('],')
++ printf %s 'deps=[' '],'
+ message+=(')' '' 'aar_with_jni(' '    name = "tensorflow-lite",' '    android_library = ":custom_tensorflowlite",' ')' '')
+ printf '%s\n' 'load("//tensorflow/lite:build_def.bzl", "tflite_custom_android_library")' 'load("//tensorflow/lite/java:aar_with_jni.bzl", "aar_with_jni")' '' 'tflite_custom_android_library(' '    name = "custom_tensorflowlite",' '    models=["model.tflite",],' '    srcs=[],' '    deps=[],' ')' '' 'aar_with_jni(' '    name = "tensorflow-lite",' '    android_library = ":custom_tensorflowlite",' ')' ''
+ popd
+ bazel --output_user_root=/home/ubuntu/tflite/bazel-build-cache/cache build -c opt --config=opt --cxxopt=--std=c++17 --fat_apk_cpu=x86,x86_64,arm64-v8a,armeabi-v7a --define=android_dexmerger_tool=d8_dexmerger --define=android_incremental_dexing_tool=d8_dexbuilder --host_crosstool_top=@bazel_tools//tools/cpp:toolchain //tmp:tensorflow-lite
$TEST_TMPDIR defined: output root default is '/tmpfs/bazel_output' and max_idle_secs default is '15'.
Starting local Bazel server and connecting to it...
INFO: Reading 'startup' options from /tensorflow_src/.bazelrc: --windows_enable_symlinks
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=127
INFO: Reading rc options for 'build' from /tensorflow_src/.bazelrc:
  Inherited 'common' options: --experimental_repo_remote_exec
INFO: Reading rc options for 'build' from /etc/bazel.bazelrc:
  'build' options: --action_env=DOCKER_CACHEBUSTER=1717892676285195056 --host_action_env=DOCKER_HOST_CACHEBUSTER=1717892676351672658
INFO: Reading rc options for 'build' from /tensorflow_src/.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 --features=-force_no_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 /tensorflow_src/.tf_configure.bazelrc:
  'build' options: --action_env PYTHON_BIN_PATH=/usr/bin/python3 --action_env PYTHON_LIB_PATH=/usr/lib/python3/dist-packages --python_path=/usr/bin/python3 --action_env CLANG_COMPILER_PATH=/usr/lib/llvm-17/bin/clang --repo_env=CC=/usr/lib/llvm-17/bin/clang --repo_env=BAZEL_COMPILER=/usr/lib/llvm-17/bin/clang --copt=-Wno-gnu-offsetof-extensions --action_env ANDROID_NDK_HOME=/android/ndk --action_env ANDROID_NDK_VERSION=25 --action_env ANDROID_NDK_API_LEVEL=30 --action_env ANDROID_BUILD_TOOLS_VERSION=31.0.0 --action_env ANDROID_SDK_API_LEVEL=30 --action_env ANDROID_SDK_HOME=/android/sdk
INFO: Found applicable config definition build:short_logs in file /tensorflow_src/.bazelrc: --output_filter=DONT_MATCH_ANYTHING
INFO: Found applicable config definition build:v2 in file /tensorflow_src/.bazelrc: --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
INFO: Found applicable config definition build:opt in file /tensorflow_src/.tf_configure.bazelrc: --copt=-Wno-sign-compare --host_copt=-Wno-sign-compare --copt=-Wno-c++20-designator --host_copt=-Wno-c++20-designator --copt=-Wno-gnu-inline-cpp-without-extern --host_copt=-Wno-gnu-inline-cpp-without-extern
INFO: Found applicable config definition build:linux in file /tensorflow_src/.bazelrc: --host_copt=-w --copt=-Wno-all --copt=-Wno-extra --copt=-Wno-deprecated --copt=-Wno-deprecated-declarations --copt=-Wno-ignored-attributes --copt=-Wno-array-bounds --copt=-Wunused-result --copt=-Werror=unused-result --copt=-Wswitch --copt=-Werror=switch --copt=-Wno-error=unused-but-set-variable --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 --config=dynamic_kernels --experimental_guard_against_concurrent_changes
INFO: Found applicable config definition build:dynamic_kernels in file /tensorflow_src/.bazelrc: --define=dynamic_loaded_kernels=true --copt=-DAUTOLOAD_DYNAMIC_KERNELS
INFO: Analyzed target //tmp:tensorflow-lite (160 packages loaded, 15854 targets configured).
INFO: Found 1 target...
ERROR: /tensorflow_src/tmp/BUILD:4:30: gen_selected_ops failed: (Segmentation fault): generate_op_registrations failed: error executing command (from target //tmp:custom_tensorflowlite_cc_registration) bazel-out/k8-opt-exec-50AE0418/bin/tensorflow/lite/tools/generate_op_registrations '--namespace=' ... (remaining 3 arguments skipped)
Target //tmp:tensorflow-lite failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 20.698s, Critical Path: 0.75s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
```
