Make nmake benchmark work on mswin

The `benchmark` recipe collected files with `$(find ... | sort)`,
which cmd.exe cannot interpret, so `nmake benchmark` failed with
`'sort)' is not recognized`.  Select the files with Ruby instead so
the recipe works regardless of the shell, and pass the executables
with forward slashes for benchmark-driver's Shellwords splitting.
This commit is contained in:
Hiroshi SHIBATA committed 2026-07-13 15:04:42 +09:00
1 parent 97fec3da7e
commit c2243efe69
2 files changed
+16 -8
Notes: git 2026-07-13 06:05:12 +00:00

No files matched your search

+1 -2
View File
@@ -62,8 +62,7 @@ make benchmark ITEM=vm
# Run some limited benchmarks in ITEM-matched files
make benchmark ITEM=vm OPTS=--filter=block
# You can specify the benchmark by an exact filename instead of using the default argument:
# ARGS = $$(find $(srcdir)/benchmark -maxdepth 1 -name '*$(ITEM)*.yml' -o -name '*$(ITEM)*.rb')
# You can specify the benchmark by exact filenames instead of matching ITEM:
make benchmark ARGS=benchmark/erb_render.yml
# You can specify any option via $OPTS
+15 -6
View File
@@ -1440,15 +1440,24 @@ COMPARE_RUBY = $(BASERUBY)
BENCH_RUBY = $(RUNRUBY)
BENCH_OPTS = --output=markdown --output-compare -v
ITEM =
ARGS = $$(find $(srcdir)/benchmark -maxdepth 1 -name '$(ITEM)' -o -name '*$(ITEM)*.yml' -o -name '*$(ITEM)*.rb' | sort)
ARGS =
OPTS =
# See benchmark/README.md for details.
# Select the benchmark files with Ruby instead of `find | sort`, so the
# recipe runs on any platform regardless of the shell. When ARGS is
# empty, collect the files matching ITEM under benchmark/. Executables
# are passed with forward slashes because benchmark-driver splits them
# with Shellwords, which eats backslashes. See benchmark/README.md.
benchmark: miniruby$(EXEEXT) update-benchmark-driver PHONY
$(BASERUBY) -rrubygems -I$(srcdir)/benchmark/lib $(srcdir)/benchmark/benchmark-driver/exe/benchmark-driver \
--executables="compare-ruby::$(COMPARE_RUBY) -I$(EXTOUT)/common --disable-gem" \
--executables="built-ruby::$(BENCH_RUBY) --disable-gem" \
$(BENCH_OPTS) $(ARGS) $(OPTS)
$(BASERUBY) -rrubygems -I$(srcdir)/benchmark/lib \
-e "files = %w[$(ARGS)]" \
-e "files = Dir.glob(['$(ITEM)', '*$(ITEM)*.yml', '*$(ITEM)*.rb'], base: '$(srcdir)/benchmark').reject(&:empty?).sort.uniq.map {|f| '$(srcdir)/benchmark/' + f} if files.empty?" \
-e "ARGV.map! {|a| a.start_with?('--executables') ? a.gsub(92.chr, '/') : a}" \
-e "ARGV.concat(files)" \
-e "load '$(srcdir)/benchmark/benchmark-driver/exe/benchmark-driver'" -- \
--executables="compare-ruby::$(COMPARE_RUBY) -I$(EXTOUT)/common --disable-gem" \
--executables="built-ruby::$(BENCH_RUBY) --disable-gem" \
$(BENCH_OPTS) $(OPTS)
run.gdb:
echo set breakpoint pending on > run.gdb