Opened 3 years ago
Last modified 2 years ago
#64996 assigned defect
WIP on making nhc98 build
Reported by: | barracuda156 | Owned by: | essandess (Steve Smith) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.7.2 |
Keywords: | powerpc, leopard, snowleopard | Cc: | |
Port: | nhc98 |
Description
If we are to believe Macports bots, nhc98 fails across the board. At the same time its website gives impression that compilation is trivial and was working on Darwin PPC among others: https://www.haskell.org/nhc98/install.html
I have tried to update the port to @ 1.22 (the latest official release), and it still fails for me. I tried building with gcc-4.2, macports-gcc-10 and ghc-7.6.3.
Can anyone confirm whether it fails too?
Sources available here: https://www.haskell.org/nhc98/download.html Or here: https://github.com/haskell-implementations/nhc98
- S. To have the latest version, Portfile should be changed to:
master_sites http://www.haskell.org/nhc98/ distfiles ${name}src-${version}${extract.suffix} checksums md5 9c7669d3de6d217274ac4aadd63dce7e \ sha1 a8adc8f22371998ee0657bc0e01058a57d876abc \ rmd160 99a90d00f77f66938c817c813f11c3d0ea5bf244 \ sha256 14c5c16c336d0bb15e6e3d1baad8a2bca93c0538a129fb18df1d47d1f4eb6f3a \ size 29854160
Attachments (3)
Change History (13)
comment:1 Changed 3 years ago by barracuda156
comment:2 Changed 3 years ago by barracuda156
I don't get why it can't find the header in this specific instance. The path is src/runtime/Kernel/newmacros.h
:
cd src/cpphs; /usr/bin/make -f Makefile.nhc98 fromC make[1]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/src/runtime' cd Kernel; /usr/bin/make links script/hmake-PRAGMA.hc:1:10: fatal error: newmacros.h: No such file or directory 1 | #include "newmacros.h" | ^~~~~~~~~~~~~ compilation terminated. … collect2: error: ld returned 1 exit status strip /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin10/greencard-nhc98 error: strip: can't open file: /opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin10/greencard-nhc98 (No such file or directory) make[1]: *** [fromC] Error 1 make[1]: Leaving directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/src/greencard' make: *** [targets/powerpc-Darwin10/greencard-gcc] Error 2
- S. Portfile post-patch does more that needed, apparently. This is enough to fix target error:
--- Makefile.orig 2010-02-20 17:21:37.000000000 +0800 +++ Makefile 2022-04-13 10:34:37.000000000 +0800 @@ -207,7 +207,7 @@ prelude hsc2hs libraries basic-ghc: $(PRAGMA) runtime hmake-ghc greencard-ghc compiler-ghc cpphs \ prelude hsc2hs libraries -basic-$(CC): runtime prelude-$(CC) pragma-$(CC) cpphs-$(CC) \ +basic-$(BUILDCOMP): runtime prelude-$(CC) pragma-$(CC) cpphs-$(CC) \ greencard-$(CC) hmake-$(CC) hsc2hs-$(CC) package-deps-$(CC) \ compiler-$(CC) libraries-$(CC)
comment:3 Changed 3 years ago by barracuda156
Summary: | Why nhc98 fails to build, any ideas? → WIP on making nhc98 build |
---|
comment:4 Changed 3 years ago by barracuda156
Owner: | set to essandess |
---|---|
Status: | new → assigned |
comment:5 Changed 3 years ago by barracuda156
If anyone got suggestions, please feel free to instruct me :) I am interested in fixing Haskell stuff, and nhc98
is one of the major compilers, though, admittedly, an old one.
Changed 3 years ago by barracuda156
Attachment: | main_10.5.8_ppc32.log added |
---|
How it fails on 10.5.8:
comment:6 Changed 3 years ago by barracuda156
Whatever options I try, it still fails. With patches, without patches, on 10.6, on 10.5.8, using make or gmake, specifying STRIP= or not. Errors somewhat differ depending on case, but nothing works.
This is from the log above, I applied patches and used gmake:
:info:build gmake[2]: Leaving directory '/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/src/runtime/Kernel' :info:build cd Ratio; /opt/local/bin/gmake fromC :info:build gmake[2]: Entering directory '/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/src/prelude/Ratio' :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/primDecodeFloat.o primDecodeFloat.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/primEncodeFloat.o primEncodeFloat.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/script/nhc98 -c -d /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/prelude/Ratio *.hc :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/primDoubleFromInteger.o primDoubleFromInteger.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/primIntFromInteger.o primIntFromInteger.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/primPackString.o primPackString.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/lengthPS.o lengthPS.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/script/nhc98 -H8M -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/cpphs /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/CppIfdef.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/HashDefine.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/MacroPass.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/Options.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/Position.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/ReadFirst.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/RunCpphs.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/SymTab.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Cpphs/Tokenise.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Language/Preprocessor/Unlit.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/Text/ParserCombinators/HuttonMeijer.o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/cpphs/cpphs.o :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/unpackPS.o unpackPS.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/main.o: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/mutlib.o: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/mutator.o: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/Prelude.a: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/Runtime.a: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/Prelude.a: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/Runtime.a: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/Prelude.a: No such file or directory :info:build powerpc-apple-darwin9-gcc-4.0.1: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/Runtime.a: No such file or directory :info:build strip /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/cpphs :info:build gcc -c -I../Kernel -I/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/include -O1 -std=gnu89 -DHIGH_BYTE_FIRST -o /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/targets/powerpc-Darwin9/obj/runtime/Builtin/indexPS.o indexPS.c :info:build /bin/sh: -c: line 0: syntax error near unexpected token `)' :info:build /bin/sh: -c: line 0: `if [ 5493) \> 4.2 ]; then echo -Wno-pointer-to-int-cast; fi' :info:build error: strip: can't open file: /opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/lib/powerpc-Darwin9/cpphs (No such file or directory) :info:build gmake[1]: *** [Makefile.nhc98:61: fromC] Error 1 :info:build gmake[1]: Leaving directory '/opt/local/var/macports/build/_opt_PPCLeopardPorts_lang_nhc98/nhc98/work/nhc98-1.22/src/cpphs' :info:build gmake: *** [Makefile:398: targets/powerpc-Darwin9/cpphs-gcc] Error 2 :info:build gmake: *** Waiting for unfinished jobs....
Changed 3 years ago by barracuda156
Attachment: | main_10.5.8_ppc32_v2.log added |
---|
And then I try with no patches and only default config args, using the old trick with reinplace to fix configure:
comment:7 Changed 2 years ago by barracuda156
I have fixed it in this PR: https://github.com/macports/macports-ports/pull/14991
UPD. Merged into the master: [9750cbcfc3309c0b96572eeb1bf334214b7b06d3/macports-ports]
comment:8 follow-ups: 9 10 Changed 2 years ago by ryandesign (Ryan Carsten Schmidt)
That PR was faulty in a number of ways.
- It blacklists all compilers:
Warning: All compilers are either blacklisted or unavailable; defaulting to first fallback option
Clang is the only compiler modern macOS has in the compiler list, but this port apparently is not compatible with clang. Therefore the port must add some other suitable compiler to the compiler.fallback list.
- It patches configure so that it always builds with
gcc
rather than with the compiler MacPorts tells it to use; in other words; it's not UsingTheRightCompiler.
comment:9 Changed 2 years ago by barracuda156
Replying to ryandesign:
That PR was faulty in a number of ways.
- It blacklists all compilers:
Warning: All compilers are either blacklisted or unavailable; defaulting to first fallback optionClang is the only compiler modern macOS has in the compiler list, but this port apparently is not compatible with clang. Therefore the port must add some other suitable compiler to the compiler.fallback list.
- It patches configure and Makefile so that it always builds with
gcc
rather than with the compiler MacPorts tells it to use; in other words; it's not UsingTheRightCompiler.
The alternative compiler could be ghc
, however I cannot verify if its current Macports version builds this port (since it is not yet fixed for PPC). As I recall, defining it to build with gcc
has been both done in Macports with the earlier version of the port, as well as on FreeBSD.
comment:10 Changed 2 years ago by barracuda156
Replying to ryandesign:
- It patches configure and Makefile so that it always builds with
gcc
rather than with the compiler MacPorts tells it to use; in other words; it's not UsingTheRightCompiler.
- S. So once/if I manage to fix recent
ghc
for PPC, I will try incorporating its support intonhc98
port. The third supported compiler ishbc
: https://github.com/haskell-implementations/hbc – but it does not exist in Macports.
I have found a patch that claims to address the issue, however I cannot make it work still: https://github.com/Millak/guix/blob/master/gnu/packages/patches/nhc98-c-update.patch