-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lexical error at character '\n' #7
Comments
What platform? What version of ghc? What locale settings? I cannot reproduce on MacOS X with ghc-7.6.1: $ ghc -cpp -pgmPcpphs -optP--cpp asr.hs
[1 of 1] Compiling Main ( asr.hs, asr.o )
Linking asr …
$ cpphs --version
cpphs 1.20.2 |
Debian Wheezy x86_64 with multiarch, GHC 8.0.1. Locale:
I used to have exactly the same problem on OpenSUSE with GHC 7.10.3. |
The issue was reported in the Agda mailing list a couple of years ago. I have not been able to reproduce the problem using various versions of GHC and cpphs in Ubuntu. |
Is there any way you can capture the output of cpphs before it gets to ghc, so we can examine what is the mysterious character at line 0, columns 1, preceding the unexpected newline at column 2? My suspicion is that it might be a byte-order mark. Since cpphs is not intentionally introducing a BOM, it could be that the ghc + locale + platform which which cpphs is compiled, is responsible for introducing a BOM, and then the ghc which consumes the output is unprepared for it. |
@jstolarek What about
or using the
? |
@asr, using the first set of commands I get a file that looks like this: #line 1 "Test.hs"
module Main where
foo = 42
main = print foo This file compiles without problems. Using the |
OK, so the line that is giving ghc trouble is the one starting
continuing with many spaces, and for which there is no terminating double-quote. When I run ghc -cpp -pgmPcpphs -optP--cpp -E, I do not see the same output as yours, and in particular this line mentioning sandboxes, with the missing quote terminator, is absent. |
On my machine I have several GHC installation installed in the directory My guess would be that the problem might be caused by handling of symlinks. |
FWIF, I have several versions installed of GHC and I use
In my machine, that line is correctly generated
@jstolarek could you remove the symlinks from the equation and test again? |
I just tried doing two things:
Now, one thing that might be important. I install GHC by running:
So I'm pointing the |
Thanks for testing! It's very import to know that the problem isn't related to your locale. |
I couldn't reproduce the problem creating |
@jstolarek are you installing a source o binary GHC distribution? |
I am using binary build for Debian 7. |
Since the above tests success and fail respectively, I propose to file an issue on GHC. Are you agree? If so, which are your users on the GHC bug-tracker? |
It does seem fairly clear that it is not cpphs's fault, and that ghc seems to be responsible for adding a #include with a filename that is not syntactically valid. |
I am on GHC bugtracker as jstolarek |
@jstolarek, could you reproduce the issue with GHC 8.0.2? |
I'll let you know once I upgrade to GHC 8.0.2. But was this reported as a GHC bug? If so, was this bug fixed by the 8.0.2 release? |
No. I didn't report it. |
Closing due to agda/agda#3223. |
@jstolarek reported an error installing Agda. A MWE is as follows
Blocking agda/agda#1285.
The text was updated successfully, but these errors were encountered: