diff options
| author | Étienne Barrié <etienne.barrie@gmail.com> | 2026-02-12 12:06:32 +0100 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2026-02-12 15:26:16 +0100 |
| commit | 727b99f9c5dca7ee8d6529171d3e0754855f5fb7 (patch) | |
| tree | dc7538c020d99c00cbe3f48ab4e855e4d389c71b | |
| parent | c251767fbeacc95963a1c68feed976e8d492d3fc (diff) | |
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.
| -rwxr-xr-x | enc/make_encmake.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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) |
