From 3b65655c4cef5407829ed41707c48be2f8b3b340 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 1 Oct 2019 16:23:27 -0400 Subject: SysTools: Only apply Windows-specific workaround on Windows Issue #1110 was apparently due to a bug in Vista which prevented GCC from finding its binaries unless we explicitly added it to PATH. However, this workaround was incorrectly applied on non-Windows platforms as well, resulting in ill-formed PATHs (#17266). Fixes #17266. --- compiler/main/SysTools/Process.hs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/compiler/main/SysTools/Process.hs b/compiler/main/SysTools/Process.hs index 2e0e502b63..7ad2cf2f53 100644 --- a/compiler/main/SysTools/Process.hs +++ b/compiler/main/SysTools/Process.hs @@ -83,16 +83,22 @@ getGccEnv opts = if null b_dirs then return Nothing else do env <- getEnvironment - return (Just (map mangle_path env)) + return (Just (mangle_paths env)) where (b_dirs, _) = partitionWith get_b_opt opts get_b_opt (Option ('-':'B':dir)) = Left dir get_b_opt other = Right other + -- Work around #1110 on Windows only (lest we stumble into #17266). +#if defined(mingw32_HOST_OS) + mangle_paths = map mangle_path mangle_path (path,paths) | map toUpper path == "PATH" = (path, '\"' : head b_dirs ++ "\";" ++ paths) mangle_path other = other +#else + mangle_paths = id +#endif ----------------------------------------------------------------------------- -- cgit v1.2.1