Skip to content
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

x11 fails to compile #22

Open
kfiz opened this issue Aug 21, 2013 · 12 comments
Open

x11 fails to compile #22

kfiz opened this issue Aug 21, 2013 · 12 comments

Comments

@kfiz
Copy link

kfiz commented Aug 21, 2013

Hi,
I'm trying to build X11 with cabal, but the installation always fails with:

"Graphics/X11/Xlib/Extras.hsc:1435:47: parse error on input `<-'"

Any suggestions?

Cheers

@kfiz
Copy link
Author

kfiz commented Aug 21, 2013

Sorry, was in a bit of a rush:
I'm trying to build Version 1.6.1.1 on a mac. I'm on ghc 7.6.3.

@dmwit
Copy link
Contributor

dmwit commented Aug 21, 2013

I haven't the faintest idea. X11-1.6.1.1 builds fine on GHC-7.6.3 here. Could you post the exact cabal command you run and its full output? Bonus points for including a verbose enough run of cabal (add -v, -vv, or -vvv) that we can see the exact command it's invoking when you get that error. Also, what does hsc2hs --version say?

@kfiz
Copy link
Author

kfiz commented Aug 21, 2013

I'm basically just executing a 'caball install x11'. I'm not at my box at the moment, but I'll try to earn those bonus points in a few hours.

@kfiz
Copy link
Author

kfiz commented Aug 22, 2013

Ok, so here some gists:

The first one shows the end of the cabal-install output, before that there' s loads of compilation output.
I pasted in some warnings at the top, that are exemplary for the warnings that were generated.

The second one shows the top,i.e. ./configure ... output.
hsc2hs --version says: hsc2hs version 0.67

@dmwit
Copy link
Contributor

dmwit commented Aug 22, 2013

Hrm. Those warnings look similar to ones I saw flying by on #haskell the other night; the problem for that person turned out to be that clang's preprocessor behaves differently than gcc's. But since the problem is in a completely different file... I'm still a bit stumped. I'm not even sure what the next thing to ask for would be. Perhaps you could take a peek in the generated Extras.hs file and see what the lines around the one it's complaining about are?

@dmwit
Copy link
Contributor

dmwit commented Aug 22, 2013

Contacted Eridius on #haskell, who was the guy having CPP problems the other day. He said what worked for him was grabbing the newest cpphs from Hackage and adding --ghc-options="-pgmPcpphs -optP--cpp" to his cabal install command. You could try that, too, I guess.

@kfiz
Copy link
Author

kfiz commented Aug 22, 2013

Downloaded the source to try manually, so I could check the Extras.hs. But that didn't work:
runghc Setup.hs configure --user --prefix=$HOME
runghc Setup.hs install
...
Setup.hs:6:29: Warning:
In the use of `defaultUserHooks'
(imported from Distribution.Simple):
Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
compatibility in which case you must stick with defaultUserHooks"
Installing library in /Users/louis/lib/X11-1.6.1.1/ghc-7.6.3
Setup.hs: Error: Could not find module: Graphics.X11 with any suffix: ["hi"]
in the search path: ["dist/build"]
...

After succesfully doing cabal-install cpphs,
cabal install x11 --ghc-options="-pgmPcpphs -optP--cpp" fails with:
...
Building X11-1.6.1.1...
Preprocessing library X11-1.6.1.1...
ghc: could not execute: cpphs
Failed to install X11-1.6.1.1
cabal: Error: some packages failed to install:
X11-1.6.1.1 failed during the building phase. The exception was:
ExitFailure 1

checked with ghc-pkg list wether cpphs was registered, which it was.
I think I`m missing something obvious here...

@kfiz
Copy link
Author

kfiz commented Aug 22, 2013

Ok, the obvious thing was, that cpphs wasn't in my path. :-)
Changing that and switching from gcc-4.8.1 to clang solved the problem.
Should I close the issue?

@kfiz
Copy link
Author

kfiz commented Aug 22, 2013

Thanks by the way for the first-class support!

@dmwit
Copy link
Contributor

dmwit commented Aug 22, 2013

No, please don't close the issue just yet. I'd like to keep it open until I think of a way of making things Just Work. =)

You're welcome for the help.

@peti
Copy link
Contributor

peti commented Sep 21, 2019

It's been six years ... can we close this issue now? It feels like it's no longer a pressing problem.

@dmwit
Copy link
Contributor

dmwit commented Sep 28, 2019

Well... I'm not spending time thinking about how to fix it. But that doesn't mean it's fixed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants