summaryrefslogtreecommitdiff
path: root/utils/ghc-cabal
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2019-09-08 23:11:19 +0100
committerTamar Christina <tamar@zhox.com>2019-10-20 16:21:10 +0100
commit4b431f334018eaef2cf36de3316025c68c922915 (patch)
tree7f85d5a1a6bc6d39e9a8c51fe33904ff61461a7e /utils/ghc-cabal
parentc4c9904b324736dc5d190a91418e8d8f564d4104 (diff)
downloadhaskell-4b431f334018eaef2cf36de3316025c68c922915.tar.gz
Windows: Update tarballs to GCC 9.2 and remove MAX_PATH limit.
Diffstat (limited to 'utils/ghc-cabal')
-rw-r--r--utils/ghc-cabal/Main.hs21
1 files changed, 19 insertions, 2 deletions
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index 5827331c9c..0962f9ccde 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -385,7 +385,23 @@ generate directory distdir config_args
fixupRtsLibName x = x
transitiveDepNames = map (display . packageName) transitive_dep_ids
- libraryDirs = forDeps Installed.libraryDirs
+ -- Note [Msys2 path translation bug].
+ -- Msys2 has an annoying bug in their path conversion code.
+ -- Officially anything starting with a drive letter should not be
+ -- subjected to path translations, however it seems to only consider
+ -- E:\\ and E:// to be Windows paths. Mixed mode paths such as E:/
+ -- that are produced here get corrupted.
+ --
+ -- Tamar@Rage /t/translate> ./a.exe -optc-I"E://ghc-dev/msys64/"
+ -- path: -optc-IE://ghc-dev/msys64/
+ -- Tamar@Rage /t/translate> ./a.exe -optc-I"E:ghc-dev/msys64/"
+ -- path: -optc-IE:ghc-dev/msys64/
+ -- Tamar@Rage /t/translate> ./a.exe -optc-I"E:\ghc-dev/msys64/"
+ -- path: -optc-IE:\ghc-dev/msys64/
+ --
+ -- As such, let's just normalize the filepaths which is a good thing
+ -- to do anyway.
+ libraryDirs = map normalise $ forDeps Installed.libraryDirs
-- The mkLibraryRelDir function is a bit of a hack.
-- Ideally it should be handled in the makefiles instead.
mkLibraryRelDir "rts" = "rts/dist/build"
@@ -402,7 +418,8 @@ generate directory distdir config_args
injectDistInstall x | takeBaseName x == "include" = [x, takeDirectory x ++ "/dist-install/build/" ++ takeBaseName x]
injectDistInstall x = [x]
- wrappedIncludeDirs <- wrap $ concatMap injectDistInstall $ forDeps Installed.includeDirs
+ -- See Note [Msys2 path translation bug].
+ wrappedIncludeDirs <- wrap $ map normalise $ concatMap injectDistInstall $ forDeps Installed.includeDirs
let variablePrefix = directory ++ '_':distdir
mods = map display modules