diff options
author | Larry Ewing <lewing@microsoft.com> | 2020-03-11 02:53:53 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 02:53:53 +0300 |
commit | 10cf3041d692c83e685442d9d269a2d59d351f6a (patch) | |
tree | 9dcfe2b70ed2892d92dd87b62d6c74705805d42c /sdks | |
parent | 488da04761f74c3bde5ac52d04454425b27ffdd6 (diff) |
[wasm][packager] add option to pull from a different runtime directory (#19178)
Diffstat (limited to 'sdks')
-rw-r--r-- | sdks/wasm/packager.cs | 14 | ||||
-rwxr-xr-x | sdks/wasm/standalone-benchmarks/run-benchmark-wasm.sh | 23 |
2 files changed, 31 insertions, 6 deletions
diff --git a/sdks/wasm/packager.cs b/sdks/wasm/packager.cs index 8e60d9c176b..3f695115f07 100644 --- a/sdks/wasm/packager.cs +++ b/sdks/wasm/packager.cs @@ -418,6 +418,7 @@ class Driver { var netcore_sdkdir = ""; string coremode, usermode; string aot_profile = null; + string wasm_runtime_path = null; var opts = new WasmOptions () { AddBinding = true, @@ -443,6 +444,7 @@ class Driver { { "emscripten-sdkdir=", s => emscripten_sdkdir = s }, { "netcore-sdkdir=", s => netcore_sdkdir = s }, { "prefix=", s => app_prefix = s }, + { "wasm-runtime-path=", s => wasm_runtime_path = s }, { "deploy=", s => deploy_prefix = s }, { "vfs=", s => vfs_prefix = s }, { "aot", s => ee_mode = ExecMode.Aot }, @@ -712,15 +714,19 @@ class Driver { File.Delete (config_js); File.WriteAllText (config_js, config); + + if (wasm_runtime_path == null) + wasm_runtime_path = Path.Combine (tool_prefix, "builds"); + string wasm_runtime_dir; if (is_netcore) - wasm_runtime_dir = Path.Combine (tool_prefix, "builds", use_release_runtime ? "netcore-release" : "netcore-debug"); + wasm_runtime_dir = Path.Combine (wasm_runtime_path, use_release_runtime ? "netcore-release" : "netcore-debug"); else if (enable_threads) - wasm_runtime_dir = Path.Combine (tool_prefix, "builds", use_release_runtime ? "threads-release" : "threads-debug"); + wasm_runtime_dir = Path.Combine (wasm_runtime_path, use_release_runtime ? "threads-release" : "threads-debug"); else if (enable_dynamic_runtime) - wasm_runtime_dir = Path.Combine (tool_prefix, "builds", use_release_runtime ? "dynamic-release" : "dynamic-debug"); + wasm_runtime_dir = Path.Combine (wasm_runtime_path, use_release_runtime ? "dynamic-release" : "dynamic-debug"); else - wasm_runtime_dir = Path.Combine (tool_prefix, "builds", use_release_runtime ? "release" : "debug"); + wasm_runtime_dir = Path.Combine (wasm_runtime_path, use_release_runtime ? "release" : "debug"); if (!emit_ninja) { var interp_files = new List<string> { "dotnet.js", "dotnet.wasm" }; if (enable_threads) { diff --git a/sdks/wasm/standalone-benchmarks/run-benchmark-wasm.sh b/sdks/wasm/standalone-benchmarks/run-benchmark-wasm.sh index 31417e53c70..3e96c11bd4f 100755 --- a/sdks/wasm/standalone-benchmarks/run-benchmark-wasm.sh +++ b/sdks/wasm/standalone-benchmarks/run-benchmark-wasm.sh @@ -4,12 +4,31 @@ set -x set -u function realpath { echo $(cd $(dirname ${1}); pwd)/$(basename ${1}); } -BENCHMARK=$(basename $1) + +RUNTIME_DIR="../builds" +BENCHMARK="" +while (( "$#" )); do + case "$1" in + --wasm-runtime-path=*) + RUNTIME_DIR="${1#*=}" + shift + ;; + -*|--*=) + echo "Unknown argument $1" >&2 + exit 1 + ;; + *) + BENCHMARK=$(basename $1) + shift + ;; + esac +done PACKAGER=$(realpath ../packager.exe) SRC_DIR=$(realpath $BENCHMARK/bin/Debug/netcoreapp2.1) TEMPLATE_PATH=$(realpath ../runtime.js) +echo "Using runtime $RUNTIME_DIR" dotnet build $BENCHMARK -mono --debug $PACKAGER --out=wasm/$BENCHMARK $SRC_DIR/$BENCHMARK.dll --template=$TEMPLATE_PATH +mono --debug $PACKAGER --wasm-runtime-path=$RUNTIME_DIR --out=wasm/$BENCHMARK $SRC_DIR/$BENCHMARK.dll --template=$TEMPLATE_PATH node test-runner.js $BENCHMARK wasm/$BENCHMARK |