From 2cd336b9266a3bb12949e5d1aedf577e4587a84c Mon Sep 17 00:00:00 2001 From: Andy Kopra Date: Tue, 28 Jul 2026 23:53:35 +0200 Subject: [PATCH] fix(tst): resolve the temp directory in modulepath_test.sh (macOS) Case 5 of the module-resolution suite failed on macOS only, because /var is a symlink to /private/var there: `mktemp -d` returns an unresolved path while Python's os.getcwd() reports the resolved one, so the test compared two spellings of the same directory. Resolving the temp directory once at creation with `pwd -P` makes every path in the suite consistent. (from dev ca9eaa2c867a) --- README.md | 2 +- tst/modulepath_test.sh | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 14c4145..1e2c724 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ are regenerated on each release — patches cannot be merged directly. Report problems (or send patches) to the author; accepted changes are applied to the development tree and appear in a following snapshot. -This snapshot was assembled from development commit `6024f49c2859`. +This snapshot was assembled from development commit `ca9eaa2c867a`. ## License diff --git a/tst/modulepath_test.sh b/tst/modulepath_test.sh index 04bb59e..1faeecf 100755 --- a/tst/modulepath_test.sh +++ b/tst/modulepath_test.sh @@ -31,7 +31,13 @@ green=$'\033[32m' bold=$'\033[1m' reset=$'\033[0m' -T="$(mktemp -d)" +# Resolve the temporary directory to its physical path. On macOS /var is a +# symlink to /private/var, so `mktemp -d` hands back an unresolved +# /var/folders/... while Python's os.getcwd() reports the resolved +# /private/var/folders/... — case 5 would then compare two spellings of the +# same directory and fail on the Mac only. `pwd -P` is POSIX; macOS has no +# GNU realpath by default. +T="$(cd "$(mktemp -d)" && pwd -P)" trap 'rm -rf "$T"' EXIT mkdir -p "$T/seta" "$T/setb" "$T/elsewhere"