You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
build: build with baseruby that is compiled from the same source
The system installed Ruby (especially Debian) can override
`Gem.default_dir` to lookup gems installed by the OS package managers.
And `rbinstall.rb` respects `Gem.default_dir` to select install
directory of gems under `DESTDIR`. So it installs gems in
`DESTDIR/var/lib/gems/3.2.0+1` where the Debian's `operating_system.rb`
specifies.
However, `Gem.default_dir` is not overridden at runtime on Wasm, so it
lookups `DESTDIR/usr/local/lib/ruby/gems/3.2.0+1` instead. The mismatch
of `default_dir` between install-time and runtime causes the failure of
gem lookup.
To fix this mismatch, stop using system packaged ruby to avoid loading
`operating_system.rb`, and use self-built ruby, which doesn't patch
`Gem.default_dir`.
This change also makes our build compatible with cross-compilation
prerequisite:
https://bugs.ruby-lang.org/projects/ruby/wiki/DeveloperHowto#prerequisite
0 commit comments