homuler / MediaPipeUnityPlugin

Unity plugin to run MediaPipe
MIT License
1.79k stars 466 forks source link

'@local_config_cc//:toolchain' does not contain a toolchain for cpu 'ios_arm64' #350

Closed Longgood-Anny closed 2 years ago

Longgood-Anny commented 2 years ago

System information

Describe the problem I can build the desktop cpu but when I'm going to build ios arm64, I got an error.

Steps to reproduce the issue cd Downloads/MediaPipeUnityPlugin-master python3 build.py build --ios arm64

Full logs

anny@AnnydeMacBook-Pro MediaPipeUnityPlugin-master % python3 build.py build --ios arm64
INFO (build.py): Building protobuf sources...
DEBUG (build.py): Running `bazel build -c opt //mediapipe_api:mediapipe_proto_srcs`
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'rules_python' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/tf_runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software.
INFO: Build option --copt has changed, discarding analysis cache.
INFO: Analyzed target //mediapipe_api:mediapipe_proto_srcs (0 packages loaded, 683 targets configured).
INFO: Found 1 target...
Target //mediapipe_api:mediapipe_proto_srcs up-to-date:
  bazel-bin/mediapipe_api/mediapipe_proto_srcs.zip
INFO: Elapsed time: 0.448s, Critical Path: 0.02s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
DEBUG (build.py): Unarchiving 'bazel-bin/mediapipe_api/mediapipe_proto_srcs.zip' to 'build/Scripts/Protobuf'...
INFO (build.py): Built protobuf sources
INFO (build.py): Downloading dlls...
DEBUG (build.py): Running `nuget install -o .nuget -Source https://api.nuget.org/v3/index.json`
Feeds used:
  /Users/anny/.nuget/packages/
  https://api.nuget.org/v3/index.json

/Users/anny/Downloads/MediaPipeUnityPlugin-master/packages.config 中列出的所有封裝均已安裝。
DEBUG (build.py): Copying '.nuget/System.Buffers.4.4.0/lib/netstandard2.0/System.Buffers.dll' to 'build/Plugins/Protobuf/System.Buffers.dll'...
DEBUG (build.py): Changing the mode of 'build/Plugins/Protobuf/System.Buffers.dll'...
DEBUG (build.py): Copying '.nuget/Google.Protobuf.3.15.6/lib/netstandard2.0/Google.Protobuf.dll' to 'build/Plugins/Protobuf/Google.Protobuf.dll'...
DEBUG (build.py): Changing the mode of 'build/Plugins/Protobuf/Google.Protobuf.dll'...
DEBUG (build.py): Copying '.nuget/System.Runtime.CompilerServices.Unsafe.4.5.2/lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll' to 'build/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll'...
DEBUG (build.py): Changing the mode of 'build/Plugins/Protobuf/System.Runtime.CompilerServices.Unsafe.dll'...
DEBUG (build.py): Copying '.nuget/System.Memory.4.5.3/lib/netstandard2.0/System.Memory.dll' to 'build/Plugins/Protobuf/System.Memory.dll'...
DEBUG (build.py): Changing the mode of 'build/Plugins/Protobuf/System.Memory.dll'...
INFO (build.py): Downloaded protobuf dlls
INFO (build.py): Building resource files
DEBUG (build.py): Running `bazel build -c opt //mediapipe_api:mediapipe_assets`
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'rules_python' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/tf_runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software.
INFO: Analyzed target //mediapipe_api:mediapipe_assets (0 packages loaded, 26 targets configured).
INFO: Found 1 target...
Target //mediapipe_api:mediapipe_assets up-to-date:
  bazel-bin/mediapipe_api/mediapipe_assets.zip
INFO: Elapsed time: 0.490s, Critical Path: 0.07s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
DEBUG (build.py): Unarchiving 'bazel-bin/mediapipe_api/mediapipe_assets.zip' to 'build/Resources'...
DEBUG (build.py): Unarchiving 'bazel-bin/mediapipe_api/mediapipe_assets.zip' to 'Assets/StreamingAssets'...
INFO (build.py): Built resource files
INFO (build.py): Building native libaries for iOS...
DEBUG (build.py): Running `bazel build -c opt --config=ios_arm64 --copt=-fembed-bitcode --apple_bitcode=embedded //mediapipe_api/objc:MediaPipeUnity`
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_absl' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_protobuf' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_google_googletest' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'com_github_gflags_gflags' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'rules_python' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_rules_apple' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_rules_swift' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'build_bazel_apple_support' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'bazel_skylib' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/org_tensorflow/third_party/repo.bzl:108:14: 
Warning: skipping import of repository 'pybind11' because it already exists.
DEBUG: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/tf_runtime/third_party/cuda/dependencies.bzl:51:10: The following command will download NVIDIA proprietary software. By using the software you agree to comply with the terms of the license agreement that accompanies the software. If you do not agree to the terms of the license agreement, do not use the software.
INFO: Build options --apple_bitcode, --apple_platform_type, --copt, and 2 more have changed, discarding analysis cache.
ERROR: /private/var/tmp/_bazel_anny/b184a625afb252456503f47e3bf9f280/external/local_config_cc/BUILD:48:19: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'ios_arm64'
ERROR: Analysis of target '//mediapipe_api/objc:MediaPipeUnity' failed; build aborted: Analysis of target '@local_config_cc//:toolchain' failed
INFO: Elapsed time: 0.426s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (13 packages loaded, 182 targets \
configured)
Traceback (most recent call last):
  File "/Users/anny/Downloads/MediaPipeUnityPlugin-master/build.py", line 443, in <module>
    Argument().command().run()
  File "/Users/anny/Downloads/MediaPipeUnityPlugin-master/build.py", line 168, in run
    self._run_command(self._build_ios_commands())
  File "/Users/anny/Downloads/MediaPipeUnityPlugin-master/build.py", line 52, in _run_command
    return subprocess.run(' '.join(command_list), check=True, shell=shell)
  File "/usr/local/Cellar/python@3.9/3.9.7_1/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 528, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'bazel build -c opt --config=ios_arm64 --copt=-fembed-bitcode --apple_bitcode=embedded //mediapipe_api/objc:MediaPipeUnity' returned non-zero exit status 1.

Additional context 截圖 2021-11-11 上午9 39 54

homuler commented 2 years ago

Have you run xcode-select --install?

Longgood-Anny commented 2 years ago

Yes, I have already run. If I run again, it will be like this.

anny@AnnydeMacBook-Pro ~ % xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
homuler commented 2 years ago

Can you tell me the result of running xcode-select -p?

Longgood-Anny commented 2 years ago

Yes, there is the result.

anny@AnnydeMacBook-Pro ~ % xcode-select -p
/Library/Developer/CommandLineTools
homuler commented 2 years ago

Does changing the path as follows change the result? (If the path to Xcode is different, please change it to suit your environment)

sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

python3 build.py clean
python3 build.py build --ios arm64 -vvv
Longgood-Anny commented 2 years ago

OH!!!!! YES!!!!! IT WORKS~ ヽ( ★ω★)ノ THANK YOU EVERY MUCH!!! m( )m