Opened 6 months ago

Closed 6 months ago

#70002 closed defect (fixed)

weechat @4.2.2: Looking for include file ncurses.h - not found

Reported by: drwhitehouse Owned by: cardi (calvin ardi)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: tiger leopard haspatch Cc:
Port: weechat

Description

I have been trying to build weechat on Leopard (legacy ppc) and have failed I have attached the build log. Note that I do have iconv, ncurses and gnutls installed as dependencies which all seemed to work. I did need to deactivate libunwind-headers before building libgcc7 and gcc7.

Attachments (2)

main.log (141.1 KB) - added by drwhitehouse 6 months ago.
main.log
CMakeConfigureLog.yaml (65.3 KB) - added by drwhitehouse 6 months ago.
CMakeConfigureLog.yaml

Download all attachments as: .zip

Change History (16)

Changed 6 months ago by drwhitehouse

Attachment: main.log added

main.log

comment:1 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

The file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_irc_weechat/weechat/work/build/CMakeFiles/CMakeConfigureLog.yaml should say why it failed; please attach that as well.

Changed 6 months ago by drwhitehouse

Attachment: CMakeConfigureLog.yaml added

CMakeConfigureLog.yaml

comment:2 Changed 6 months ago by drwhitehouse

OK have done as requested.

comment:3 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: tiger leopard added
Owner: set to cardi
Status: newassigned
Summary: can't build weechat on leopard (legacy ppc)weechat @4.2.2: Looking for include file ncurses.h - not found
Version: 2.9.3

Ok, so the reason why it fails to find ncurses.h or anything else it's looking for is:

cc1: error: unrecognized command line option "-Wformat-overflow=2"
cc1: error: unrecognized command line option "-Wformat-truncation=2"

It's using warning flags that your gcc-4.2 compiler is too old to understand. Those could potentially be patched out for old compilers.

comment:4 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

comment:5 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

And you can try to remove those lines from CMakeLists.txt and see if it works then.

comment:6 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

It was reported to the developers here:

https://github.com/weechat/weechat/issues/891#issuecomment-1693308171

They seem uninterested in supporting old compilers. The user said it built with gcc 6.5.0 after he removed those flags.

comment:7 Changed 6 months ago by drwhitehouse

The thing I don't understand is that it actually has libgcc7 and gcc7 as dependencies. I spent the best part of last night installing them! I wonder why it builds them and then doesn't use them to compile weechat. (Perhaps I'm misunderstanding how macports works)

comment:8 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

gcc-4.2 is the default compiler on Leopard. Individual ports can specify which compilers are not acceptable; MacPorts then picks another compiler to compile that port. The weechat port does not prohibit any compilers, so it will use gcc-4.2 on your system. One of weechat's dependencies, gnutls, depends on another port nettle, which does prohibit the use of gcc 4.x, therefore MacPorts picked another compiler (gcc7) to compile nettle.

If you verify that weechat compiles fine with gcc-4.2 after removing those warning flags, then we can add a patch that does that on old gcc versions. On the other hand, if it still can't build and it seems that gcc-4.2 is too old to build it after all, then we can prohibit the use of gcc-4.2 for weechat so that it will pick a different compiler.

comment:9 Changed 6 months ago by drwhitehouse

Thanks very much for your help. I have two questions:

port select --set gcc mp-gcc

It sounds like I need to undo this setting, I think it was set to "none" before - is that right?

Secondly (I apologise) can you confirm this is the file to comment out those two lines:

/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/irc/weechat/work/weechat-4.2.2/CMakeLists.txt

I believe its lines 36/37.

I tried that (I think) and got the same error if I recall correctly, so I'm not convinced it did anything! However I've cleaned up a couple of times since then.

Last edited 6 months ago by drwhitehouse (previous) (diff)

comment:10 in reply to:  9 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Replying to drwhitehouse:

I have two questions:

port select --set gcc mp-gcc

It sounds like I need to undo this setting, I think it was set to "none" before - is that right?

Your use of port select should not interfere with how ports build. It sometimes does, and when it does that's a bug to be fixed. In this case, selecting gcc won't interfere, because we can see that the compiler is being used by its full correct path /usr/bin/g++-4.2. Problem only arise when ports build using a generic compiler name like g++ since that's what port select gcc changes.

Secondly (I apologise) can you confirm this is the file to comment out those two lines:

/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/irc/weechat/work/weechat-4.2.2/CMakeLists.txt

I believe its lines 36/37.

That should be it. /opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/irc/weechat/work is a symlink to /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_irc_weechat/weechat/work so the actual path of that file on disk is /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_irc_weechat/weechat/work/weechat-4.2.2/CMakeLists.txt.

I tried that (I think) and got the same error if I recall correctly, so I'm not convinced it did anything! However I've cleaned up a couple of times since then.

cmake may cache things. It may be enough to delete the file /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_irc_weechat/weechat/work/build/CMakeCache.txt after changing CMakeLists.txt and before trying to install again.

Alternately, start from a clean slate with sudo port clean weechat and sudo port extract weechat, then make the change to CMakeLists.txt, then sudo port install weechat.

comment:11 Changed 6 months ago by drwhitehouse

I can confirm that with the workflow you have suggested (i.e. clean, extract, edit the CMakeLists.txt and install) weechat does indeed appear to build successfully with gcc4.2. Having said that it doesn't appear to work very well. It starts up ok and looks normal but when trying to add a server and connect it just hangs. I'll continue testing.

comment:12 Changed 6 months ago by drwhitehouse

As far as I can tell while the program does build and looks ok, it just doesn't seem to want to connect to any irc servers and I can't figure out why. I messed around with dtrace a bit, but I have no idea what is wrong. I'm happy for you to close this ticket, but if you are interested in looking in to this further by all means reply and I'll do what I can to assist.

comment:13 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Keywords: haspatch added

We can fix the build failure:

https://github.com/macports/macports-ports/pull/24006

Regarding the program not working, maybe Calvin has some suggestions, but usually, that's something you should take up with the developers of the program.

comment:14 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In c40d732368c4a87851d9e0b8547b37da57248939/macports-ports (master):

weechat: Remove extra warning flags to fix old GCC

Closes: #70002

Note: See TracTickets for help on using tickets.