-
Notifications
You must be signed in to change notification settings - Fork 157
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
JRuby & M1 Mac: invalid arch name '-arch aarch64' #231
Comments
@headius perhaps this would be an easy configuration fix for someone on the JRuby team? Or possibly it could be a bug in how JRuby installs C extensions on M1 Macs? |
Does the sassc gem build on CRuby on M1? This would be in the makefile for libsass so I'm not sure what we can fix on our end... |
Could be a bug in our mkmf that is providing the wrong flag for arch. |
Yup it installs just fine for CRuby 3.0.3. Taking a look at the Makefile generated by the CRuby installation vs the JRuby installation, there's several differences, but the |
And the only thing different between the Makefile generated by/for JRuby on an Intel Mac is that there the |
Show me ARCH_FLAG seems like the culprit... we will need to figure out where that is being set and make sure it reflects an appropriate build flag on M1. |
|
Hmm oddly enough, JRuby appears to hardcode |
Ok I see now that we override the ARCH_FLAG on Mac to be |
This should allow sassc and other external libraries to build using the makefile configuration bits in rbconfig. See sass/sassc-ruby#231
This seems to be a case where MacOS prefers This might be relevant on Linux/aarch64 as well but I do not have such a machine to test against right now. I can confirm the fix above does allow sassc to build on JRuby on MacOS/M1. |
I've merged the fixes into JRuby's 9.3.x branch and they will go out sometime soon in 9.3.4. |
Are there any workarounds for this until 9.3.4.0 comes out? This prevents me from working on my M1 machine. |
I guess I can try the nightly builds |
The patch mostly changes how we set up some static configuration data. You could make the same changes in some code preamble. I'm not at my desk but I can demonstrate later if you have trouble figuring it out. The values are either writable or we can get around any read-only issues. |
And by code preamble, I mean making sure to load a file that corrects those bad values before RubyGems runs install scripts. Editing RG source in place is another option. I'm hoping to set up nightly docker images soon as well. |
Hey, thanks @headius - in fact I grabbed the latest nightly of 9.4.0.0 and stuffed that into my VM as ~/.rubies/jruby-9.3.3.0 - its a hack but it works for me for now, until 9.3.3.0 proper comes along. Thanks! |
Actually, scratch that, its giving me a weird error with our code. I think I probably do need to build a patched 9.3.4.0-pre from source then, or try your preamble idea. |
The 9.4 builds from master are probably a little premature, since they are currently transitioning to Ruby 3.1 compatibility. A nightly build of 9.3 would be better but may not have run recently due to some unaddressed failures in CI. I'll kick off a snapshot build of 9.3 that you can try out. |
An updated 9.3.4 build should appear here soon: https://oss.sonatype.org/content/repositories/snapshots/org/jruby/jruby-dist/9.3.4.0-SNAPSHOT/ |
I would also very much like to know what the error was! We are trying to work towards stabilizing master for our next major release. Open an issue with the error and any information you can provide. |
I and my team is also facing this issue.
|
This really should be fixed in JRuby 9.3.4.0. can you confirm you are getting an error running 9.3.4.0 or higher and not 9.3.3.0? |
Actually, the entire team uses 9.3.3.0 and they face no such issue so, wanted to understand what changed that's causing this error. |
@thesigmoidfunction If you are still having issues with this, open an issue or discussion on the JRuby project, or join us on the #jruby chat room on Matrix and we'll try to help. I am convinced at this point that we fixed this issue, since we have had users on M1 for several months now. |
When I try to
gem install sassc
under JRuby 9.3.3.0 with my M1 Macbook, I get the following error (even though it works fine under Ruby 3.0.3)The text was updated successfully, but these errors were encountered: