'backslash' build problems on windows

I am having some problems with the latest builds of GHC on windows. For some reason ghc has decided to use backslashes in filenames. This leads to problems when building the stage libraries and the stage 2 compiler. I run the scripts from a mingw bash shell. The following problems occur: - Warnings: .../ghc3228_0/ghc3228_0.lpp:1: warning: unknown escape sequence '\B' these are caused by the #line directive in the preprocessed file, something like #line 1 ".\basicTypes/BasicTypes.lhs" - When building the dependencies (in dist/build/.depend) become something like: dist/build\GHC/PrimopWrappers.o : .\GHC/PrimopWrappers.hs make then ignores these dependencies and tries to build the wrong files. - When testing, some unexpected failures occur, because the error message says ".\Something.hs" instead of "Something.hs". The solution to all these problems is to use a '/' instead of a '\'. I suspect the problem was caused by the patch: Sat Jan 12 18:28:37 W. Europe Standard Time 2008 Ian Lynagh * FilePath fixes Twan

Twan van Laarhoven wrote:
I am having some problems with the latest builds of GHC on windows. For some reason ghc has decided to use backslashes in filenames. This leads to problems when building the stage libraries and the stage 2 compiler. I run the scripts from a mingw bash shell.
After further investigation, it seems the problems are caused by using (>) instead of joinFileName. These functions differ in two ways: 1. "." as a directory name is no longer ignored "." > "x" == "./x" /= "x" == "." `joinFileName` "x" this (among other things) changes compiler messages: -[1 of 4] Compiling OverA ( OverA.hs, OverA.o ) -[2 of 4] Compiling OverB ( OverB.hs, OverB.o ) -[3 of 4] Compiling OverC ( OverC.hs, OverC.o ) +[1 of 4] Compiling OverA ( .\OverA.hs, .\OverA.o ) +[2 of 4] Compiling OverB ( .\OverB.hs, .\OverB.o ) +[3 of 4] Compiling OverC ( .\OverC.hs, .\OverC.o ) 2. a backslash is used on windows instead of a slash. Some things explicitly exect a slash to be used on windows as well: a. main/DriverPipeline.hs:1511: -- We hackily use Option instead of FileOption here, so that the file -- name is not back-slashed on Windows. cpp is capable of -- dealing with / in filenames, so it works fine. Furthermore -- if we put in backslashes, cpp outputs #line directives -- with *double* backslashes. And that in turn means that -- our error messages get double backslashes in them. -- In due course we should arrange that the lexer deals -- with these \\ escapes properly. b. gnu make wants slashes, filenames containing backslashes are outputed through DriverMkDepend. 1 is a minor problem it just requires some test cases to be changed. On the other hand, adding "./" everywhere is needless clutter. 2a results in some warnings, 2b is a big problem, breaking the build on windows. The only good solution I see is to switch back to joinFileName or an equivalent function. Twan

Hi
this (among other things) changes compiler messages: -[1 of 4] Compiling OverA ( OverA.hs, OverA.o ) -[2 of 4] Compiling OverB ( OverB.hs, OverB.o ) -[3 of 4] Compiling OverC ( OverC.hs, OverC.o ) +[1 of 4] Compiling OverA ( .\OverA.hs, .\OverA.o ) +[2 of 4] Compiling OverB ( .\OverB.hs, .\OverB.o ) +[3 of 4] Compiling OverC ( .\OverC.hs, .\OverC.o )
Before displaying a FilePath, it is advisable to call normalise on it, which will attempt to reformat it in a manner more pleasing to a human. This will fix that bug.
2. a backslash is used on windows instead of a slash. Some things explicitly exect a slash to be used on windows as well:
I recommend a "reslash" command, invoked just before each of these actions. This way its explicitly clear exactly where slash directions matters. Thanks Neil

On Tue, Jan 15, 2008 at 10:57:14PM +0100, Twan van Laarhoven wrote:
I am having some problems with the latest builds of GHC on windows.
Hmm, I thought I'd tested those patches on Windows, but I guess I was mistaken. Thanks for the info, I'll take a look. Sorry for any inconvenience caused! Thanks Ian
participants (3)
-
Ian Lynagh
-
Neil Mitchell
-
Twan van Laarhoven