Opened 4 years ago

Closed 4 years ago

#59805 closed defect (fixed)

FileZilla @3.46.0: fatal error: 'optional' file not found

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: lhaeger (Lothar Haeger)
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: Cc: chrstphrchvz (Christopher Chavez)
Port: FileZilla

Description

Even though FileZilla now specifies that it requires C++17, it fails to build on 10.13 and earlier with:

In file included from asksavepassworddialog.cpp:3:
In file included from ./Options.h:12:
In file included from ./xmlfunctions.h:16:
./serverdata.h:8:10: fatal error: 'optional' file not found
#include <optional>
         ^~~~~~~~~~
1 error generated.
In file included from asyncrequestqueue.cpp:3:
In file included from ./asyncrequestqueue.h:4:
In file included from ./context_control.h:5:
In file included from ./state.h:5:
In file included from ./sitemanager.h:6:
In file included from ./xmlfunctions.h:16:
./serverdata.h:8:10: fatal error: 'optional' file not found
#include <optional>
         ^~~~~~~~~~
make[4]: *** [filezilla-asksavepassworddialog.o] Error 1
make[4]: *** Waiting for unfinished jobs....
In file included from auto_ascii_files.cpp:3:
In file included from ./Options.h:12:
In file included from ./xmlfunctions.h:16:
./serverdata.h:8:10: fatal error: 'optional' file not found
#include <optional>
         ^~~~~~~~~~
1 error generated.
make[4]: *** [filezilla-auto_ascii_files.o] Error 1
In file included from bookmarks_dialog.cpp:2:
In file included from ./bookmarks_dialog.h:5:
./serverdata.h:8:10: fatal error: 'optional' file not found
#include <optional>
         ^~~~~~~~~~
In file included from aboutdialog.cpp:6:
In file included from ./Options.h:12:
In file included from ./xmlfunctions.h:16:
./serverdata.h:8:10: fatal error: 'optional' file not found
#include <optional>
         ^~~~~~~~~~
1 error generated.
make[4]: *** [filezilla-asyncrequestqueue.o] Error 1
1 error generated.
make[4]: *** [filezilla-aboutdialog.o] Error 1
1 error generated.
make[4]: *** [filezilla-bookmarks_dialog.o] Error 1

Maybe MacPorts base's minimum C++17-supporting clang version information is wrong and needs to be corrected.

But in searching for this problem I have also read that it might be a feature implemented only in newer versions of libc++. If so, I don't know what we do, since libc++ is provided by macOS and we do not have a way to update it.

Change History (4)

comment:1 Changed 4 years ago by kencu (Ken)

We can in fact update the older libc++ on older systems that came with libc++ by using the +replacement_libcxx variant of libcxx. It is not well tested -- I have never done it -- but Jeremy put it there for this reason.

I have a personal libcxx port that uses the libc++ from clang/llvm 7.0, which is quite new, and a newer one than that is probably possible as well. Libc++ builds when we build clang, and new versions of clang build on 10.5 up, so it's just a matter of making it all happen.

I'm not sure if that would install any newer headers though. The usual way of getting new headers is to use a newer clang version from macports-clang-*.

This can be a bit complicated, as sometimes the version of libc++ is tested for in the headers, and various pathways are followed depending on the version found, so it's not just obvious that newer headers gives you all the newer functionality.

I would like to explore how to use a different libc++.dylib for MacPorts-installed software, kind of like we do now for libstdc++.dylib using gcc. This new updated version of libc++.dylib could be installed in ${prefix}/lib for example, and software linked against it. There are some features in the newer-libc++-supported c++17 <filesystem> that we would need to support on older systems using this method. None of this is presently tested at all.

comment:2 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

PR opened: https://github.com/macports/macports-ports/pull/8538

Support for <optional> was introduced in Xcode 10. The port builds fine on macOS 10.9-10.12 using MacPorts' clang 9; avoiding Xcode clang < 10 on macOS 10.13 should suffice.

comment:3 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:4 Changed 4 years ago by chrstphrchvz (Christopher Chavez)

Resolution: fixed
Status: assignedclosed

In 392298bc4ec9cc5ee60eb9de293ab6271266b769/macports-ports (master):

FileZilla: fix build on macOS 10.13

Fixes: #59805

Note: See TracTickets for help on using tickets.