From ad079dcd9baf4be0864a84f101d7ff03705f1555 Mon Sep 17 00:00:00 2001 From: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> Date: Fri, 5 May 2023 18:37:19 +0200 Subject: [PATCH] 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. --- miri | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miri b/miri index ce3fcbba11..7cda995879 100755 --- a/miri +++ b/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`.