-
Notifications
You must be signed in to change notification settings - Fork 522
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
fix: allow cypress to run on m1 macs #3088
Conversation
I think this is probably better, since it gives us the ability to warn about rosetta, and when/if they do release M1 binaries, it's a smaller change to modify that toolchain_config than to introduce a new one at that time. Note that I'm hoping to spin out cypress to its own repository so that it could have independent maintainers, but probably not happening before 5.x. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
this toolchain needs some cleanup to avoid eager-evaluation of the RHS of the select()
statement. I think right now it will download for all platforms? Maybe even an extra download since you have another http_archive
here now.
Yeah, I'm pretty sure it will end up downloading another archive... Is that acceptable or would you like me to take a look at lazy-loading the cypress toolchains before merging this? Do you know of documentation or a good example I could look at for lazy evaluation of select statements for toolchains? (Only thing I could find was rules_rust's "proxy repositories": https://github.com/bazelbuild/rules_rust/blob/main/rust/repositories.bzl#L263-L264) |
https://github.com/aspect-build/bazel_rules_template/blob/main/mylang/private/toolchains_repo.bzl has some docs about that. Pretty sure @mrmeku will make a new cypress rule from that template sometime soon, and we'll port over any fixes from here. So I think this is good to merge. Thanks! |
* fix: allow cypress to run on m1 macs * fix: add additional cypress toolchain for darwin_arm64 * docs: update documentation for darwin_arm64 parameters in cypress_repositories
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Bazel fails to run Cypress tests with an M1 Mac (Darwin arm64) host, as it is unable to find a toolchain that doesn't limit the host to an x86 CPU.
Issue Number: #3085
What is the new behavior?
The CPU architecture compatibility restriction is removed in this PR, so Cypress will run using the x86 build under rosetta (note: Cypress' official take is: "the way to run Cypress on Apple M1 ARM chip is by using Intel emulation with Rosetta 2, Apple's translation layer."). As of opening this PR, Cypress still does not have a native arm64 build.
Does this PR introduce a breaking change?
Other information
Discussion/Questions:
darwin_arm64
with another appropriately named toolchain and@cypress_*
external which really just pulls the x86 build again under the hood?