google-ai-edge / mediapipe

Cross-platform, customizable ML solutions for live and streaming media.
https://ai.google.dev/edge/mediapipe
Apache License 2.0
27.72k stars 5.18k forks source link

iOS compiling error, cc_wrapper.sh failed: error executing command #4296

Closed github-liuxu closed 1 year ago

github-liuxu commented 1 year ago

There is an error in compiling posetrackinggpu for iOS, I don’t know how to change it, please help

mac-mini@liudongxudeMac-Mini mediapipe % bazel build -c opt --config=ios_arm64 //mediapipe/examples/ios/posetrackinggpu:posetrackinggpu WARNING: Ignoring JAVA_HOME, because it must point to a JDK, not a JRE. WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/llvm/llvm-project/archive/e510d0bda0876c4baa3a270dca39b95da7ec6d9e.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from http://mirror.tensorflow.org/github.com/bazelbuild/rules_closure/archive/cf1e44edb908e9616030cc83d085989b8e6cd6df.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/tensorflow/runtime/archive/9084a21c1fb3a8eb411a7ed010ec1e9fcaa01b01.tar.gz failed: class java.io.FileNotFoundException GET returned 404 Not Found WARNING: /Users/mac-mini/Downloads/mediapipe/mediapipe/framework/BUILD:54:24: in cc_library rule //mediapipe/framework:calculator_cc_proto: target '//mediapipe/framework:calculator_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use. WARNING: /Users/mac-mini/Downloads/mediapipe/mediapipe/framework/tool/BUILD:197:24: in cc_library rule //mediapipe/framework/tool:field_data_cc_proto: target '//mediapipe/framework/tool:field_data_cc_proto' depends on deprecated target '@com_google_protobuf//:cc_wkt_protos': Only for backward compatibility. Do not use. WARNING: Download from https://storage.googleapis.com/mirror.tensorflow.org/github.com/google/XNNPACK/archive/5eff7fb0cf49215d9f68646512797a2258aa00cc.zip failed: class java.io.FileNotFoundException GET returned 404 Not Found INFO: Analyzed target //mediapipe/examples/ios/posetrackinggpu:posetrackinggpu (0 packages loaded, 0 targets configured). INFO: Found 1 target... ERROR: /Users/mac-mini/Downloads/mediapipe/mediapipe/modules/pose_landmark/BUILD:85:26: Linking mediapipe/modules/pose_landmark/pose_landmarks_and_segmentation_inverse_projection_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/modules/pose_landmark:pose_landmarks_and_segmentation_inverse_projection_graph_text_to_binary_graph) external/local_config_cc/cc_wrapper.sh ... (remaining 1 argument skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging stderr (/private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/execroot/mediapipe/bazel-out/_tmp/actions/stderr-45) 1523788 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping Target //mediapipe/examples/ios/posetrackinggpu:PoseTrackingGpuApp failed to build Use --verbose_failures to see the command lines of failed build steps. INFO: Elapsed time: 3.495s, Critical Path: 2.45s INFO: 159 processes: 132 internal, 26 darwin-sandbox, 1 local. FAILED: Build did NOT complete successfully

BTLDXX-x commented 1 year ago

hi @github-liuxu , have you solved it ? i met the same problem in the latest version

lyqaiym commented 1 year ago

I met the same problem in android https://github.com/google/mediapipe/issues/4294

BTLDXX-x commented 1 year ago

https://github.com/google/mediapipe/issues/4296#issuecomment-1514299247 i can build the framework with last version successfully, but it failed with the new version.

github-liuxu commented 1 year ago

i didn't solve it

github-liuxu commented 1 year ago

https://github.com/google/mediapipe/issues/4296#issuecomment-1514393732 Can you tell me which version can be compiled?

BTLDXX-x commented 1 year ago

hi @github-liuxu , i used v0.9.2 before

github-liuxu commented 1 year ago

