Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#61021 closed defect (fixed)

defect: lftp 4.9.2 still does not compile

Reported by: remkos (Remko Scharroo) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port:

Description

Despite the changes made as result of ticket #61014, lftp @4.9.2 does not compile.

It looks like this is because the compilation tries to compile the trio version inside the package, instead of using the trio library that is intended to be linked. That internal version has "#include <cmath>" which does not work as <cmath> cannot be found.

See log file attached.

Attachments (2)

main.log (733.4 KB) - added by remkos (Remko Scharroo) 4 years ago.
main.log showing error
mp-lftp-4.9.2-config_log-snippet.txt (14.1 KB) - added by chadcatlett (Chad Catlett) 4 years ago.

Download all attachments as: .zip

Change History (10)

Changed 4 years ago by remkos (Remko Scharroo)

Attachment: main.log added

main.log showing error

comment:1 Changed 4 years ago by remkos (Remko Scharroo)

By the way: MacOS 10.15.6 Command Line Tools: 11.5 (XCode 11.6 never came out with new command line tools)

comment:2 Changed 4 years ago by Schamschula (Marius Schamschula)

According to ./configure --help, there is no way of manually specifying which version of trio is used.

I will continue to investigate.

However, I get clean builds on my own machines.

comment:3 Changed 4 years ago by Schamschula (Marius Schamschula)

In your log file I see

configure checking if trio library is needed... yes (because %lld fails)

On my machines I get

configure checking if trio library is needed... no

I get this with and without trace mode on macOS 10.15.6 with Xcode 11.6.

In terms of the installed command line tools, I get

xcode-select --version
xcode-select version 2373.

I suspect there is something else going on on on your machine. I'll remove the trio dependency, as lftp builds it's own version of trio if the test fails.

Changed 4 years ago by chadcatlett (Chad Catlett)

comment:4 Changed 4 years ago by chadcatlett (Chad Catlett)

I had a few chances today to dig into why lftp wasn't compiling on my machine.

Specifically I dug into needtrio.m4 that comes with lftp's tarball. I've uploaded the relevant config.log section to http://xx0r.net/mp-lftp-4.9.2-config_log-snippet.txt as well as attached here.

In the logfile it shows the error being from "-Werror=implicit-function-declaration".

If the autoconf configure script determines that trio is needed it defines a C constant named TRIO_REPLACE_STDIO and sets the autoconf/automake variable NEED_TRIO to yes *reason*.

It is referenced in Makefile.am here, which tells the generated Makefile to build the code in the trio directory of the tarball.

In src/Makefile.am it is referenced in a few places here, here, and here. These usages set the bundled trio to be linked into the binary as well as setting up the include path to include the bundled trio's directory.

So that sets things up for failure in terms of if trio is needed or not.

There is another unrelated issue with lftp that is related to the bundled trio itself, which is that it is using C++ headers in a C file which is a big no-no.

comment:5 Changed 4 years ago by neverpanic (Clemens Lang)

So it seems even though you're not compiling for arm64 where this would be required, your version of clang now defaults to -Werror=implicit-function-declaration.

needtrio.m4 needs to be patched so that it includes the required headers. In addition to that, the Portfile will need use_autoreconf yes to make sure this change affects the configure script.

The issue with the bundled trio is then probably no longer relevant, as I'm not aware of any supported platform where trio would still be required.

comment:6 Changed 4 years ago by Schamschula (Marius Schamschula)

It sure looks like one would get this error with Xcode 12.

comment:7 Changed 4 years ago by Schamschula (Marius Schamschula)

Resolution: fixed
Status: assignedclosed

In 0f1fa09c0d09b98cb7c9bb40b94fdc46f4b8cdd0/macports-ports (master):

lftp: patch needtrio.m4 rather than configure

Closes: #61021

comment:8 Changed 4 years ago by remkos (Remko Scharroo)

Thanks for digging so deep. This worked! Clearly there were a number of interfering things. It is always difficult when you have both bundled and external libraries. I think that in the end I had the Command Line Tools Beta 4 for XCode 12 installed. So I downgraded to Command Line Tools 11.5.

Note: See TracTickets for help on using tickets.