Building cabal with cabal fails?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Building cabal with cabal fails?

Neil Mitchell
Hi,

Using GHC 6.4.2, in prepration for some cabal hacking, I decided to
download Cabal from darcs and install it.

darcs get http://darcs.haskell.org/packages/Cabal --partial
cd Cabal
runhaskell Setup configure

And I get the error:

./Distribution/Simple.hs:61:1: lexical error

Should this work? If not, what should I be doing.

Thanks

Neil
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Esa Ilari Vuokko
On 8/17/06, Neil Mitchell <[hidden email]> wrote:

> Using GHC 6.4.2, in prepration for some cabal hacking, I decided to
> download Cabal from darcs and install it.
>
> darcs get http://darcs.haskell.org/packages/Cabal --partial
> cd Cabal
> runhaskell Setup configure
>
> And I get the error:
>
> ./Distribution/Simple.hs:61:1: lexical error
>
> Should this work? If not, what should I be doing.

Arguably, it should.  Unfortunately it doesn't.  I think this is what I do
with ghc (in Windows):

ghc -hide-all-packages -package base -package Cabal Setup.lhs -o setup

But of course that requires one cabal already installed and working.
If you have ghc 6.4.2, that should be no problem.  I think it used to
be possible just to pass -cpp and compile setup using the Distribution-
sources in tree, but that stopped working at some point.

Best regards,
--Esa
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

RE: Building cabal with cabal fails?

Simon Peyton Jones
In reply to this post by Neil Mitchell
There was some issue with having a sufficiently up to date version of
Alex.  No idea whether that's your problem, but I'd get the latest Alex
anyway

S

| -----Original Message-----
| From: [hidden email]
[mailto:[hidden email]] On Behalf Of Neil Mitchell
| Sent: 17 August 2006 13:48
| To: [hidden email]
| Subject: Building cabal with cabal fails?
|
| Hi,
|
| Using GHC 6.4.2, in prepration for some cabal hacking, I decided to
| download Cabal from darcs and install it.
|
| darcs get http://darcs.haskell.org/packages/Cabal --partial
| cd Cabal
| runhaskell Setup configure
|
| And I get the error:
|
| ./Distribution/Simple.hs:61:1: lexical error
|
| Should this work? If not, what should I be doing.
|
| Thanks
|
| Neil
| _______________________________________________
| Libraries mailing list
| [hidden email]
| http://www.haskell.org/mailman/listinfo/libraries
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Neil Mitchell
Hi

> There was some issue with having a sufficiently up to date version of
> Alex.  No idea whether that's your problem, but I'd get the latest Alex
> anyway

A certain irony - one of the reasons I am trying to upgrade Cabal is
because Alex gave Cabal errors, which seem like they might be due to
an old version of Cabal.

Thanks

Neil


> | -----Original Message-----
> | From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Neil Mitchell
> | Sent: 17 August 2006 13:48
> | To: [hidden email]
> | Subject: Building cabal with cabal fails?
> |
> | Hi,
> |
> | Using GHC 6.4.2, in prepration for some cabal hacking, I decided to
> | download Cabal from darcs and install it.
> |
> | darcs get http://darcs.haskell.org/packages/Cabal --partial
> | cd Cabal
> | runhaskell Setup configure
> |
> | And I get the error:
> |
> | ./Distribution/Simple.hs:61:1: lexical error
> |
> | Should this work? If not, what should I be doing.
> |
> | Thanks
> |
> | Neil
> | _______________________________________________
> | Libraries mailing list
> | [hidden email]
> | http://www.haskell.org/mailman/listinfo/libraries
>
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Neil Mitchell
In reply to this post by Esa Ilari Vuokko
Hi

> ghc -hide-all-packages -package base -package Cabal Setup.lhs -o setup

Perfect :) Complete success this time. Is there any way to reduce the
command line foo required, to shove any of this information into the
package required?

Thanks

Neil
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

shelarcy
In reply to this post by Neil Mitchell
I'm sorry for that I posted wrong mailiing-list
and I have to send this mail again.

On Thu, 17 Aug 2006 21:48:13 +0900, Neil Mitchell <[hidden email]>
wrote:
> darcs get http://darcs.haskell.org/packages/Cabal --partial
> cd Cabal
> runhaskell Setup configure
>
> And I get the error:
>
> ./Distribution/Simple.hs:61:1: lexical error
>
> Should this work? If not, what should I be doing.

If Distribution directory is in the same directory,
runhaskell find and use that. So, Setup.(l)hs import
Distribution directory's source file, not ghc's
Distribution/*. And ./Distribution/Simple.hs uses
C preprocessor, so that cause lexical error.

If you want to solve this error, you should use cpp
option like this.

runhaskell -cpp Setup.lhs configure
runhaskell -cpp Setup.lhs build
runhaskell -cpp Setup.lhs install

Or you have to change to add below pragma per file
that you can see lexical error.

{-# OPTIONS -cpp #-}

--
shelarcy <shelarcy    capella.freemail.ne.jp>
http://page.freett.com/shelarcy/
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Lemmih
In reply to this post by Neil Mitchell
On 8/17/06, Neil Mitchell <[hidden email]> wrote:
> Hi
>
> > ghc -hide-all-packages -package base -package Cabal Setup.lhs -o setup
>
> Perfect :) Complete success this time. Is there any way to reduce the
> command line foo required, to shove any of this information into the
> package required?

runhaskell -i Setup.lhs configure

--
Cheers,
  Lemmih
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Simon Marlow-5
In reply to this post by Esa Ilari Vuokko
Esa Ilari Vuokko wrote:

> On 8/17/06, Neil Mitchell <[hidden email]> wrote:
>
>> Using GHC 6.4.2, in prepration for some cabal hacking, I decided to
>> download Cabal from darcs and install it.
>>
>> darcs get http://darcs.haskell.org/packages/Cabal --partial
>> cd Cabal
>> runhaskell Setup configure
>>
>> And I get the error:
>>
>> ./Distribution/Simple.hs:61:1: lexical error
>>
>> Should this work? If not, what should I be doing.
>
>
> Arguably, it should.  Unfortunately it doesn't.  I think this is what I do
> with ghc (in Windows):
>
> ghc -hide-all-packages -package base -package Cabal Setup.lhs -o setup
>
> But of course that requires one cabal already installed and working.
> If you have ghc 6.4.2, that should be no problem.  I think it used to
> be possible just to pass -cpp and compile setup using the Distribution-
> sources in tree, but that stopped working at some point.

ghc --make -cpp Setup.lhs

works for me.  Also adding -i will cause it to use whatever Cabal you have
installed instead of the sources in the tree.

When you say it stopped working at some point, what are you referring to?

Cheers,
        Simon
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Esa Ilari Vuokko
On 8/22/06, Simon Marlow <[hidden email]> wrote:
> ghc --make -cpp Setup.lhs
>
> works for me.  Also adding -i will cause it to use whatever Cabal you have
> installed instead of the sources in the tree.
>
> When you say it stopped working at some point, what are you referring to?

That it didn't work for me at some point in the past.  It does now, however.
Sorry, I was going by memory there, without testing code in darcs repo.

Best regards,
--Esa
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries
Reply | Threaded
Open this post in threaded view
|

Re: Building cabal with cabal fails?

Neil Mitchell
In reply to this post by Simon Marlow-5
Hi,

> ghc --make -cpp Setup.lhs

Any reason we can't add {#- OPTIONS_GHC -cpp -#} in the appropriate
files, so it just works every time without people getting it wrong?

Thanks

Neil
_______________________________________________
Libraries mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/libraries