@BTLDXX-x how did you solve this Repository rule http_archive defined at: /private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in ERROR: /private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/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: /private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/external/local_config_cc/BUILD:48:19: Analysis of target '@local_config_cc//:toolchain' failed ERROR: Analysis of target '//mediapipe/examples/ios/posetrackinggpu:posetrackinggpu' failed; build aborted: INFO: Elapsed time: 211.001s INFO: 0 processes. FAILED: Build did NOT complete successfully (66 packages loaded, 485 targets configured)

ayushgdev commented 1 year ago

@github-liuxu Try installing Xcode command line tools. The error could mean that Bazel can't find an appropriate c++ compiler on your mac. Also, please do bazel clean --expunge to make sure you have a clean start.

BTLDXX-x commented 1 year ago

@github-liuxu, i didn't meet this problem

@BTLDXX-x how did you solve this Repository rule http_archive defined at: /private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/external/bazel_tools/tools/build_defs/repo/http.bzl:353:31: in ERROR: /private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/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: /private/var/tmp/_bazel_mac-mini/be217cfa49df986da4cb345b2b513dd5/external/local_config_cc/BUILD:48:19: Analysis of target '@local_config_cc//:toolchain' failed ERROR: Analysis of target '//mediapipe/examples/ios/posetrackinggpu:posetrackinggpu' failed; build aborted: INFO: Elapsed time: 211.001s INFO: 0 processes. FAILED: Build did NOT complete successfully (66 packages loaded, 485 targets configured)

BTLDXX-x commented 1 year ago

hi @ayushgdev, i did bazel clean --expunge, but still had this issue

BTLDXX-x commented 1 year ago
  1. run this:
bazel build -c opt --strip=ALWAYS --host_crosstool_top=@bazel_tools//tools/cpp:toolchain --fat_apk_cpu=arm64-v8a,armeabi-v7a --legacy_whole_archive=0 --features=-legacy_whole_archive --copt=-fvisibility=hidden --copt=-ffunction-sections --copt=-fdata-sections --copt=-fstack-protector --copt=-Oz --copt=-fomit-frame-pointer --copt=-DABSL_MIN_LOG_LEVEL=2 --linkopt=-Wl,--gc-sections,--strip-all --config=android_arm64 //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facesmoothaar:mediapipe_face_mesh_smooth.aar --define MEDIAPIPE_DISABLE_GPU=false --define BUILD_SKIMAGE=false --define ENABLE_CV_IMGCODECS_INTERFACE=false --define ENABLE_CV_IMGPROC_INTERFACE=false --define IMAGE_INTERFACES=true --sandbox_debug

logs:

ERROR: /Users/apple/MPProject/mediapipe/mediapipe/modules/face_landmark/BUILD:185:26: Linking mediapipe/modules/face_landmark/tensors_to_face_landmarks_with_attention_graph_text_to_binary_graph [for tool] failed: (Exit 1): sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2512/execroot/mediapipe && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=13.3 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    PATH='/Users/apple/Library/Caches/bazelisk/downloads/https---github-com-bazelbuild-bazel-releases-download/bazel-6.1.2-darwin-x86_64/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/jre/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/usr/local/bin:/Users/apple/.rvm/gems/ruby-3.0.0/bin:/Users/apple/.rvm/gems/ruby-3.0.0@global/bin:/Users/apple/.rvm/rubies/ruby-3.0.0/bin:./usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin:/Users/apple/.rvm/bin:/Users/apple/Library/Android/sdk/ndk/23.1.7779620/:/Users/apple/Library/Andoird/sdk:/Users/apple/Library/Android/sdk/tools:/Users/apple/Library/Android/sdk/platform-tools:/usr/local/bin/' \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk \
    TMPDIR=/var/folders/0b/nkvml0gn615cp33lqg_ftpk40000gn/T/ \
    XCODE_VERSION_OVERRIDE=14.3.0.14E222b \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2512/sandbox.sb /var/tmp/_bazel_apple/install/a904e67a8a10223abf54b32deb428f7d/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2512/stats.out' external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/face_landmark/tensors_to_face_landmarks_with_attention_graph_text_to_binary_graph-2.params)
