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

Support macOS with M1 processor #217

Closed
Vertexwahn opened this issue Nov 17, 2022 · 6 comments
Closed

Support macOS with M1 processor #217

Vertexwahn opened this issue Nov 17, 2022 · 6 comments

Comments

@Vertexwahn
Copy link

Vertexwahn commented Nov 17, 2022

git clone https://github.com/google/copybara.git
bazel build //java/com/google/copybara

resutls on my macBook (with M1 processor) in:

/private/var/tmp/_bazel_me/7e0c0b9f3cabec19d47f3e37da2ab9de/external/io_bazel/third_party/BUILD:376:20: Extracting interface @io_bazel//third_party:error_prone_annotations_checked_in failed: (Exit 1): ijar failed: error executing command external/remote_java_tools_darwin/java_tools/ijar/ijar external/io_bazel/third_party/error_prone/error_prone_annotations-2.11.0.jar ... (remaining 3 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
src/main/tools/process-wrapper-legacy.cc:80: "execvp(external/remote_java_tools_darwin/java_tools/ijar/ijar, ...)": Bad CPU type in executable
Target //java/com/google/copybara:copybara failed to build
Use --verbose_failures to see the command lines of failed build steps.

So far copybara worked for me on Ubuntu 22.04 (with x64)

Used Bazel version: 5.3.2

Or it this an Bazel issue? bazelbuild/bazel#13944

Is there a workaround?

I currently embed copybara this way in my WORKSPACE file:

#-------------------------------------------------------------------------------------
# Copybara
#-------------------------------------------------------------------------------------

# Use local repository
local_repository(
    name = "com_github_google_copybara",
    path = "third_party/copybara-85f7be9c1761b88e4834bb08e2d6e11faa05b51b",
)

load("@com_github_google_copybara//:repositories.bzl", "copybara_repositories")

copybara_repositories()

load("@com_github_google_copybara//:repositories.maven.bzl", "copybara_maven_repositories")

copybara_maven_repositories()

load("@com_github_google_copybara//:repositories.go.bzl", "copybara_go_repositories")

copybara_go_repositories()
@hsudhof
Copy link
Collaborator

hsudhof commented Nov 17, 2022

Updating bazel should resolve this.

@Vertexwahn
Copy link
Author

Vertexwahn commented Nov 17, 2022

@Vertexwahn I tried also 6.0.0-pre.20221020.1 with the same error... Currently I have Rosetta 2 installed as a workaround...

@mikelalcon
Copy link
Collaborator

Are you running the arm version of Bazel? I have the 5.3.2 ARM working for me in an M1 here.

@Vertexwahn
Copy link
Author

@mikelalcon I used Bazel on macOS with M1 before I installed Rosetta 2 (via brew install bazel - I am assuming I have ARM compiled version of Bazel)

@mikelalcon
Copy link
Collaborator

From what I see from your log, the failure is for:

external/remote_java_tools_darwin/java_tools/ijar/ijar

That is a tool that Bazel ships with it, not Copybara related. So definitely ijar seems to be x64 instead of ARM. Another posibility is that it is in the cached downloads of Bazel. Maybe bazel clean fixes the issue.

@Vertexwahn
Copy link
Author

I now have Rosetta 2 installed and need it from time to time for other applications (so I cannot uninstall it) - unfortunately, I have no idea how to check if it would work now without Rosetta 2 - therefore I close this issue since Copybara works now for me on M1

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

3 participants