From 7d282fbaf5a84b86bea9367a5e11b5449cc69842 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 2 May 2025 12:40:33 +0200 Subject: [PATCH 1/4] The en_US.UTF-8 locale needs glibc-langpack-en on Oracle Linux 8+ --- doc/user/utf8-locale.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/user/utf8-locale.md b/doc/user/utf8-locale.md index b8e610dced8e..80fd147f680c 100644 --- a/doc/user/utf8-locale.md +++ b/doc/user/utf8-locale.md @@ -21,6 +21,7 @@ Instead, all values should be `"en_US.UTF-8"` or other regions but still `.UTF-8 ### Fedora-based: RHEL, Oracle Linux, etc ```bash +sudo dnf install glibc-langpack-en export LANG=en_US.UTF-8 ``` From a9c66625f58a8ca8142a2ec4391441ae769a9dc3 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Fri, 2 May 2025 13:21:12 +0200 Subject: [PATCH 2/4] Fix include_all_c_header_spec.rb to work in Docker tests --- spec/truffle/include_all_c_header_spec.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spec/truffle/include_all_c_header_spec.rb b/spec/truffle/include_all_c_header_spec.rb index 206816b4255f..2cf1b8e52beb 100644 --- a/spec/truffle/include_all_c_header_spec.rb +++ b/spec/truffle/include_all_c_header_spec.rb @@ -10,8 +10,9 @@ describe 'lib/cext/include/internal_all.h' do it 'includes each *.h file from lib/cext/include/internal/' do - filenames = Dir.glob('internal/**/*.h', base: 'lib/cext/include', sort: true) - content = File.read('lib/cext/include/internal_all.h') + ruby_home = RbConfig::CONFIG['prefix'] + filenames = Dir.glob('internal/**/*.h', base: "#{ruby_home}/lib/cext/include", sort: true) + content = File.read("#{ruby_home}/lib/cext/include/internal_all.h") filenames.should_not be_empty @@ -20,8 +21,9 @@ end it 'includes each *.h file from lib/cext/include/stubs/internal/' do - filenames = Dir.glob('internal/**/*.h', base: 'lib/cext/include/stubs', sort: true) - content = File.read('lib/cext/include/internal_all.h') + ruby_home = RbConfig::CONFIG['prefix'] + filenames = Dir.glob('internal/**/*.h', base: "#{ruby_home}/lib/cext/include/stubs", sort: true) + content = File.read("#{ruby_home}/lib/cext/include/internal_all.h") filenames.should_not be_empty From 62047ba82c86b752247d1ac302c9f70eb298126f Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 14 May 2025 17:04:24 +0200 Subject: [PATCH 3/4] Some fixes for LANG=POSIX --- src/main/ruby/truffleruby/core/dir.rb | 2 +- src/main/ruby/truffleruby/core/env.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/ruby/truffleruby/core/dir.rb b/src/main/ruby/truffleruby/core/dir.rb index 66fc503d9959..4cd66d6c345f 100644 --- a/src/main/ruby/truffleruby/core/dir.rb +++ b/src/main/ruby/truffleruby/core/dir.rb @@ -303,7 +303,7 @@ def glob(pattern, flags = 0, base: nil, sort: true, &block) total = matches.size while index < total - matches[index] = matches[index].encode(enc) unless matches[index].encoding == enc + matches[index] = matches[index].force_encoding(enc) unless matches[index].encoding == enc index += 1 end end diff --git a/src/main/ruby/truffleruby/core/env.rb b/src/main/ruby/truffleruby/core/env.rb index 10e7156d872c..a6b609d462ad 100644 --- a/src/main/ruby/truffleruby/core/env.rb +++ b/src/main/ruby/truffleruby/core/env.rb @@ -366,7 +366,11 @@ def set_encoding(value) if Encoding.default_internal && value.ascii_only? value = value.encode Encoding.default_internal, Encoding::LOCALE elsif value.encoding != Encoding::LOCALE - value = value.dup.force_encoding(Encoding::LOCALE) + if Encoding::LOCALE == Encoding::US_ASCII && !value.ascii_only? + value = value.b + else + value = value.dup.force_encoding(Encoding::LOCALE) + end end value.freeze end From b0cae77b5960b1a1053b7c891a8d9f2014b94fcc Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Wed, 18 Jun 2025 15:26:33 +0200 Subject: [PATCH 4/4] Update overlay --- ci.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.jsonnet b/ci.jsonnet index b7bd9b69963c..c7520e4d7ef1 100644 --- a/ci.jsonnet +++ b/ci.jsonnet @@ -10,7 +10,7 @@ # https://github.com/google/jsonnet/releases and compiled. # CONFIGURATION -local overlay = "86462312c58551adf8993c7fbced4963751230d3"; +local overlay = "6f30aacf41a0c15262f890770972e3f74af187e7"; # For debugging: generated builds will be restricted to those listed in # the array. No restriction is applied when it is empty.