Skip to content

Commit

Permalink
miri-script: Transform Windows paths to unix.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
osiewicz committed May 5, 2023
1 parent 9867066 commit 0255998
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion miri
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ if [ -z "$COMMAND" ]; then
fi
shift
# macOS does not have a useful readlink/realpath so we have to use Python instead...
MIRIDIR=$(python3 -c 'import os, sys; print(os.path.dirname(os.path.realpath(sys.argv[1])))' "$0")
MIRIDIR=$(python3 -c 'import pathlib, sys; print(pathlib.Path(sys.argv[1]).resolve().parent.as_posix())' "$0")
# Used for rustc syncs.
JOSH_FILTER=":rev(75dd959a3a40eb5b4574f8d2e23aa6efbeb33573:prefix=src/tools/miri):/src/tools/miri"
# Needed for `./miri bench`.
Expand Down

0 comments on commit 0255998

Please sign in to comment.