peterzhu2118 (Peter Zhu) wrote in #note-2:
What is the intended configuration?
We realize that this feature is currently cumbersome to use as it requires a compile time option, an environment variable, and a built GC library. We need the compile time option as there is a performance penalty when modular GC is enabled, as shown in the benchmarks in #20470.
That mentions 1-2 %. Assuming that the ultimate target is to be able to use different GC, which in theory might compensate for the performance hit, I think that could be sensible trade off
BTW in that ticket, there is also mentioned "loading Ruby's current GC using RUBY_GC_LIBRARY_PATH". Should I have the default GC available somewhere as some .so file when compiling with the --with-modular-gc
option?
This is because the GC is no longer statically compiled and we use function pointers instead, which prevents compiler optimizations.
I'd expect that something like RUBY_GC_LIBRARY=/home/johndoe/path/to/gc/gc.so ruby -e 'puts "Hello custom GC"' would be command to run.
That was the original design, however, in [Feature #20470] it was decided that this was a security concern due to the possibility to execute arbitrary code using environment variables. The compromise is to specify a directory at build time using --with-modular-gc=
, and only accept binaries placed in that directory.
Fedora is binary distribution. Therefore having build time option is not helpful for our users. Especially if it enables to specify just one path. E.g. if we said that the Ruby GCs on Fedora will be placed in lets say /usr/lib64/rubygc
, then that means this place should be managed by RPM and it would be less then ideal if users placed there their content. If it was placed in /usr/local/lib64/rubygc
, then on contrary, RPM should not manage content of that directory. But in general, users (including developers) should not touch these locations at all, because these are system wide and requires elevated privileges, which is mostly wrong. For development purposes, they should stay in their $HOME.
But anyway, given that is seems you are aiming to provide the alternative GCs as gem, then this is likely just academic discussion :)
Actually I wonder why the GC is not packaged as gem? Maybe RubyGems are late to the party to load the GC early enough. But they still would be nice method of distribution.
That is the the ultimate goal. We will probably need to do modifications to bundler to get this to work.
But from the Ruby 3.4, the Modular GC seems to be as something users might want.
The feature is experimental, so we don't enable it for the vast majority of the users who don't want it.
Ok. Thanks for elaborating. It seems that ATM, it will be better to keep this option disabled for Fedora.
Thanks a lot for all the details and feel free to close this ticket.