Description of problem: cabal fails to compile and install packages with C hookups due to introduction of gcc11 in Fedora 34. install goes smoothly on Fedora 33 with gcc10 Same problem has been reported as FTBFS for Debian for a list of Haskell components For example: https://alioth-lists.debian.net/pipermail/pkg-haskell-maintainers/2021-March/075208.html Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. dnf install cabal-install 2. cabal update 3. cabal install ncurses Actual results: Failed to build ncurses-0.2.16. Build log ( /root/.cabal/logs/ghc-8.8.4/ncurses-0.2.16-84973bef3e57511a459c21397a857ce3a04189952a45d9441bec60c3c06514ae.log ): Configuring ncurses-0.2.16... Preprocessing library for ncurses-0.2.16.. c2hs: C header contains errors: dist/build/UI/NCurses.i:1: (column 1) [ERROR] >>> Lexical error ! The character '#' does not fit here. cabal: Failed to build ncurses-0.2.16. See the build log above for details. Expected results: Additional info:
Thanks for the report - I can't reproduce this yet locally. What locale are you using?
Sorry I misread, I was thrown by the component: I see you mean when building the ncurses library. Yeah unfortunately I already hit this with some of the gtk2hs libraries too :-( Have you seen any patches floating around? I think this is basically an issue with c2hs, which we don't have directly in Fedora.
Nvm I found a patch: https://github.com/gtk2hs/gtk2hs/pull/304 which I am pushing to Fedora gtk2hs-buildtools: you could try applying to c2hs too (https://github.com/haskell/c2hs/issues/268) - though I am not sure how much c2hs and gtk2hsC2hs have diverged by now.
As such it might not be a bad idea to add c2hs to Fedora...