summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-10-01 16:23:27 -0400
committerBen Gamari <ben@well-typed.com>2019-10-24 17:39:11 -0400
commit5fe49c6a4ad34957fe23b9cac97eef724c652c0d (patch)
treef0f0076d80ae85cb375c92c7b9cbe16d687698f4
parent6824f29aebd28571db118eb6877ef04eda630871 (diff)
downloadhaskell-wip/T17266.tar.gz
SysTools: Only apply Windows-specific workaround on Windowswip/T17266
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.
-rw-r--r--compiler/main/SysTools/Process.hs8
1 files changed, 7 insertions, 1 deletions
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
-----------------------------------------------------------------------------