From 727b99f9c5dca7ee8d6529171d3e0754855f5fb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20Barri=C3=A9?= Date: Thu, 12 Feb 2026 12:06:32 +0100 Subject: Avoid loading source cgi/escape.rb with baseruby in enc/make_encmake.rb Only add the source lib directory to $LOAD_PATH when running with miniruby, which needs it for the standard library (erb, fileutils, etc.). When running with baseruby (detected via CROSS_COMPILING defined by fake.rb), its own stdlib is already available and adding the source lib causes warnings with -w due to loading both baseruby's cgi/escape.so and the source cgi/escape.rb via erb. --- enc/make_encmake.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/enc/make_encmake.rb b/enc/make_encmake.rb index 4be5c42888..e5ed4eb4b5 100755 --- a/enc/make_encmake.rb +++ b/enc/make_encmake.rb @@ -1,7 +1,11 @@ #! ./miniruby dir = File.expand_path("../..", __FILE__) -$:.unshift(Dir.pwd, "#{dir}/tool/lib", "#{dir}/lib") +# The source lib directory provides the standard library for miniruby. +# Don't add it when running with baseruby to avoid loading both +# baseruby's cgi/escape.so and source cgi/escape.rb via erb. +$:.unshift("#{dir}/lib") unless defined?(CROSS_COMPILING) +$:.unshift(Dir.pwd, "#{dir}/tool/lib") if $".grep(/mkmf/).empty? $" << "mkmf.rb" load File.expand_path("lib/mkmf.rb", dir) -- cgit v1.2.3