From a241e987d9e400e9238852b8e680b0420448d0cd Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Thu, 7 Nov 2024 14:54:20 -0600 Subject: [PATCH 1/5] Update StringIO and untag most set_encoding_by_bom specs One failure remains here and a couple others I'll fix separately. --- lib/pom.rb | 2 +- lib/pom.xml | 8 ++++---- .../stringio/set_encoding_by_bom_tags.txt | 17 ----------------- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/lib/pom.rb b/lib/pom.rb index a93ce28dd41..d42bc0bb6d6 100644 --- a/lib/pom.rb +++ b/lib/pom.rb @@ -96,7 +96,7 @@ def log(message=nil) # ['set', '1.0.2'], ['shellwords', '0.1.0'], ['singleton', '0.1.1'], - ['stringio', '3.0.8'], + ['stringio', '3.1.2'], ['strscan', '3.1.0'], ['subspawn', '0.1.1'], # has 3 transitive deps: ['subspawn-posix', '0.1.1'], diff --git a/lib/pom.xml b/lib/pom.xml index 18f934c2a5e..7c466a6571c 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -749,7 +749,7 @@ DO NOT MODIFY - GENERATED CODE rubygems stringio - 3.0.8 + 3.1.2 gem provided @@ -1147,7 +1147,7 @@ DO NOT MODIFY - GENERATED CODE specifications/securerandom-0.2.0* specifications/shellwords-0.1.0* specifications/singleton-0.1.1* - specifications/stringio-3.0.8* + specifications/stringio-3.1.2* specifications/strscan-3.1.0* specifications/subspawn-0.1.1* specifications/subspawn-posix-0.1.1* @@ -1227,7 +1227,7 @@ DO NOT MODIFY - GENERATED CODE gems/securerandom-0.2.0*/**/* gems/shellwords-0.1.0*/**/* gems/singleton-0.1.1*/**/* - gems/stringio-3.0.8*/**/* + gems/stringio-3.1.2*/**/* gems/strscan-3.1.0*/**/* gems/subspawn-0.1.1*/**/* gems/subspawn-posix-0.1.1*/**/* @@ -1307,7 +1307,7 @@ DO NOT MODIFY - GENERATED CODE cache/securerandom-0.2.0* cache/shellwords-0.1.0* cache/singleton-0.1.1* - cache/stringio-3.0.8* + cache/stringio-3.1.2* cache/strscan-3.1.0* cache/subspawn-0.1.1* cache/subspawn-posix-0.1.1* diff --git a/spec/tags/ruby/library/stringio/set_encoding_by_bom_tags.txt b/spec/tags/ruby/library/stringio/set_encoding_by_bom_tags.txt index 59c5e97111e..244cb5ad771 100644 --- a/spec/tags/ruby/library/stringio/set_encoding_by_bom_tags.txt +++ b/spec/tags/ruby/library/stringio/set_encoding_by_bom_tags.txt @@ -1,18 +1 @@ -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if not readable -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns the result encoding if found BOM UTF-8 sequence -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns the result encoding if found BOM UTF_16LE sequence -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns the result encoding if found BOM UTF_16BE sequence -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns the result encoding if found BOM UTF_32LE sequence -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns the result encoding if found BOM UTF_32BE sequence -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if io is empty -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if UTF-8 BOM sequence is incomplete -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if UTF-16BE BOM sequence is incomplete -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if UTF-16LE/UTF-32LE BOM sequence is incomplete -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns UTF-16LE if UTF-32LE BOM sequence is incomplete -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if UTF-32BE BOM sequence is incomplete -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom returns nil if found BOM sequence not provided -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom does not raise exception if io not in binary mode -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom does not raise exception if encoding already set -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom does not raise exception if encoding conversion is already set fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom raises FrozenError when io is frozen -fails(waiting on release of ruby/stringio#101):StringIO#set_encoding_by_bom does not raise FrozenError when initial string is frozen From 8b3b9a0b775570055d61022bd059ac99c2b9355d Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Sat, 9 Nov 2024 14:38:30 -0600 Subject: [PATCH 2/5] Exclude remaining StringIO failures for now Will investigate these in the gem repo and get everything working. --- spec/tags/ruby/library/stringio/reopen_tags.txt | 7 +++++++ test/mri/excludes/TestStringIO.rb | 3 +++ 2 files changed, 10 insertions(+) create mode 100644 spec/tags/ruby/library/stringio/reopen_tags.txt diff --git a/spec/tags/ruby/library/stringio/reopen_tags.txt b/spec/tags/ruby/library/stringio/reopen_tags.txt new file mode 100644 index 00000000000..0f7f7e409ae --- /dev/null +++ b/spec/tags/ruby/library/stringio/reopen_tags.txt @@ -0,0 +1,7 @@ +fails:StringIO#reopen when passed [Object, Integer] reopens self with the passed Object in the passed mode +fails:StringIO#reopen when passed [Object, Integer] raises a FrozenError when trying to reopen self with a frozen String in truncate-mode +fails:StringIO#reopen when passed [Object, Integer] does not raise IOError when passed a frozen String in read-mode +fails:StringIO#reopen when passed [Object, Object] reopens self with the passed Object in the passed mode +fails:StringIO#reopen when passed [Object, Object] tries to convert the passed mode Object to an Integer using #to_str +fails:StringIO#reopen when passed [Object, Object] does not raise IOError if a frozen string is passed in read mode +fails:StringIO#reopen reopens a stream when given a String argument diff --git a/test/mri/excludes/TestStringIO.rb b/test/mri/excludes/TestStringIO.rb index d9465da6c5b..9a7427277b9 100644 --- a/test/mri/excludes/TestStringIO.rb +++ b/test/mri/excludes/TestStringIO.rb @@ -1,3 +1,6 @@ +exclude :test_each, "needs investigation" +exclude :test_gets_chomp, "needs investigation" +exclude :test_gets_chomp_eol, "needs investigation" exclude :test_overflow, "unusual subprocess test trying to overflow some value" exclude :test_read_nonblock_no_exceptions, "temporary until StringIO ext does manual arity-checking (ruby/stringio#48)" exclude :test_write_integer_overflow, "JVM does not support > 32bit signed array offsets, so our StringIO cannot either" From 280b0f864520ff73a47693106824f2bccf593bc8 Mon Sep 17 00:00:00 2001 From: Charles Oliver Nutter Date: Sat, 9 Nov 2024 14:19:23 -0600 Subject: [PATCH 3/5] Skip extension builds for default gems Seems to be issues launching these subprocesses via Maven. While we investigate that, temporarily disable extension building for default gems. The problem manifests during the default gem install of the fiddle gem, which generates a dummy Makefile on JRuby because it uses the FFI version instead. The launch of extconf.rb exhibits problems in various environments: * In CI, it ends up running with the system default Java rather than the one configured in JAVA_HOME. * On local Linux environments, it fails to launch due to a "bar file descriptor: /bin/sh" error. It seems that the subprocess launch is losing environment in some broken way. --- lib/pom.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/pom.rb b/lib/pom.rb index d42bc0bb6d6..a62a31905b8 100644 --- a/lib/pom.rb +++ b/lib/pom.rb @@ -252,6 +252,18 @@ def log(message=nil) File.join(global_bin, "jruby#{RbConfig::CONFIG['EXEEXT']}") end + # Disable extension build for gems (none of ours require a build) + class Gem::Ext::Builder + def build_extensions + return if @spec.extensions.empty? + + say "Skipping native extensions." + + FileUtils.mkdir_p File.dirname(@spec.gem_build_complete_path) + FileUtils.touch @spec.gem_build_complete_path + end + end + ctx.project.artifacts.select do |a| a.group_id == 'rubygems' || a.group_id == 'org.jruby.gems' end.each do |a| From a0650ab0374bea2d2b6ad536d5c2af7eec34c42f Mon Sep 17 00:00:00 2001 From: "Thomas E. Enebo" Date: Sun, 10 Nov 2024 14:27:32 -0600 Subject: [PATCH 4/5] update for next dev cycle --- VERSION | 2 +- core/pom.xml | 4 ++-- lib/pom.xml | 4 ++-- pom.xml | 5 +---- shaded/pom.xml | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/VERSION b/VERSION index 045beacb85c..75904b37481 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -9.4.9.0 +9.4.10.0-SNAPSHOT diff --git a/core/pom.xml b/core/pom.xml index ae9b46a5d95..c93c228a0e7 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -12,7 +12,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby jruby-parent - 9.4.9.0 + 9.4.10.0-SNAPSHOT jruby-base JRuby Base @@ -716,7 +716,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby jruby-base - 9.4.9.0 + 9.4.10.0-SNAPSHOT diff --git a/lib/pom.xml b/lib/pom.xml index 7c466a6571c..68a9f704942 100644 --- a/lib/pom.xml +++ b/lib/pom.xml @@ -12,7 +12,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby jruby-parent - 9.4.9.0 + 9.4.10.0-SNAPSHOT jruby-stdlib JRuby Lib Setup @@ -28,7 +28,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby jruby-core - 9.4.9.0 + 9.4.10.0-SNAPSHOT test diff --git a/pom.xml b/pom.xml index 5512a2c7634..0d7c39e3a7f 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby jruby-parent - 9.4.9.0 + 9.4.10.0-SNAPSHOT pom JRuby JRuby is the effort to recreate the Ruby (https://www.ruby-lang.org) interpreter in Java. @@ -273,9 +273,6 @@ DO NOT MODIFY - GENERATED CODE [3.3.0,) - - No Snapshots Allowed! - diff --git a/shaded/pom.xml b/shaded/pom.xml index dbbe1729539..311ff9e0d42 100644 --- a/shaded/pom.xml +++ b/shaded/pom.xml @@ -12,7 +12,7 @@ DO NOT MODIFY - GENERATED CODE org.jruby jruby-parent - 9.4.9.0 + 9.4.10.0-SNAPSHOT jruby-core JRuby Core From f45430db439f2d5a81415ac766dfef6c88a4dca1 Mon Sep 17 00:00:00 2001 From: "Thomas E. Enebo" Date: Sun, 10 Nov 2024 14:31:12 -0600 Subject: [PATCH 5/5] Trivial refactoring for match --- core/src/main/java/org/jruby/ir/builder/IRBuilder.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/jruby/ir/builder/IRBuilder.java b/core/src/main/java/org/jruby/ir/builder/IRBuilder.java index db463dcc73c..c8cbdcda554 100644 --- a/core/src/main/java/org/jruby/ir/builder/IRBuilder.java +++ b/core/src/main/java/org/jruby/ir/builder/IRBuilder.java @@ -1734,11 +1734,10 @@ protected Variable buildDefnCheckIfThenPaths(Label undefLabel, Operand defVal) { } public Operand buildMatch(Variable result, Operand regexp) { - Variable tempLastLine = temp(); - addResultInstr(new GetGlobalVariableInstr(tempLastLine, symbol("$_"))); + Variable lastLine = addResultInstr(new GetGlobalVariableInstr(temp(), symbol("$_"))); if (result == null) result = temp(); - return addResultInstr(new MatchInstr(scope, result, regexp, tempLastLine)); + return addResultInstr(new MatchInstr(scope, result, regexp, lastLine)); } protected Operand buildModule(ByteList name, U cpath, U bodyNode, StaticScope scope, int line, int endLine) {