Hi! I'm excited about the new modular GC feature. I just wanted to report that when I build Ruby 3.4.0-rc1 with MMTk on latest macOS 15.2 I seem to be encountering a linking issue. Whether I cargo build --release or ruby extconf.rb && make a target/release/libmmtk_ruby.dylib is created. A make modular-gc MODULAR_GC=mmtk then seems to expect a target/release/librubygc.mmtk.bundle, which doesn't exist. I briefly had it working but now can't reproduce the working order.
ruby_modular_gc_init: Shared library /Users/havenwood/src/ruby-3.4.0-rc1/gc/mmtk/target/release/librubygc.mmtk.bundle cannot be opened: dlopen(/Users/havenwood/src/ruby-3.4.0-rc1/gc/mmtk/target/release/librubygc.mmtk.bundle, 0x0009): tried: '/Users/havenwood/src/ruby-3.4.0-rc1/gc/mmtk/target/release/librubygc.mmtk.bundle' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/havenwood/src/ruby-3.4.0-rc1/gc/mmtk/target/release/librubygc.mmtk.bundle' (no such file), '/Users/havenwood/src/ruby-3.4.0-rc1/gc/mmtk/target/release/librubygc.mmtk.bundle' (no such file)
The latest nightly Ruby I tried produced the same missing .bundle error. I'm very much looking forward to 3.4.0 and the introduction of the new pluggable GC feature! Thank you!
Thank you for trying this feature out. I think you're confused about how the configuration works, and that's our bad, we never documented anything.
The --with-modular-gc flag is used to specify a directory that the built GC library will be placed into, and it uses a different directory for the intermediate build artifacts (you don't need to specify this directory). It seems like you're trying to specify the Rust build directory for it?
I started working on a gc/README.md document. It's far from complete, but I wrote a "building guide" section which may help you in building this feature. Please let me know if you still run into issues.
I started working on a gc/README.md document. It's far from complete, but I wrote a "building guide" section which may help you in building this feature. Please let me know if you still run into issues.
You're right, I was just confused. I thought the option was to point to an alternative path to MMTk itself, and was curious why the default wasn't set to the one that ships with Ruby. It makes sense as you explain it in this thread and the new documentation. Thank you!
I do seem to run into a very similar error pointing the --with-modular-gc= option to the absolute path of an empty directory. The following was output from an attempt with a --with-modular-gc="/Users/havenwood/mmtk" flag ./configure.
❯ make modular-gc MODULAR_GC=mmtk
ruby_modular_gc_init: Shared library /Users/havenwood/mmtk/librubygc.mmtk.bundle cannot be opened: dlopen(/Users/havenwood/mmtk/librubygc.mmtk.bundle, 0x0009): tried: '/Users/havenwood/mmtk/librubygc.mmtk.bundle'(no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/havenwood/mmtk/librubygc.mmtk.bundle'(no such file), '/Users/havenwood/mmtk/librubygc.mmtk.bundle'(no such file)
make: ***[modular-gc] Error 1
Was the RUBY_GC_LIBRARY environment variable set when you ran make modular-gc MODULAR_GC=mmtk? The make modular-gc target uses Ruby to build the modular GC and it seems that the Ruby is trying to use the GC before it has been built.
Was the RUBY_GC_LIBRARY environment variable set when you ran make modular-gc MODULAR_GC=mmtk? The make modular-gc target uses Ruby to build the modular GC and it seems that the Ruby is trying to use the GC before it has been built.
I had exported CFLAGS with make settings as part of a successful previous install. Now it makes sense why it worked for me once and I couldn't reproduce my initial result. 🤦 I really appreciate you pointing me in the right direction. The issue was just my misunderstanding of steps paired with bumbling env vars.
I think this issue can be closed. Thank you and sorry for the noise.