Skip to content

Commit f5e3f8d

Browse files
authored
[wasm] Fix scripts to track change in BDN (#3344)
* [wasm] Fix scripts to track change in BDN `dotnet/performance` got an update for `dotnet/BenchmarkDotNet` via #3331 . And that bdn update includes dotnet/BenchmarkDotNet#2375, which subtly changes how the arguments get parsed, and breaks the existing scripts: ``` $ pushd "/home/helixbot/work/B807097D/w/AED609DF/e/performance/artifacts/bin/for-running/MicroBenchmarks" $ dotnet exec MicroBenchmarks.dll --wasmArgs "--experimental-wasm-eh --expose_wasm --module" ... MicroBenchmarks 1.0.0-dev © Microsoft Corporation. All rights reserved. ERROR(S): Option 'experimental-wasm-eh --expose_wasm --module' is unknown. ``` Related: dotnet/runtime#92066 . * address feedback, and add comments
1 parent 5541ca8 commit f5e3f8d

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

scripts/benchmarks_local.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,24 +388,28 @@ def generate_single_benchmark_ci_args(parsed_args: Namespace, specific_run_type:
388388
# for commit in all_commits: There is not a way to run multiple Wasm's at once via CI, instead will split single run vs multi-run scenarios
389389
elif specific_run_type == RunType.WasmInterpreter:
390390
benchmark_ci_args += ['--wasm']
391+
# Ensure there is a space at the beginning of `--wasmArgs` argument, so BDN
392+
# can correctly read them as sub-arguments for `--wasmArgs`
391393
bdn_args_unescaped += [
392394
'--anyCategories', 'Libraries', 'Runtime',
393395
'--category-exclusion-filter', 'NoInterpreter', 'NoWASM', 'NoMono',
394396
'--wasmDataDir', os.path.join(get_run_artifact_path(parsed_args, RunType.WasmInterpreter, commit), "wasm_bundle", "wasm-data"),
395397
'--wasmEngine', parsed_args.wasm_engine_path,
396-
'--wasmArgs', '\"--experimental-wasm-eh --expose_wasm --module\"',
398+
'--wasmArgs', '\" --experimental-wasm-eh --expose_wasm --module\"',
397399
'--logBuildOutput',
398400
'--generateBinLog'
399401
]
400402

401403
elif specific_run_type == RunType.WasmAOT:
402404
benchmark_ci_args += ['--wasm']
405+
# Ensure there is a space at the beginning of `--wasmArgs` argument, so BDN
406+
# can correctly read them as sub-arguments for `--wasmArgs`
403407
bdn_args_unescaped += [
404408
'--anyCategories', 'Libraries', 'Runtime',
405409
'--category-exclusion-filter', 'NoInterpreter', 'NoWASM', 'NoMono',
406410
'--wasmDataDir', os.path.join(get_run_artifact_path(parsed_args, RunType.WasmAOT, commit), "wasm_bundle", "wasm-data"),
407411
'--wasmEngine', parsed_args.wasm_engine_path,
408-
'--wasmArgs', '\"--experimental-wasm-eh --expose_wasm --module\"',
412+
'--wasmArgs', '\" --experimental-wasm-eh --expose_wasm --module\"',
409413
'--aotcompilermode', 'wasm',
410414
'--logBuildOutput',
411415
'--generateBinLog'
@@ -622,4 +626,4 @@ def __main(args: list):
622626
# TODO: Compare the results of the benchmarks with results comparer (Currently will need to be done manually)
623627

624628
if __name__ == "__main__":
625-
__main(sys.argv[1:])
629+
__main(sys.argv[1:])

scripts/performance_setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,10 @@ def run(args: PerformanceSetupArgs):
256256
if args.wasm_bundle_directory is not None:
257257
wasm_bundle_directory_path = payload_directory
258258
shutil.copytree(args.wasm_bundle_directory, wasm_bundle_directory_path)
259-
260-
wasm_args = "--experimental-wasm-eh --expose_wasm"
259+
260+
# Ensure there is a space at the beginning, so BDN can correctly read them
261+
# as arguments to `--wasmArgs`
262+
wasm_args = " --experimental-wasm-eh --expose_wasm"
261263

262264
if args.javascript_engine == "v8":
263265
wasm_args += " --module"
@@ -359,4 +361,4 @@ def run(args: PerformanceSetupArgs):
359361
helix_source_prefix=helix_source_prefix,
360362
build_config=build_config,
361363
runtime_type=runtime_type,
362-
only_sanity_check=args.only_sanity_check)
364+
only_sanity_check=args.only_sanity_check)

0 commit comments

Comments
 (0)