stderr (/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/execroot/mediapipe/bazel-out/_tmp/actions/stderr-267) 1460956 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
ERROR: /Users/apple/MPProject/mediapipe/mediapipe/modules/face_landmark/BUILD:143:26: Linking mediapipe/modules/face_landmark/face_detection_front_detection_to_roi_graph_text_to_binary_graph [for tool] failed: (Exit 1): sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2518/execroot/mediapipe && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=13.3 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    PATH='/Users/apple/Library/Caches/bazelisk/downloads/https---github-com-bazelbuild-bazel-releases-download/bazel-6.1.2-darwin-x86_64/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/jre/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/usr/local/bin:/Users/apple/.rvm/gems/ruby-3.0.0/bin:/Users/apple/.rvm/gems/ruby-3.0.0@global/bin:/Users/apple/.rvm/rubies/ruby-3.0.0/bin:./usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin:/Users/apple/.rvm/bin:/Users/apple/Library/Android/sdk/ndk/23.1.7779620/:/Users/apple/Library/Andoird/sdk:/Users/apple/Library/Android/sdk/tools:/Users/apple/Library/Android/sdk/platform-tools:/usr/local/bin/' \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk \
    TMPDIR=/var/folders/0b/nkvml0gn615cp33lqg_ftpk40000gn/T/ \
    XCODE_VERSION_OVERRIDE=14.3.0.14E222b \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2518/sandbox.sb /var/tmp/_bazel_apple/install/a904e67a8a10223abf54b32deb428f7d/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2518/stats.out' external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/face_landmark/face_detection_front_detection_to_roi_graph_text_to_binary_graph-2.params)
