Loading
Add Ruby regexp program size patch for 3.3 and 3.4
Backports https://github.com/ruby/ruby/pull/19020 to Ruby 3.3 and 3.4.
- 3.3: there is no upstream backport. The two upstream commits apply to Ruby 3.3.12 with line offsets only, and the change is identical to the 3.4 patch. Each commit keeps its upstream message plus a
(cherry picked from commit ...)line. - 3.4: a verbatim copy of the upstream backport https://github.com/ruby/ruby/pull/19024 (still open upstream).
- 4.0: not patched here yet.
config/software/ruby.rb applies the patch for Ruby >= 3.3.0 and < 4.0.0. The current Ruby is 3.3.12 and the next is 3.4.10, so both use it.
Testing locally
Build a package from this branch (Ruby 3.3 or 3.4), install it, then run:
/opt/gitlab/embedded/bin/ruby -v
grep -q "too big compiled program" "$(/opt/gitlab/embedded/bin/ruby -rrbconfig -e "print File.join(RbConfig::CONFIG[%q(libdir)], RbConfig::CONFIG[%q(LIBRUBY_SO)])")" && echo patched || echo "not patched"The second command prints patched when libruby contains the new error message from the patch. The patch also adds a test to test/ruby/test_regexp.rb.
Edited by Oleg Yakovenko