GHC command invocation debug output not in correct format for cmd.exe
|Reported by:||ezyang||Owned by:|
|Type of failure:||None/Unknown||Difficulty:|
|Test Case:||Blocked By:|
A frequent operation when debugging a misbehaving GHC build is manually performing an invocation that GHC made to some external process. To aid this, -v3 prints out the command that GHC invoked.
Ideally, we would like to be able to copy paste this printed command to our terminal and have it work correctly (with temporary files kept and such.) However, the output for Windows is quite misleading. Consider the following command:
C:\Program Files\Haskell Platform\2010.2.0.0\lib\..\mingw\bin\windres --preprocessor="C:\Program Files\Haskell Platform\2010.2.0.0\lib\..\mingw\bin\gcc" "-E" "-xc" "-DRC_INVOKED" --use-temp-file --input=C:\Users\ezyang\ghc672_0\ghc672_0.rc --output=C:\Users\ezyang\ghc672_0\ghc672_0.o --output-format=coff
The primary problem is that arguments are not escaped or quoted. This is seen in the executable path in this command, which has a space in it.
This is a major usability bug when command line arguments contain argments in them. For example, -E is meant as a flag to gcc, not windres. However, the printed command line is quite misleading.
This should be relatively easy to fix.