From f77486b95144d8d0592934be97ea4763dc38ffe5 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Mon, 16 Nov 2026 23:22:04 +0000 Subject: [PATCH 1/3] Copy libz-1.dll into the MSYS2 Windows runtimes MSYS2's zlib 1.4 package links -lz to libz-1.dll, so Ruby's zlib extension imports that DLL. The package still has a zlib1.dll, but it is a separate legacy build that the extension doesn't use. Copying it left zlib unloadable on Windows in openvox-agent 9.4.0. Fixes #350 Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> --- configs/components/runtime-agent.rb | 4 ++-- configs/components/runtime-openbolt.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configs/components/runtime-agent.rb b/configs/components/runtime-agent.rb index 0bc871d1..b731e4ee 100644 --- a/configs/components/runtime-agent.rb +++ b/configs/components/runtime-agent.rb @@ -34,8 +34,8 @@ "#{settings[:bindir]}/libwinpthread-1.dll" # Used by the zlib default gem. - pkg.install_file "#{settings[:gcc_bindir]}/zlib1.dll", - "#{settings[:bindir]}/zlib1.dll" + pkg.install_file "#{settings[:gcc_bindir]}/libz-1.dll", + "#{settings[:bindir]}/libz-1.dll" end end end diff --git a/configs/components/runtime-openbolt.rb b/configs/components/runtime-openbolt.rb index a7775324..2a408fb1 100644 --- a/configs/components/runtime-openbolt.rb +++ b/configs/components/runtime-openbolt.rb @@ -19,7 +19,7 @@ # Matches what the ruby-lang.org builds copy into ruby_builtin_dlls pkg.install_file "#{settings[:gcc_bindir]}/libgmp-10.dll", "#{settings[:bindir]}/libgmp-10.dll" pkg.install_file "#{settings[:gcc_bindir]}/libwinpthread-1.dll", "#{settings[:bindir]}/libwinpthread-1.dll" - pkg.install_file "#{settings[:gcc_bindir]}/zlib1.dll", "#{settings[:bindir]}/zlib1.dll" + pkg.install_file "#{settings[:gcc_bindir]}/libz-1.dll", "#{settings[:bindir]}/libz-1.dll" end end end From 8874c9fea4aa269d56d8dad1287c376e4ddc0a74 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Tue, 17 Nov 2026 00:47:39 +0000 Subject: [PATCH 2/3] Stop building Ruby's readline extension on Cygwin Ruby 3.2 built readline.so against Cygwin's mingw readline, but the runtime never contained libreadline7.dll, so the extension could not load and readline.rb fell back to Reline. Without the readline package the extension isn't built and Reline is used the same way. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> --- configs/platforms/windows-all-x64.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/configs/platforms/windows-all-x64.rb b/configs/platforms/windows-all-x64.rb index a61c23cd..1cfa67a2 100644 --- a/configs/platforms/windows-all-x64.rb +++ b/configs/platforms/windows-all-x64.rb @@ -22,7 +22,6 @@ 'mingw64-x86_64-gcc-g++', 'mingw64-x86_64-gdbm', 'mingw64-x86_64-libffi', - 'mingw64-x86_64-readline', 'mingw64-x86_64-zlib', 'ruby', 'ruby-devel', From 04c44596b6405d0b0103160b5ff24594e69cde47 Mon Sep 17 00:00:00 2001 From: nmburgan <13688219+nmburgan@users.noreply.github.com> Date: Tue, 17 Nov 2026 00:47:43 +0000 Subject: [PATCH 3/3] Fail Windows builds that import unshipped toolchain DLLs A DLL from the build toolchain loads during the build, where the toolchain's bin directory is on PATH, so a runtime that leaves one out still builds and only fails on other machines. That is how the 2026.11.12.1 runtime shipped a zlib.so that needs libz-1.dll. After the vanagon build, check every packaged binary with objdump and abort when it imports a DLL that is in the toolchain's bin directory but not in the package. Signed-off-by: nmburgan <13688219+nmburgan@users.noreply.github.com> --- tasks/build.rake | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tasks/build.rake b/tasks/build.rake index 89cc7019..c2c8945b 100644 --- a/tasks/build.rake +++ b/tasks/build.rake @@ -1,5 +1,25 @@ require 'fileutils' +# Returns the imports of toolchain DLLs that the package doesn't contain. They +# load during the build, where the toolchain is on PATH, and nowhere else. +def unshipped_toolchain_dlls(package_dir, toolchain_bindir) + binaries = Dir.glob("#{package_dir}/**/*.{dll,so,exe}") + abort "Found no binaries to check under #{package_dir}" if binaries.empty? + + shipped = binaries.map { |binary| File.basename(binary).downcase } + puts "Checking the DLL imports of #{binaries.size} binaries against #{toolchain_bindir}" + binaries.flat_map do |binary| + output, status = Open3.capture2('objdump', '-p', binary) + abort "Could not read the imports of #{binary} with objdump" unless status.success? + + output.scan(/DLL Name: (\S+)/).flatten.filter_map do |dll| + next if shipped.include?(dll.downcase) || !File.exist?(File.join(toolchain_bindir, dll)) + + "#{binary} imports #{dll}" + end + end +end + namespace :vox do desc 'Build vanagon project with Docker' task :build, [:project, :platform] do |_, args| @@ -24,5 +44,11 @@ namespace :vox do FileUtils.rm_rf('C:/ProgramFiles64Folder/') if platform =~ /^windows-/ run_command(cmd, silent: false, print_command: true, report_status: true) + + next unless platform =~ /^windows-/ + + toolchain_bindir = platform =~ /^windows-msys2-/ ? '/ucrt64/bin' : '/usr/x86_64-w64-mingw32/sys-root/mingw/bin' + unshipped = unshipped_toolchain_dlls('C:/ProgramFiles64Folder', toolchain_bindir) + abort "These binaries import DLLs that are not in the package:\n#{unshipped.join("\n")}" unless unshipped.empty? end end