Skip to content

Commit ad079dc

Browse files
osiewiczRalfJung
authored andcommitted
miri-script: Transform Windows paths to unix.
python3 snippet used to fill $MIRIDIR variable returns native paths. Down the line in `bench` subcommand this leads to benchmark setup failure, preventing contributors from running benchmarks on Windows hosts. This commit replaces usage of native os.path module with pathlib, which explicitly converts paths to Unix flavour.
1 parent 62175e9 commit ad079dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

miri

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ if [ -z "$COMMAND" ]; then
7777
fi
7878
shift
7979
# macOS does not have a useful readlink/realpath so we have to use Python instead...
80-
MIRIDIR=$(python3 -c 'import os, sys; print(os.path.dirname(os.path.realpath(sys.argv[1])))' "$0")
80+
MIRIDIR=$(python3 -c 'import pathlib, sys; print(pathlib.Path(sys.argv[1]).resolve().parent.as_posix())' "$0")
8181
# Used for rustc syncs.
8282
JOSH_FILTER=":rev(75dd959a3a40eb5b4574f8d2e23aa6efbeb33573:prefix=src/tools/miri):/src/tools/miri"
8383
# Needed for `./miri bench`.

0 commit comments

Comments
 (0)