darcs

Issue 1315 src/Context.hs:3:55: lexical error in string/character literal at character '/'

Title src/Context.hs:3:55: lexical error in string/character literal at character '/'
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, kowey, mornfall, thorkilnaur, twb
Assigned To
Topics Devel

Created on 2009-01-15.09:36:13 by twb, last changed 2009-08-27.14:23:22 by admin.

Messages
msg7103 (view) Author: twb Date: 2009-01-15.09:36:11
This seems wrong, as Context.hs is autogenerated.

    # cabal build
    Preprocessing library darcs-2.1.98.2...
    Preprocessing executables for darcs-2.1.98.2...
    Building darcs-2.1.98.2...
    /usr/bin/ar: creating dist/build/libHSdarcs-2.1.98.2.a
    Linking dist/build/witnesses/witnesses ...
    [  1 of 134] Compiling Context          ( src/Context.hs, dist/build/darcs/darcs-tmp/Context.o )

    src/Context.hs:3:55:
        lexical error in string/character literal at character '/'

    # nl -ba src/Context.hs | sed -n 2,4p
    2  context :: String
    3  context ="# configured Thu Jan 15 17:13:21 EST 2009\n\
    4  \./configure /usr/local/share/config.site /usr/local/etc/config.site\n\

Note that "make witnesses" works fine:

    # make witnesses
    perl release/determine_release_state.pl 2.2.0pre2 > release/STATE
    make: Nothing to be done for `witnesses'.
msg7212 (view) Author: mornfall Date: 2009-01-26.09:44:22
10:41:56 | morn@eri:~/tmp -> cat foobar.hs
context :: String
context ="# configured Thu Jan 15 17:13:21 EST 2009\n\
\./configure /usr/local/share/config.site /usr/local/etc/config.site"
10:42:01 | morn@eri:~/tmp -> cat foobar.cpp.hs
# 1 "foobar.hs"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "foobar.hs"
context :: String
context ="# configured Thu Jan 15 17:13:21 EST 2009\n\./configure /usr/local/
share/config.site /usr/local/etc/config.site"
10:42:03 | morn@eri:~/tmp -> ghc foobar.hs

foobar.hs:1:0: The function `main' is not defined in module `Main'
10:42:12 | morn@eri:~/tmp -> ghc foobar.cpp.hs

foobar.hs:2:55:
    lexical error in string/character literal at character '/'

Here comes the problem. Doing make maintainer-clean should solve the problem.
msg7437 (view) Author: simon Date: 2009-03-12.18:11:42
I confirm that doing "make maintainer-clean" after hitting this error, then "cabal 
build" again, works. It's not very good that this is required. People might think 
to try try cabal clean, make clean, maybe even make distclean, but not this.
msg7438 (view) Author: kowey Date: 2009-03-12.18:14:51
Just deleting src/Context.hs works for me.  This may be something where the best
fix is just documentation.  Anyway, the makefile is going away in July.
msg7439 (view) Author: simon Date: 2009-03-12.18:20:51
This is not using the makefile, but just a cabal build. Documentation  
should not be required for that to work. :)
msg7440 (view) Author: kowey Date: 2009-03-12.18:26:43
As I understand it, this is an issue which affects people that have (i) used
make to build darcs followed by (ii) trying the cabal based build

The issue as I understand it is that the context file generated via the make
build method is for one reason or another not compatible with the cabal build. 
So the context file is just make detritus, and the problem of make detritus will
go away by itself once the makefile is gone.

Of course, fixing how Context.hs is generated by the makefile in the meantime
would probably be good since at the time of this writing, we'll still be dealing
with this for another 4 months.  But once we stop building darcs with make, it
becomes moot.
msg8101 (view) Author: kowey Date: 2009-08-11.18:23:14
Fixed by dumping autoconf.
msg8102 (view) Author: mornfall Date: 2009-08-11.20:10:45
Actually, this was resolved even before dropping autoconf by this change to
Setup.lhs:
  -- Autoconf may have generated a context file.  Remove it before
  -- building, as its existence inexplicably breaks Cabal.
  removeFile "src/Context.hs"
    `catch` (\e -> unless (isDoesNotExistError e) (ioError e))
msg8103 (view) Author: mornfall Date: 2009-08-11.20:11:28
Bah, silly roundup.
History
Date User Action Args
2009-01-15 09:36:13twbcreate
2009-01-26 09:44:24mornfallsetpriority: bug
nosy: + mornfall
status: unread -> unknown
messages: + msg7212
2009-03-12 18:11:44simonsetnosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
messages: + msg7437
2009-03-12 18:14:53koweysetnosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
messages: + msg7438
2009-03-12 18:20:53simonsetnosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
messages: + msg7439
2009-03-12 18:26:46koweysetnosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
messages: + msg7440
2009-08-11 18:23:18koweysetstatus: unknown -> resolved
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
topic: + Devel
messages: + msg8101
2009-08-11 20:10:48mornfallsetstatus: resolved -> unknown
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
messages: + msg8102
2009-08-11 20:11:30mornfallsetstatus: unknown -> resolved
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, mornfall
messages: + msg8103
2009-08-25 17:39:15adminsetnosy: + darcs-devel, - simon
2009-08-27 14:23:22adminsetnosy: kowey, darcs-devel, twb, thorkilnaur, dmitry.kurochkin, mornfall