Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

binary target not working properly as deps for macos_command_line_application #2657

Open
yiyinglai opened this issue Feb 23, 2025 · 1 comment

Comments

@yiyinglai
Copy link

//mediapipe/examples/desktop/face_mesh:face_mesh_cpu is already a binary target, which can be built and run successfully. With the below configuration, it is complaint that there's no main function.

load("@build_bazel_rules_apple//apple:macos.bzl", "macos_command_line_application")
macos_command_line_application(
    name = "face_mesh_cpu_tool",
    deps = [
        "//mediapipe/examples/desktop/face_mesh:face_mesh_cpu",
    ],
    bundle_id = "com.mediapipe.FaceMeshCpu",
    infoplists = [
        "//mediapipe/examples/desktop/face_mesh:Info.plist",
    ],
    minimum_os_version = "15.0",
    visibility = ["//visibility:public"],
)

ERROR: /Users/yiyinglai/workspace/github/mediapipe/mediapipe/examples/desktop/face_mesh/BUILD:62:31: Linking mediapipe/examples/desktop/face_mesh/face_mesh_cpu_tool_bin failed: (Exit 1): wrapped_clang failed: error executing command (from target //mediapipe/examples/desktop/face_mesh:face_mesh_cpu_tool) external/local_config_cc/wrapped_clang @bazel-out/macos-arm64-min15.0-applebin_macos-darwin_arm64-fastbuild-ST-c0090dab5885/bin/mediapipe/examples/desktop/face_mesh/face_mesh_cpu_tool_bin-2.params

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Undefined symbols for architecture arm64:
  "_main", referenced from:
      <initial-undefines>
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Error in child process '/usr/bin/xcrun'. 1
Target //mediapipe/examples/desktop/face_mesh:face_mesh_cpu_tool failed to build
@keith
Copy link
Member

keith commented Feb 23, 2025

In this case since //mediapipe/examples/desktop/face_mesh:face_mesh_cpu is a cc_binary target, macos_command_line_application should probably reject it in the deps. It expects you to pass library targets instead. I don't think cc_binary propagates enough information to be re-linked as another binary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants