Skip to content

fix build of pas2c with ghc-9.4#75

Open
juhp wants to merge 1 commit into
hedgewars:masterfrom
juhp:pas2c-ghc94
Open

fix build of pas2c with ghc-9.4#75
juhp wants to merge 1 commit into
hedgewars:masterfrom
juhp:pas2c-ghc94

Conversation

@juhp

@juhp juhp commented Jul 28, 2023

Copy link
Copy Markdown

fixes this build failure:

hedgewars-src-1.0.2/tools/pas2c/PascalBasics.hs:46:11: error:
    Ambiguous occurrence string'
    It could refer to
       either Text.Parsec.Char.string',
              imported from `Text.Parsec.Char' at /var/home/petersen/fedora/haskell/hedgewars/BUILD/hedgewars-src-1.0.2/tools/pas2c/PascalBasics.hs:5:1-23
           or PascalBasics.string',
              defined at /var/home/petersen/fedora/haskell/hedgewars/BUILD/hedgewars-src-1.0.2/tools/pas2c/PascalBasics.hs:17:1
   |
46 |     try $ string' "{$"
   |           ^^^^^^^

example error message:

hedgewars-src-1.0.2/tools/pas2c/PascalBasics.hs:46:11: error:
    Ambiguous occurrence string'
    It could refer to
       either Text.Parsec.Char.string',
              imported from `Text.Parsec.Char' at /var/home/petersen/fedora/haskell/hedgewars/BUILD/hedgewars-src-1.0.2/tools/pas2c/PascalBasics.hs:5:1-23
           or PascalBasics.string',
              defined at /var/home/petersen/fedora/haskell/hedgewars/BUILD/hedgewars-src-1.0.2/tools/pas2c/PascalBasics.hs:17:1
   |
46 |     try $ string' "{$"
   |           ^^^^^^^
@juhp

juhp commented Jul 28, 2023

Copy link
Copy Markdown
Author

Also testing with Fedora 38 (ghc-9.2) and 37 (ghc-8.10)

(the F38 failure is not related to this change.)

@Wuzzy2

Wuzzy2 commented Jul 28, 2023

Copy link
Copy Markdown
Contributor

Thank you. Will look at this later.

@juhp

juhp commented Jul 30, 2023

Copy link
Copy Markdown
Author

(I have applied this patch to the Fedora package, since Fedora 39 is moving to GHC 9.4)

@Wuzzy2

Wuzzy2 commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

Oh, so apparently this change was already done by unC0Rr a few weeks ago:

https://hg.hedgewars.org/hedgewars/rev/24545642473f

Please close this PR.

(It seems this GitHub mirror is several months out of date.)

@limburgher

Copy link
Copy Markdown

Theres's still this error:

[ 2%] Building C object project_files/hwc/rtl/CMakeFiles/fpcrtl.dir/misc.c.o
cd /home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/redhat-linux-build/project_files/hwc/rtl && /usr/bin/clang -I/home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/project_files/hwc/rtl -I/home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/misc/libphyslayer -I/usr/include/lua-5.1 -I/usr/include/SDL2 -O2 -flto=thin -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS --config /usr/lib/rpm/redhat/redhat-hardened-clang.cfg -fstack-protector-strong -fcommon -m64 -mtune=generic -fasynchronous-unwind-tables -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fPIC -fstack-protector-all -fstack-protector -fvisibility=hidden -Wall -pipe -DNDEBUG -MD -MT project_files/hwc/rtl/CMakeFiles/fpcrtl.dir/misc.c.o -MF CMakeFiles/fpcrtl.dir/misc.c.o.d -o CMakeFiles/fpcrtl.dir/misc.c.o -c /home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/project_files/hwc/rtl/misc.c
[ 1 of 26] Compiling Consts ( /home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/gameServer/Consts.hs, /home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/redhat-linux-build/gameServer/Consts.o )
/home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/project_files/hwc/rtl/misc.c:219:12: warning: returning 'unsigned char *' from a function with result type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
return &s->s[1];
^~~~~~~~
/home/gwyn/fedora/git/FTBFS/hedgewars/hedgewars-src-1.0.2/project_files/hwc/rtl/misc.c:223:5: error: call to undeclared function 'glShaderSource'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
glShaderSource(shader, count, (const char * const *)string, length);

@Wuzzy2

Wuzzy2 commented Jul 31, 2023

Copy link
Copy Markdown
Contributor

What is the changeset ID of the Hedgewars you built?

@limburgher

Copy link
Copy Markdown

This is 1.0.2-dev and a few patches: https://src.fedoraproject.org/rpms/hedgewars/tree/rawhide

@Wuzzy2

Wuzzy2 commented Aug 1, 2023

Copy link
Copy Markdown
Contributor

Yeah but these patches are already part of the main development branch (Mercurial) so I consider this bug fixed.

But if you can reproduce a similar bug that happens in the latest changeset, feel free to report it at https://issues.hedgewars.org/.

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

Successfully merging this pull request may close these issues.

3 participants