#17887 closed enhancement (fixed)
ruby-3.2.2
Reported by: | Bruce Dubbs | Owned by: | Douglas R. Reno |
---|---|---|---|
Priority: | elevated | Milestone: | 12.0 |
Component: | BOOK | Version: | git |
Severity: | normal | Keywords: | |
Cc: |
Description ¶
New point version.
Change History (8)
comment:1 by , 2 years ago
Owner: | changed from | to
---|---|
Priority: | normal → elevated |
Status: | new → assigned |
comment:2 by , 2 years ago
comment:3 by , 2 years ago
It wouldn't be a package update recently if something didn't require additional effort. :)
When I started working on this, I was able to do a build with the CAPI docs and a build without tests perfectly fine for stats.
Once I ran the tests for Ruby, I almost immediately ran into a problem. The Number#step test triggered a segmentation fault. That originally implied that there was a regression with the fix for https://bugs.ruby-lang.org/issues/19445 (Ruby Bug Report #19445), which was supposed to be fixed in this version of Ruby. I came up with a sed (sed -i '278,365d' test/ruby/test_numeric.py) to remove the faulty test, but that was before I realized that this was a serious problem because this was supposed to get fixed in this version.
Some additional investigation showed that we were getting a version of Ruby that reported itself as 3.2.1. You'll notice the behavior here:
renodr [ /sources/ruby-3.2.2 ]$ ./ruby -v ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux]
In the tests, you'll see:
/sources/ruby-3.2.2/ruby-3.2.2/basictest/test.rb:path .......................OK 23 /sources/ruby-3.2.2/ruby-3.2.2/basictest/test.rb:gc ....OK 4 test succeeded Run options: --seed=53717 "--ruby=./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems" # Running tests: Finished tests in 8.259602s, 37.6531 tests/s, 218.0493 assertions/s. 311 tests, 1801 assertions, 0 failures, 0 errors, 12 skips ruby -v: ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux]
... now why are we using 'ruby 3.2.1' in 'ruby 3.2.2'?
This was even when adding the '--without-baseruby' option to configure.
Ruby pulls it's version information from /usr/lib/libruby.so, and as a result it will report 3.2.1 unless you pass LD_PRELOAD=./libruby.so (which points to libruby.so.3.2.2). This threw me for a loop originally, but after accidentally running a build without --enable-shared I was able to figure out what was happening there. However, because of this, we were running the tests with a strange hybrid of ruby-3.2.2's programs with ruby-3.2.1's standard library. Note that I determined this after a few hours of going down the wrong path, where 'miniruby' was originally thought to be the system installed version of ruby. This is determined by the BOOTSTRAP_RUBY variable in Makefile, and I misinterpreted it at first when doing initial troubleshooting. I learned a lot more about Ruby's build system than I originally planned. :)
An example of this behavior:
renodr [ /sources/ruby-3.2.2 ]$ ./ruby -v ruby 3.2.1 (2023-02-08 revision 31819e82c8) [x86_64-linux] renodr [ /sources/ruby-3.2.2 ]$ LD_PRELOAD=$PWD/libruby.so ./ruby -v ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-linux]
Once working past the initial test failure/segmentation fault, I encountered another problem that was introduced by a check for not reporting changed environment variables for BUNDLER_PREFIX during the tests. It has been fixed properly upstream, but I just removed the check with a one-line sed for now: 'sed -i 238d tool/lib/leakchecker.rb', since it hasn't been backported to the 3.2 branch yet. That fix can be found at: https://git.ruby-lang.org/ruby.git/commit/?id=bccdc041665032b819fab1c04ed4dbdfeeeb366b
To make sure that we get clean builds that are free of contaminents from prior versions of Ruby, we need to change to:
./configure --prefix=/usr \ --enable-shared \ --without-valgrind \ --without-baseruby \ --docdir=/usr/share/doc/ruby-3.2.2 && make && sed -i '238d' tool/lib/leakchecker.rb && LD_PRELOAD=$PWD/libruby.so make -j1 -k check && make install
I'll also need to change --without-baseruby into a parameter from an optional in the short descriptions.
comment:4 by , 2 years ago
What happens if you just delay the tests until after the install? It's not optimal, but we do that for epiphany and perhaps one or two other packages.
comment:5 by , 2 years ago
I've been thinking about it a bit and still need to do experimentation, but I'll get to that after class today. I still want to start on GNOME today too (though I've got other tickets and a Nouveau bug to look at so it'll likely be tomorrow for gnome stuff).
I'm probably going to add without-baseruby to the default instructions though just to prevent further issues. Building without it could be problematic between minor versions
comment:6 by , 2 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Release Notes
CVE-2023-28755
CVE-2023-28756