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

Apple M1 Mac (Darwin arm64) support for local development #3085

Closed
3 of 5 tasks
CooperBills opened this issue Nov 18, 2021 · 7 comments
Closed
3 of 5 tasks

Apple M1 Mac (Darwin arm64) support for local development #3085

CooperBills opened this issue Nov 18, 2021 · 7 comments

Comments

@CooperBills
Copy link
Contributor

CooperBills commented Nov 18, 2021

Apple M1 Mac (Darwin arm64) support for local development

Description

Currently, rules_nodejs fails to build with Apple M1 Macs (Darwin arm64). This issue is to track updates to rules_nodejs to support local development on Macs using M1 processors (Darwin arm64).

Changes to enable support:

The above changes enable successful full builds (bazel build //...) and testing (bazel test //...), with ~97% tests passing (the last 3% is because headless firefox is failing with timeouts).

I have these changes locally, and will be opening PRs for them in the next day or so.

@alexeagle
Copy link
Collaborator

Yes, users need Bazel 4.2.0, but I'm not sure how rules_nodejs has responsibility for that.

The other fixes sound right to me, thanks!

@CooperBills
Copy link
Contributor Author

Ah, to clarify: it's to bump the .bazelversion (and corresponding locations) in the repository so contributors will use 4.2.0 (It's currently 4.1.0).

@CooperBills
Copy link
Contributor Author

@alexeagle Looks like you already began bumping to 4.2.0 a month or so ago: #2926

@alexeagle
Copy link
Collaborator

Yup, we have some more work to update our own version of Bazel, but that has no effect on what version users have. It's not transitive.

@alexeagle
Copy link
Collaborator

@CooperBills I think all the things here are landed, can we close this?

@CooperBills
Copy link
Contributor Author

@alexeagle Although not everything has landed, I'm ok with closing this with the following note:

Any contributor working on an M1 Mac will need Bazel 4.2.0+, so this temporary one-line change locally is needed to get things working (until the repo's version is bumped):

Index: .bazelversion
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/.bazelversion b/.bazelversion
--- a/.bazelversion	(revision d30c366127c208d14d08adb74f4a847f87558c92)
+++ b/.bazelversion	(date 1638896444779)
@@ -1,1 +1,1 @@
-4.1.0
+4.2.0

Also, as of this writing, #3088 Has yet to be merged, so any contributor working on an M1 Mac will need to either pick the changes from that branch or temporarily add this one-line hack locally to get Cypress working:

Index: toolchains/cypress/BUILD.bazel
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/toolchains/cypress/BUILD.bazel b/toolchains/cypress/BUILD.bazel
--- a/toolchains/cypress/BUILD.bazel	(revision d30c366127c208d14d08adb74f4a847f87558c92)
+++ b/toolchains/cypress/BUILD.bazel	(date 1638896391246)
@@ -71,7 +71,7 @@
     name = "cypress_darwin_toolchain",
     target_compatible_with = [
         "@platforms//os:osx",
-        "@platforms//cpu:x86_64",
+#        "@platforms//cpu:x86_64",
     ],
     toolchain = ":cypress_darwin_toolchain_config",
     toolchain_type = ":toolchain_type",

With those work arounds the repo works quite well with M1's, so I think this ticket can be closed.

@alexeagle
Copy link
Collaborator

our local .bazelversion file in this repo doesn't affect what happens for users. The other PR is merged now. Thanks!

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