about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPiotr Osiewicz <24362066+osiewicz@users.noreply.github.com>2023-05-05 18:37:19 +0200
committerRalf Jung <post@ralfj.de>2023-05-31 11:36:49 +0200
commit91cb951ee908a35ab1050876e62411698cb2cc84 (patch)
tree1ebfe420bcb635ed8cafcd3b4d3bf045054bcf23
parentbfc897ec07eece6a180c2279bc470d08d6f2e23e (diff)
downloadrust-91cb951ee908a35ab1050876e62411698cb2cc84.tar.gz
rust-91cb951ee908a35ab1050876e62411698cb2cc84.zip
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.
-rwxr-xr-xsrc/tools/miri/miri2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/miri/miri b/src/tools/miri/miri
index ce3fcbba118..7cda995879c 100755
--- a/src/tools/miri/miri
+++ b/src/tools/miri/miri
@@ -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`.