Skip to content

Commit db36ab2

Browse files
mkustermannCommit Queue
authored andcommitted
[dart2wasm] Make pkg/dart2wasm/tool/run_benchmark work on MacOS
It seems `realpath` isn't available on stock MacOS always (and may require `homebrew install coreutils`). So we switch to using a custom version. Closes #61226 Change-Id: I8f9fe990346a0d8b93903b02688b704273212ee9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443260 Reviewed-by: Ömer Ağacan <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent fc16a52 commit db36ab2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/dart2wasm/tool/run_benchmark

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ function follow_links() {
1717
echo "$file"
1818
}
1919

20+
function get_realpath() {
21+
file="$1"
22+
if [ -f "$file" ]; then
23+
file="$(cd $(dirname "$file"); pwd -P)/$(basename "$file")"
24+
fi
25+
echo $(follow_links "$file")
26+
}
27+
2028
# Unlike $0, $BASH_SOURCE points to the absolute path of this file.
2129
PROG_NAME="$(follow_links "$BASH_SOURCE")"
2230

@@ -89,7 +97,7 @@ while [ $# -gt 0 ]; do
8997
*.wasm)
9098
if [ -z "$WASM_FILE" ]; then
9199
# First wasm file is the actual dart program
92-
WASM_FILE="$(realpath "$1")"
100+
WASM_FILE="$(get_realpath "$1")"
93101
MJS_FILE="${WASM_FILE%.wasm}.mjs"
94102
else
95103
# Following wasm files are imported linear memory modules

0 commit comments

Comments
 (0)