From bc583b9a66a3399e330e15a3013c09b674af394b Mon Sep 17 00:00:00 2001 From: wefio <48851810+wefio@users.noreply.github.com> Date: Tue, 4 Aug 2026 21:59:31 +0800 Subject: [PATCH] fix: OMNIMEMEVAL_ENV_FILE path format on Windows/git-bash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit extract_env_arg builds the env-file path with plain 'pwd', which in git-bash (MSYS2) emits POSIX paths (/c/...). Native Windows Python then silently fails to open them — python-dotenv's load_dotenv returns False without raising — so NMG_ROOT/ANSWER_MODEL etc. are never loaded and every run_*_eval.sh silently runs with missing config. MSYS2 auto-converts command-line arguments to Windows paths but NOT environment variables, and the env-file path crosses bash -> python via an env var, so it stays in POSIX form. Fix: pwd -W 2>/dev/null || pwd - pwd -W (MSYS extension) emits Windows paths (C:/...) that Windows Python can open. - On Linux/macOS/WSL, pwd -W fails, the error is swallowed, and plain pwd runs — behaviour is unchanged. Cross-platform, no WSL dependency. Applies to both injection points: --env and --replay env-file paths. --- scripts/_experiment_utils.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/_experiment_utils.sh b/scripts/_experiment_utils.sh index aecc9dc..df485a8 100755 --- a/scripts/_experiment_utils.sh +++ b/scripts/_experiment_utils.sh @@ -45,7 +45,7 @@ extract_env_arg() { echo "Error: --env requires a file path" exit 1 fi - OMNIMEMEVAL_ENV_FILE="$(cd "$(dirname "$2")" && pwd)/$(basename "$2")" + OMNIMEMEVAL_ENV_FILE="$(cd "$(dirname "$2")" && pwd -W 2>/dev/null || pwd)/$(basename "$2")" if [[ ! -f "$OMNIMEMEVAL_ENV_FILE" ]]; then echo "Error: env file not found: $OMNIMEMEVAL_ENV_FILE" exit 1 @@ -310,7 +310,7 @@ try_replay() { echo " Use: ./scripts/$SCRIPT_NAME --env --replay $replay_dir" exit 1 fi - OMNIMEMEVAL_ENV_FILE="$(cd "$(dirname "$candidate_env")" && pwd)/$(basename "$candidate_env")" + OMNIMEMEVAL_ENV_FILE="$(cd "$(dirname "$candidate_env")" && pwd -W 2>/dev/null || pwd)/$(basename "$candidate_env")" export OMNIMEMEVAL_ENV_FILE echo "Using inferred env file: $OMNIMEMEVAL_ENV_FILE" fi