stderr (/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/execroot/mediapipe/bazel-out/_tmp/actions/stderr-275) 1460956 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
ERROR: /Users/apple/MPProject/mediapipe/mediapipe/modules/face_landmark/BUILD:164:26: Linking mediapipe/modules/face_landmark/face_landmarks_model_loader_graph_text_to_binary_graph [for tool] failed: (Exit 1): sandbox-exec failed: error executing command 
  (cd /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2509/execroot/mediapipe && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=13.3 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    PATH='/Users/apple/Library/Caches/bazelisk/downloads/https---github-com-bazelbuild-bazel-releases-download/bazel-6.1.2-darwin-x86_64/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/jre/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/usr/local/bin:/Users/apple/.rvm/gems/ruby-3.0.0/bin:/Users/apple/.rvm/gems/ruby-3.0.0@global/bin:/Users/apple/.rvm/rubies/ruby-3.0.0/bin:./usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin:/Users/apple/.rvm/bin:/Users/apple/Library/Android/sdk/ndk/23.1.7779620/:/Users/apple/Library/Andoird/sdk:/Users/apple/Library/Android/sdk/tools:/Users/apple/Library/Android/sdk/platform-tools:/usr/local/bin/' \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk \
    TMPDIR=/var/folders/0b/nkvml0gn615cp33lqg_ftpk40000gn/T/ \
    XCODE_VERSION_OVERRIDE=14.3.0.14E222b \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2509/sandbox.sb /var/tmp/_bazel_apple/install/a904e67a8a10223abf54b32deb428f7d/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2509/stats.out' external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/face_landmark/face_landmarks_model_loader_graph_text_to_binary_graph-2.params)
stderr (/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/execroot/mediapipe/bazel-out/_tmp/actions/stderr-264) 1460956 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
Target //mediapipe/examples/android/src/java/com/google/mediapipe/apps/facesmoothaar:mediapipe_face_mesh_smooth.aar failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 61.241s, Critical Path: 55.20s
INFO: 280 processes: 139 internal, 141 darwin-sandbox.
FAILED: Build did NOT complete successfully
  1. i run this:
cd /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2518/execroot/mediapipe && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=13.3 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    PATH='/Users/apple/Library/Caches/bazelisk/downloads/https---github-com-bazelbuild-bazel-releases-download/bazel-6.1.2-darwin-x86_64/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/jre/bin:/Library/Java/JavaVirtualMachines/jdk-11.0.17.jdk/Contents/Home/bin:/usr/local/bin:/Users/apple/.rvm/gems/ruby-3.0.0/bin:/Users/apple/.rvm/gems/ruby-3.0.0@global/bin:/Users/apple/.rvm/rubies/ruby-3.0.0/bin:./usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/bin:/Users/apple/.rvm/bin:/Users/apple/Library/Android/sdk/ndk/23.1.7779620/:/Users/apple/Library/Andoird/sdk:/Users/apple/Library/Android/sdk/tools:/Users/apple/Library/Android/sdk/platform-tools:/usr/local/bin/' \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk \
    TMPDIR=/var/folders/0b/nkvml0gn615cp33lqg_ftpk40000gn/T/ \
    XCODE_VERSION_OVERRIDE=14.3.0.14E222b \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2518/sandbox.sb /var/tmp/_bazel_apple/install/a904e67a8a10223abf54b32deb428f7d/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_apple/8bcb6d1f4c989e1d81eae00d06962091/sandbox/darwin-sandbox/2518/stats.out' external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418/bin/mediapipe/modules/face_landmark/face_detection_front_detection_to_roi_graph_text_to_binary_graph-2.params

logs:

......
duplicate symbol 'google::protobuf::Int64Value::_class_data_' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/external/com_google_protobuf/libprotobuf.lo(wrappers.pb.o)
    bazel-out/darwin-opt-exec-50AE0418/bin/external/com_google_protobuf/libprotobuf.lo(wrappers.pb.o)
duplicate symbol 'google::protobuf::UInt32Value::_class_data_' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/external/com_google_protobuf/libprotobuf.lo(wrappers.pb.o)
    bazel-out/darwin-opt-exec-50AE0418/bin/external/com_google_protobuf/libprotobuf.lo(wrappers.pb.o)
duplicate symbol 'google::protobuf::Int32Value::_class_data_' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-cfb676c6944e/bin/external/com_google_protobuf/libprotobuf.lo(wrappers.pb.o)
    bazel-out/darwin-opt-exec-50AE0418/bin/external/com_google_protobuf/libprotobuf.lo(wrappers.pb.o)
ld: 3927 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in child process '/usr/bin/xcrun'. 1

what should i do then?

richardgetz commented 1 year ago

@BTLDXX-x any luck getting past your latest error? I'm facing the same issue.

yurihan commented 1 year ago

I'm facing the same issue...

/Users/yurihan/Workspace/mediapipe/mediapipe/modules/face_landmark/BUILD:143:26: Linking mediapipe/modules/face_landmark/face_detection_front_detection_to_roi_graph_text_to_binary_graph [for tool] failed: (Exit 1): sandbox-exec failed: error executing command
  (cd /private/var/tmp/_bazel_yurihan/7f6af1b7aa3d9cc0689c6d2cf039689c/sandbox/darwin-sandbox/2639/execroot/mediapipe && \
  exec env - \
    APPLE_SDK_PLATFORM=MacOSX \
    APPLE_SDK_VERSION_OVERRIDE=13.3 \
    DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
    PATH=/Users/yurihan/Library/Caches/bazelisk/downloads/bazelbuild/bazel-6.1.1-darwin-x86_64/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin \
    SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk \
    TMPDIR=/var/folders/s9/lprhkn195mq8223bc7527q640000gn/T/ \
    XCODE_VERSION_OVERRIDE=14.3.0.14E222b \
    ZERO_AR_DATE=1 \
  /usr/bin/sandbox-exec -f /private/var/tmp/_bazel_yurihan/7f6af1b7aa3d9cc0689c6d2cf039689c/sandbox/darwin-sandbox/2639/sandbox.sb /var/tmp/_bazel_yurihan/install/f822566ff435ccaad75bcfd3b2719b0b/process-wrapper '--timeout=0' '--kill_delay=15' '--stats=/private/var/tmp/_bazel_yurihan/7f6af1b7aa3d9cc0689c6d2cf039689c/sandbox/darwin-sandbox/2639/stats.out' external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/mediapipe/modules/face_landmark/face_detection_front_detection_to_roi_graph_text_to_binary_graph-2.params)
stderr (/private/var/tmp/_bazel_yurihan/7f6af1b7aa3d9cc0689c6d2cf039689c/execroot/mediapipe/bazel-out/_tmp/actions/stderr-3) 1523255 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping
Target //mediapipe/examples/ios/facemeshioslib:FaceMeshIOSLibFramework failed to build
Use --verbose_failures to see the command lines of failed build steps.
.....
duplicate symbol 'google::protobuf::internal::WireFormatLite::ReadPackedEnumPreserveUnknowns(google::protobuf::io::CodedInputStream*, int, bool (*)(int), google::protobuf::io::CodedOutputStream*, google::protobuf::RepeatedField<int>*)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-4bc063e00339/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::EnumSize(google::protobuf::RepeatedField<int> const&)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-4bc063e00339/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::SInt32Size(google::protobuf::RepeatedField<int> const&)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-4bc063e00339/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::Int32Size(google::protobuf::RepeatedField<int> const&)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-4bc063e00339/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>**)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-4bc063e00339/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
duplicate symbol 'google::protobuf::internal::WireFormatLite::ReadBytes(google::protobuf::io::CodedInputStream*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>*)' in:
    bazel-out/applebin_macos-darwin_x86_64-opt-exec-50AE0418-ST-4bc063e00339/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
    bazel-out/darwin-opt-exec-50AE0418-ST-9facee45ddd0/bin/external/com_google_protobuf/libprotobuf_lite.lo(wire_format_lite.o)
ld: 3927 duplicate symbols for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in child process '/usr/bin/xcrun'. 1
lyqaiym commented 1 year ago

https://github.com/bazelbuild/bazel src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java the line 89,new version ExecutionTransitionFactory.create(),old version HostTransition.createFactory(). old is ok. ExecutionTransitionFactory.java change coreOptions.isHost = true; bazel-bin/src/bazel-dev

shukob commented 1 year ago

Same here. Tried different bazel versions but didn't help. Are there any workaround?

fengyun21 commented 1 year ago

https://github.com/bazelbuild/bazel src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java the line 89,new version ExecutionTransitionFactory.create(),old version HostTransition.createFactory(). old is ok. ExecutionTransitionFactory.java change coreOptions.isHost = true; bazel-bin/src/bazel-dev

so did you compile ok with mediapipe of 0.9.3 or 0.10.0?

lyqaiym commented 1 year ago

https://github.com/bazelbuild/bazel src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java the line 89,new version ExecutionTransitionFactory.create(),old version HostTransition.createFactory(). old is ok. ExecutionTransitionFactory.java change coreOptions.isHost = true; bazel-bin/src/bazel-dev

so did you compile ok with mediapipe of 0.9.3 or 0.10.0?

v0.9.3.0,v0.10.0 and master , Build completed successfully

BTLDXX-x commented 1 year ago

https://github.com/bazelbuild/bazel src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java the line 89,new version ExecutionTransitionFactory.create(),old version HostTransition.createFactory(). old is ok. ExecutionTransitionFactory.java change coreOptions.isHost = true; bazel-bin/src/bazel-dev

Did you mean that change coreOptions.isHost = true; in ExecutionTransitionFactory.java? Where is bazel-bin/src/bazel-dev?

lyqaiym commented 1 year ago

https://github.com/bazelbuild/bazel src/main/java/com/google/devtools/build/lib/rules/genrule/GenRuleBaseRule.java the line 89,new version ExecutionTransitionFactory.create(),old version HostTransition.createFactory(). old is ok. ExecutionTransitionFactory.java change coreOptions.isHost = true; bazel-bin/src/bazel-dev

Did you mean that change coreOptions.isHost = true; in ExecutionTransitionFactory.java? Where is bazel-bin/src/bazel-dev? yes. git clone https://github.com/bazelbuild/bazel.git run bazel build //src:bazel-dev v0.9.3.0,v0.10.0 and master , Build completed successfully

shukob commented 1 year ago

From what I have tried, Xcode 14.2 + bazel 5.2.0 + mediapipe 0.9.1 was working combination. I think 0.9.2.1 will also work from what others mentioned. I suspect Xcode 14.3 have broken the build environment.

fengyun21 commented 1 year ago

From what I have tried, Xcode 14.2 + bazel 5.2.0 + mediapipe 0.9.1 was working combination. I think 0.9.2.1 will also work from what others mentioned. I suspect Xcode 14.3 have broken the build environment.

did you try mediapipe 0.9.3 or 0.10.1?

shukob commented 1 year ago

@fengyun21 Tried now but did not work.

shukob commented 1 year ago

Based on @lyqaiym 's solution, 0.10.0 was able to be built. The concrete steps are

  1. Clone bazel and checkout 6.1.1 tag.
  2. Edit ExecutionTransitionFactory.java line 129 to make it coreOptions.isHost = true;.
  3. Build bazel by bazelisk build //src:bazel-dev (if you use bazelisk).
  4. Use built bazel (located at bazel-bin/src/bazel-dev) to compile mediapipe 0.10.0.
geeker-smallwhite commented 1 year ago

bazelisk need download Specify the version of bazel in .bazeliskrc, maybe bazel's server change, now cached, so command is not use. this is my reason.

artemsokol98 commented 1 year ago

Hello, faced with the same issue, when build examples for iOS. Mediapipe v0.10.1. Xcode 14.2. I tried it on Intel iMac 2020 and on M1 Mac mini.
Command to produce: bazel build mediapipe/examples/ios/facedetectioncpu:FaceDetectionCpuApp --verbose_failures --copt=-fembed-bitcode --apple_bitcode=embedded

Logs for Mac mini M1: `ERROR: /Users/timuribragimov/mediapipev0.10.1/mediapipe/mediapipe/graphs/face_detection/BUILD:56:23: Linking mediapipe/graphs/face_detection/face_detection_mobile_cpu_binary_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/graphs/face_detection:face_detection_mobile_cpu_binary_graph_text_to_binary_graph) (cd /private/var/tmp/_bazel_timuribragimov/fedbca33a62f845c3a501d6b33f83488/sandbox/darwin-sandbox/1641/execroot/mediapipe && \ exec env - \ APPLE_SDK_PLATFORM=MacOSX \ APPLE_SDK_VERSION_OVERRIDE=13.1 \ PATH=/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.8/bin:/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin \ XCODE_VERSION_OVERRIDE=14.2.0.14C18 \ ZERO_AR_DATE=1 \ external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418-ST-0d1fe7b00ffe/bin/mediapipe/graphs/face_detection/face_detection_mobile_cpu_binary_graph_text_to_binary_graph-2.params) Configuration: e9670154d5af08fa52d86e0762a1381506511f62455c5fc774c6bd94d6701f1f Execution platform: @local_execution_config_platform//:platform

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging stderr (/private/var/tmp/_bazel_timuribragimov/fedbca33a62f845c3a501d6b33f83488/execroot/mediapipe/bazel-out/_tmp/actions/stderr-724) 1953000 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping Target //mediapipe/examples/ios/facedetectioncpu:FaceDetectionCpuApp failed to build INFO: Elapsed time: 74.324s, Critical Path: 67.76s INFO: 500 processes: 80 internal, 420 darwin-sandbox. FAILED: Build did NOT complete successfully`

Logs for Intel iMac 2020: `ERROR: /Users/artemsokolovskiy/mediapipe0.10.1/mediapipe/mediapipe/graphs/face_detection/BUILD:56:23: Linking mediapipe/graphs/face_detection/face_detection_mobile_cpu_binary_graph_text_to_binary_graph [for tool] failed: (Exit 1): cc_wrapper.sh failed: error executing command (from target //mediapipe/graphs/face_detection:face_detection_mobile_cpu_binary_graph_text_to_binary_graph) (cd /private/var/tmp/_bazel_artemsokolovskiy/8ec7566841d7814b73c1b8ae8937638c/sandbox/darwin-sandbox/1944/execroot/mediapipe && \ exec env - \ APPLE_SDK_PLATFORM=MacOSX \ APPLE_SDK_VERSION_OVERRIDE=13.1 \ PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin \ XCODE_VERSION_OVERRIDE=14.2.0.14C18 \ ZERO_AR_DATE=1 \ external/local_config_cc/cc_wrapper.sh @bazel-out/darwin-opt-exec-50AE0418-ST-0d1fe7b00ffe/bin/mediapipe/graphs/face_detection/face_detection_mobile_cpu_binary_graph_text_to_binary_graph-2.params) Configuration: e9670154d5af08fa52d86e0762a1381506511f62455c5fc774c6bd94d6701f1f Execution platform: @local_execution_config_platform//:platform

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging stderr (/private/var/tmp/_bazel_artemsokolovskiy/8ec7566841d7814b73c1b8ae8937638c/execroot/mediapipe/bazel-out/_tmp/actions/stderr-326) 1953000 exceeds maximum size of --experimental_ui_max_stdouterr_bytes=1048576 bytes; skipping Target //mediapipe/examples/ios/facedetectioncpu:FaceDetectionCpuApp failed to build INFO: Elapsed time: 12.650s, Critical Path: 12.39s INFO: 200 processes: 3 internal, 197 darwin-sandbox. FAILED: Build did NOT complete successfully`

kuaashish commented 1 year ago

@github-liuxu,

Could you please confirm that you are still looking for the resolution or the issue has been resolved from your end?

Thank you!!!

github-actions[bot] commented 1 year ago

This issue has been marked stale because it has no recent activity since 7 days. It will be closed if no further activity occurs. Thank you.

github-actions[bot] commented 1 year ago

This issue was closed due to lack of activity after being marked stale for past 7 days.

google-ml-butler[bot] commented 1 year ago

Are you satisfied with the resolution of your issue? Yes No

Evizero commented 1 year ago

This is still very much an open issue.

I have not tried the coreOptions.isHost = true workaround (yet), but as bazel 6.3.2 still has that line in there i think the heart of the issue must be something else?

I have been dissecting this issue for days now. While i have managed to build the new mediapipe tasks libraries for ios (and thought i made progress), i later realised that they avoid .proto graphs altogether by defining their graphs in cc files.

The core of the issue is with mediapipe_binary_graph where the intermediate proto parser binary (somename_graph_text_to_binary_graph) that it generates, somehow now has this duplicated symbol issue in its linking stage. so its less about the target platform iOS and more about the tool platform macos where it need to built this temporary tool. I suppose the error message tells you this to begin with, but it took me a long time to understand this

I honestly don't know whats going on, except that if you get rid of any proto graph dependency then all goes fine. This whole thing started with and Xcode update, which seems to have caused a number of issues all around different github repos for different reasons. None of their fixes helped me however.

chanwooleeme commented 1 year ago

@Evizero, I wanted to express my gratitude for your contribution. After cloning and building with your modified bazel code, the graph linking issue has been resolved!

For reference, my development environment is:

I hope your issues get resolved as well. Thank you again!

didier-wg2 commented 1 year ago

I had this issue after an update on my mac. The following steps solved it for me:

  1. Run xcode manually and agree to new terms&conditions and whatnot.
  2. bazel clean --expunge bazel build now works