diff options
author | Tamar Christina <tamar@zhox.com> | 2020-08-16 17:18:14 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-28 02:23:13 -0400 |
commit | f065b6b012fb8f73689bc5c2a4904d5e6e377af8 (patch) | |
tree | 46d9289744458c7e6d97234772d5bf134590c53e /compiler | |
parent | c6f50cea42a9ffc947bf4243986663cc820b0ec8 (diff) | |
download | haskell-f065b6b012fb8f73689bc5c2a4904d5e6e377af8.tar.gz |
Fix use distro toolchian
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/GHC/SysTools/BaseDir.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/GHC/SysTools/BaseDir.hs b/compiler/GHC/SysTools/BaseDir.hs index e5b0c7ca61..31077451d7 100644 --- a/compiler/GHC/SysTools/BaseDir.hs +++ b/compiler/GHC/SysTools/BaseDir.hs @@ -79,7 +79,7 @@ $topdir/../../{mingw, perl}/. -- | Expand occurrences of the @$tooldir@ interpolation in a string -- on Windows, leave the string untouched otherwise. expandToolDir :: Maybe FilePath -> String -> String -#if defined(mingw32_HOST_OS) +#if defined(mingw32_HOST_OS) && !defined(USE_INPLACE_MINGW_TOOLCHAIN) expandToolDir (Just tool_dir) s = expandPathVar "tooldir" tool_dir s expandToolDir Nothing _ = panic "Could not determine $tooldir" #else @@ -117,10 +117,11 @@ tryFindTopDir Nothing -- Returns @Nothing@ when not on Windows. -- When called on Windows, it either throws an error when the -- tooldir can't be located, or returns @Just tooldirpath@. +-- If the distro toolchain is being used we treat Windows the same as Linux findToolDir :: FilePath -- ^ topdir -> IO (Maybe FilePath) -#if defined(mingw32_HOST_OS) +#if defined(mingw32_HOST_OS) && !defined(USE_INPLACE_MINGW_TOOLCHAIN) findToolDir top_dir = go 0 (top_dir </> "..") where maxDepth = 3 go :: Int -> FilePath -> IO (Maybe FilePath) |