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

Lexical error ! The character '#' does not fit here #268

Closed
romanofski opened this issue Mar 26, 2021 · 8 comments
Closed

Lexical error ! The character '#' does not fit here #268

romanofski opened this issue Mar 26, 2021 · 8 comments

Comments

@romanofski
Copy link

I've run into this problem while packaging https://github.com/purebred-mua/hs-notmuch for Fedora 34 and beyond. The build failed with:

+ LANG=C.utf8
+ ./Setup build
Preprocessing library for notmuch-0.3.0.0..
c2hs: C header contains errors:
dist/build/Notmuch/Binding.i:1: (column 1) [ERROR]  >>> Lexical error !
  The character '#' does not fit here.
error: Bad exit status from /var/tmp/rpm-tmp.HyB7BW (%build)
    Bad exit status from /var/tmp/rpm-tmp.HyB7BW (%build)

A preliminary search showed, that it might be LANG related, however setting it to C doesn't change the error we're running into. I'm attaching the generated Binding.i.txt. It doesn't look odd to me, however I'm new to it all so I don't spot what is wrong with it if it's something obvious to the experienced.

Logs for the working Fedora 33 build: Dependencies, Build log, other logs

Logs for the failing Fedora 34 build: Dependencies, Build log, other logs

The logs for the c2hs build are accessible here: https://copr.fedorainfracloud.org/coprs/romanofski/purebred/build/2091487/ in case that matters.

@juhp
Copy link
Contributor

juhp commented May 18, 2021

This is due to changes in gcc11, see gtk2hs/gtk2hs#304

(Downstream report: https://bugzilla.redhat.com/show_bug.cgi?id=1957233)

@vmchale
Copy link
Contributor

vmchale commented Jun 1, 2021

This will be fixed when the bounds on language-c are bumped, no?

@why-not-try-calmer
Copy link

I am hitting the same issue when trying to stack build a project using the cpython package.

@deech
Copy link
Contributor

deech commented Jun 8, 2021

The language-c upper bounds have been bumped ( 5912527 ) . Does this still happen on master?

@lebensterben
Copy link

@deech
I just build c2hs on from master branch and can confirm that it solved my problem.
Please consider to release this ASAP as this is breaking lots of packages.

@podiki
Copy link

podiki commented Jun 12, 2021

Also having issues with stack build for projects that need c2hs. I've used latest commit from here and still getting same error on building e.g. taffybar, though I'm not entirely sure the latest git version of c2hs is being used (should be...). A quick bump in version/release with this fix would help.

@juhp
Copy link
Contributor

juhp commented Jun 13, 2021

deech kindly just released 0.28.8

WinstonHartnett added a commit to WinstonHartnett/godot-haskell that referenced this issue Jun 17, 2021
sim590 added a commit to sim590/haskell-ncurses that referenced this issue Jul 10, 2021
Due to changes in gcc11, as explained here:
haskell/c2hs#268

c2hs-0.28.8 is now required to build in order to avoid the following
error:

    dist/build/UI/NCurses.i:1: (column 1) [ERROR]  >>> Lexical error !
      The character '#' does not fit here.
AugustUnderground added a commit to AugustUnderground/prehsept that referenced this issue Sep 3, 2021
noctux added a commit to noctux/doc-browser that referenced this issue Oct 8, 2021
stack pulls its own c2hs version, which is incompatible with gcc11 (see
haskell/c2hs#268 for details). This results in
this error when building:

hsqml > Linking /tmp/stack-4e5641358fd250fb/hsqml-0.3.5.1/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/setup/setup ...
hsqml > Configuring hsqml-0.3.5.1...
hsqml > build
hsqml > Preprocessing library for hsqml-0.3.5.1..
hsqml > c2hs: C header contains errors:
hsqml >
hsqml > .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.0.1.0/build/Graphics/QML/Internal/BindPrim.i:1: (column 1) [ERROR]  >>> Lexical error !
hsqml >   The character '#' does not fit here.
hsqml >

This is fixed by using a more recent version of c2hs and language-c.
@romanofski
Copy link
Author

I think this can be closed.

Minnozz pushed a commit to LumiGuide/tensorflow-haskell that referenced this issue Jan 17, 2023
Minnozz pushed a commit to LumiGuide/tensorflow-haskell that referenced this issue Jan 20, 2023
fkm3 pushed a commit to tensorflow/haskell that referenced this issue Jan 24, 2023
mbakke pushed a commit to guix-mirror/guix that referenced this issue Mar 31, 2023
This fixes issues with GCC 11, see
haskell/c2hs#268.

* gnu/packages/haskell-xyz.scm (ghc-language-c): Update to 0.9.1.
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

7 participants