Building ncurses-0.2.15... Preprocessing library ncurses-0.2.15... c2hs: C header contains errors: /usr/include/runetype.h:92: (column 22) [ERROR] >>> Syntax error ! The symbol `const' does not fit here. http://package23.nyi.freebsd.org/data/103amd64-default-PR216707/2017-02-06_06h16m04s/logs/errors/hs-ncurses-0.2.15.log http://package22.nyi.freebsd.org/data/103i386-default-PR216707/2017-02-06_06h16m01s/logs/errors/hs-ncurses-0.2.15.log
The is one of three (or four?) ports that currently blocks the update of lang/gcc from GCC 4.9 to GCC 5, so adjusting this to "Affects Many People". It would be lovely could you help with this.
This is upstream problem - the Haskell package language-c that implements C parser doesn't support C11 stuff: https://github.com/visq/language-c/issues/4 So, there is nothing we can do about this, except using gcc49 for this port. This is also questionable, btw, because we either use gcc49 for all Haskell stuff, or just hack c2hs to use gcc49 for preprocessing. But latter may also cause subtle incompatibilies between compiler used for compilation and for preprocessing.
Why not pass -std=gnu89 instead? I just don't know Haskell to create a patch.
(In reply to Jan Beich (mail not working) from comment #3) We can patch c2hs so that it always pass -atd=gnu89 to preprocessor. But that would make all Haskell code that interfaces with C using c2hs to parse headers in C89, while they were compiled in C11. This could lead, in theory, to various inconsistencies. If you are OK with this, I can fiddle with c2hs port and make a patch.
(In reply to arrowd from comment #4) > would make all Haskell code that interfaces with C using c2hs to parse headers > in C89, while they were compiled in C11. Our C ABI is supposed to be compatible but I'm not sure about Haskell interfaces. Let's keep it safe by building the rest of of haskell@ ports in C89 mode. For one, Clang defaults to C11 only since 3.6.
Looking at PCLANG in lang/ghc it's pinned to 3.5 which defaults to C99 while BCLANG may not have been tested with recent (at the time) 3.6 update on 11.0-CURRENT.
(In reply to Jan Beich (mail not working) from comment #6) Moreover, I've tried building hs-ncurses with clang34 and it also failed with the same error. To be safe we need to switch all Haskell ports to lang/gcc49 instead of lang/gcc. This would also leave things as they are for Haskell users.
Don't rely on obsolete lang/gcc* availability. The ports are not maintained upstream and exist only as a deathbed for unmaintained consumers. gerald@ tries to decrease their diversity i.e., there's no point in keeping lang/gcc49 just for haskell@ ports if they build with lang/gcc48 as well. Not to mention altering USE_GCC value is the last resort. devel/hs-ncurses has few consumers, so marking BROKEN is another option.
(In reply to Jan Beich (mail not working) from comment #8) > Don't rely on obsolete lang/gcc* availability. The ports are not maintained > upstream and exist only as a deathbed for unmaintained consumers. gerald@ > tries to decrease their diversity i.e., there's no point in keeping > lang/gcc49 just for haskell@ ports if they build with lang/gcc48 as well. Usually we try to go for the latest version that works (among others since that has a higher chance of supporting newer hardware and possibly getting a backport). But, agreed, USE_GCC=X.Y is a stop gap and should be avoided.
Created attachment 179949 [details] Pass -std=c99 while building hs-ncurses Hi Attached is a patch which updates the involved hs-ports to the newest release: devel/hs-c2hs 0.26.1 -> 0.28.1 devel/hs-language-c 0.4.7 -> 0.5.0 devel/hs-ncurses 0.2.15 -> 0.2.16 Further it injects '-std=c99' to hs-ncurses cabal file. [Maybe this should be added to c2hs or language-c to be the default always...] This makes devel/hs-ncurses build fine on my FreeBSD-current with gcc default version being 6. mfg Tobias
Also builds fine against gcc4.9.
Thank you for the patch, Tobias! Can you please apply this (maintainer timeout and such)?
Antoine Brodin <antoine@FreeBSD.org> just confirmed this in PR 216707: PR 216843 can be committed with maintainer timeout. Are you going to do so, Tobias (since it's your patchset), or do you prefer me to do so?
A commit references this bug: Author: tcberner Date: Sat Mar 18 22:37:46 UTC 2017 New revision: 436451 URL: https://svnweb.freebsd.org/changeset/ports/436451 Log: Force compilation of of devel/hs-ncurses in c99 mode, to allow devel/gcc to be updated * hs-ncurses failed, as it does not understand c11 features, which is the default in modern compilers. By passing cpp-options: -std=c99 via its cabal file, this can be surpressed. * While here, also update the affected ports PR: 216843 Approved by: maintainer timeout (4weeks), rakuco (mentor) Changes: head/devel/hs-c2hs/Makefile head/devel/hs-c2hs/distinfo head/devel/hs-language-c/Makefile head/devel/hs-language-c/distinfo head/devel/hs-ncurses/Makefile head/devel/hs-ncurses/distinfo head/devel/hs-ncurses/files/ head/devel/hs-ncurses/files/patch-ncurses.cabal