Created
September 25, 2024 21:48
-
-
Save nicksieger/03bf346d3a8b63c5f822993b897da418 to your computer and use it in GitHub Desktop.
Patch to build ruby-3.0.x on Sequoia
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- ext/bigdecimal/bigdecimal.c.orig 2024-09-25 16:24:50 | |
| +++ ext/bigdecimal/bigdecimal.c 2024-09-25 16:25:15 | |
| @@ -65,7 +65,7 @@ | |
| static ID id_half; | |
| /* MACRO's to guard objects from GC by keeping them in stack */ | |
| -#define ENTER(n) volatile VALUE RB_UNUSED_VAR(vStack[n]);int iStack=0 | |
| +#define ENTER(n) volatile VALUE vStack[n];int iStack=0 | |
| #define PUSH(x) (vStack[iStack++] = (VALUE)(x)) | |
| #define SAVE(p) PUSH((p)->obj) | |
| #define GUARD_OBJ(p,y) ((p)=(y), SAVE(p)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For those of you having issues with chruby, here's what worked for me.
Ruby 3.0.7 Manual Installation Guide for chruby on Apple Silicon
This guide documents the step-by-step process to manually compile and install Ruby 3.0.7 for use with chruby on Apple Silicon Macs (M1/M2/M3, maybe M4 and M5).
Prerequisites
Required Dependencies
Step 1: Create the Apple Silicon Compatibility Patch
Create Nick Sieger's patch file needed for Ruby 3.0.7 on Apple Silicon:
Step 2: Download Ruby 3.0.7 Source
Step 3: Configure the Build
Configure Ruby to be installed in the chruby directory with proper OpenSSL linking:
./configure \ --prefix=/Users/$USER/.rubies/ruby-3.0.7 \ --with-openssl-dir=/opt/homebrew/opt/openssl@1.1Key Configuration Options:
--prefix=/Users/$USER/.rubies/ruby-3.0.7- Install to chruby-compatible location--with-openssl-dir=/opt/homebrew/opt/openssl@1.1- Link with OpenSSL 1.1Step 4: Apply the Patch
As noted above, the Ruby 3.0.7 source needs to be patched for Apple Silicon compatibility. This was already handled by downloading the clean source, but if you encounter issues, you can manually apply the patch:
Step 5: Compile Ruby
Compile Ruby using multiple CPU cores for faster build:
Expected Output:
Step 6: Install Ruby
Install the compiled Ruby to the chruby directory:
Installation includes:
~/.rubies/ruby-3.0.7/bin~/.rubies/ruby-3.0.7/libStep 7: Verify Installation
Test that chruby can see and use Ruby 3.0.7:
Step 8: Cleanup
Remove temporary build files:
rm -rf /tmp/ruby-3.0.7*Configuration for Default Use
To make Ruby 3.0.7 your default Ruby version, add to your
~/.zshrc:# Add to ~/.zshrc chruby ruby-3.0.7Troubleshooting
Common Issues
openssl@1.1is installed from the rbenv tapgem envVerification Commands
Notes