jarkonik / jarkonik/bevy_scriptum

macOS Support for Ruby

Open
#65 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
171
Forks
19
PR merge metrics
No merged PRs in 30d

Description

Hey there! Incredibly excited that Ruby support has been added. I've been poking around at it, and at least with some very simple scripts, it does appear to work fine on macOS with a few tweaks and/or changes to the build environment.

The primary challenge comes from the fact that the `rb-sys` feature `ruby-static` is opted into by default and it seems to mostly be a challenge of getting a build of Ruby on macOS w/ the static library included.

If `--enable-shared` is passed to `./configure` in the Ruby build process (as it is by default with `ruby-build`), it will omit including the static library in the install (on macOS, at least)

Specifying `--enable-install-static-library` (e.g. via `RUBY_CONFIGURE_OPTS` when using `ruby-build`/`rbenv install`) enables its inclusion even if `--enable-shared` is passed as well, but `rb-sys` still seems to end up linking to the dynamic one anyway (I believe this is a preference of the linker on macOS, but not exactly sure how to override it for this dependency specifically.)

Using `--disable-shared`, I was able to validate it does work in my own project by compiling a build of Ruby this way and vendoring it in the project.

I'll happily throw up a docs PR for it once I tidy a few things up on my own project's use of it, but figured I'd share what I've poked at so far, in case others on a Mac are eager to use it!

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the macOS build behavior described for rb-sys's ruby-static feature, using ./configure with --enable-shared and --enable-install-static-library. Check how ruby-build/rbenv and RUBY_CONFIGURE_OPTS affect the installed libraries and linker choice. Done should establish a supported macOS build path or document the required configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, ruby, rust
Domain
build-system, operating-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.