bazel-xcode / PodToBUILD

An easy way to integrate CocoaPods into Bazel
Apache License 2.0
323 stars 69 forks source link

"Bad CPU type in executable" error on M1 Mac? #230

Open HannahShiSFB opened 1 year ago

HannahShiSFB commented 1 year ago

Got the "Bad CPU type in executable" error when running RepoTools to download pods during build. Is it possible to put universal build of RepoTools (and Compiler as well) in release package?

Error message: /private/var/tmp/_bazel_hannahshi/937520e164843f0bd3aace18131f00d9/external/rules_pods/BazelExtensions/workspace.bzl:316:14: in new_pod_repository Repository rule pod_repo_ defined at: /private/var/tmp/_bazel_hannahshi/937520e164843f0bd3aace18131f00d9/external/rules_pods/BazelExtensions/workspace.bzl:198:28: in <toplevel> DEBUG: /private/var/tmp/_bazel_hannahshi/937520e164843f0bd3aace18131f00d9/external/rules_pods/BazelExtensions/workspace.bzl:6:14: __OUTPUT 1 src/main/tools/process-wrapper-legacy.cc:80: "execvp(/private/var/tmp/_bazel_hannahshi/937520e164843f0bd3aace18131f00d9/external/rules_pods/bin/RepoTools, ...)": Bad CPU type in executable

joprice commented 9 months ago

I'm also unable to run update_pods on an intel mac. Is there an option to build from source instead of using the prebuilt binary?

joprice commented 9 months ago

I tried building from source using git_repository, but the path handling in the update_pods script was tricky to get right and didn't end up writing the Vendor/rules_pods directory since it detects whether it's being run from external. I ended up building it locally and pushing a release to my fork https://github.com/joprice/PodToBUILD/releases/tag/6.3.2-370b622-x86_64.