Opened 4 years ago

Closed 20 months ago

#61031 closed defect (fixed)

qt5*-qtlocation: build errors due to <experimental/optional> removal

Reported by: chrstphrchvz (Christopher Chavez) Owned by: MarcusCalhoun-Lopez (Marcus Calhoun-Lopez)
Priority: Normal Milestone:
Component: ports Version: 2.6.3
Keywords: Cc:
Port: qt59-qtlocation qt511-qtlocation

Description (last modified by chrstphrchvz (Christopher Chavez))

qt59-location build fails on 10.15:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -DNDEBUG -DQT_IMAGE_DECODERS -DRAPIDJSON_HAS_STDSTRING=1 -DMBGL_USE_GLES2 -D__QT__ -O3 -ftemplate-depth=1024 -fvisibility-inlines-hidden -fvisibility=hidden -DMBGL_VERSION_REV=\"qt-v1.2.0\" -Os -fPIC -std=c++1y  -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.15 -w -fvisibility=hidden -fvisibility-inlines-hidden -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_DEBUG -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_SQL_LIB -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I. -Ideps/boost/1.62.0 -Ideps/boost/1.62.0/include -Ideps/cheap-ruler/2.5.3 -Ideps/cheap-ruler/2.5.3/include -Ideps/earcut/0.12.4 -Ideps/earcut/0.12.4/include -Ideps/geojson/0.4.2 -Ideps/geojson/0.4.2/include -Ideps/geojsonvt/6.3.0 -Ideps/geojsonvt/6.3.0/include -Ideps/geometry/0.9.2 -Ideps/geometry/0.9.2/include -Ideps/kdbush/0.1.1-1 -Ideps/kdbush/0.1.1-1/include -Ideps/pixelmatch/0.10.0 -Ideps/pixelmatch/0.10.0/include -Ideps/polylabel/1.0.3 -Ideps/polylabel/1.0.3/include -Ideps/protozero/1.5.2 -Ideps/protozero/1.5.2/include -Ideps/rapidjson/1.1.0 -Ideps/rapidjson/1.1.0/include -Ideps/shelf-pack/2.1.1 -Ideps/shelf-pack/2.1.1/include -Ideps/supercluster/0.2.2 -Ideps/supercluster/0.2.2/include -Ideps/unique_resource/cba309e -Ideps/unique_resource/cba309e/include -Ideps/variant/1.1.4 -Ideps/variant/1.1.4/include -Ideps/vector-tile/1.0.0-rc7 -Ideps/vector-tile/1.0.0-rc7/include -Ideps/wagyu/0.4.3 -Ideps/wagyu/0.4.3/include -Iinclude -Iplatform/default -Iplatform/qt -Iplatform/qt/include -Isrc -I/opt/local/libexec/qt5/lib/QtNetwork.framework/Headers/5.9.9 -I/opt/local/libexec/qt5/lib/QtNetwork.framework/Headers/5.9.9/QtNetwork -I/opt/local/libexec/qt5/lib/QtGui.framework/Headers/5.9.9 -I/opt/local/libexec/qt5/lib/QtGui.framework/Headers/5.9.9/QtGui -I/opt/local/libexec/qt5/lib/QtSql.framework/Headers/5.9.9 -I/opt/local/libexec/qt5/lib/QtSql.framework/Headers/5.9.9/QtSql -I/opt/local/libexec/qt5/lib/QtCore.framework/Headers/5.9.9 -I/opt/local/libexec/qt5/lib/QtCore.framework/Headers/5.9.9/QtCore -I/opt/local/libexec/qt5/lib/QtNetwork.framework/Headers -I/opt/local/libexec/qt5/lib/QtGui.framework/Headers -I/opt/local/libexec/qt5/lib/QtSql.framework/Headers -I/opt/local/libexec/qt5/lib/QtCore.framework/Headers -I.moc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/AGL.framework/Headers -I/opt/local/libexec/qt5/mkspecs/macx-clang -F/opt/local/libexec/qt5/lib -o .obj/platform/qt/src/http_file_source.o platform/qt/src/http_file_source.cpp

In file included from platform/qt/src/http_request.cpp:1:
In file included from platform/qt/src/http_request.hpp:3:
In file included from src/mbgl/storage/http_file_source.hpp:3:
In file included from include/mbgl/storage/file_source.hpp:3:
In file included from include/mbgl/storage/response.hpp:4:
include/mbgl/util/optional.hpp:3:10: fatal error: 'experimental/optional' file not found
#include <experimental/optional>
         ^~~~~~~~~~~~~~~~~~~~~~~

qt511-qtlocation build fails on 10.15 for a similar reason (although somehow not because of including <experimental/optional>):

include/mbgl/util/optional.hpp:8:23: error: no member named 'experimental' in namespace 'std'

According to Xcode 11 release notes:

The <experimental/optional> and <experimental/variant> headers are removed. Use <optional> and <variant> from C++17 instead.

(The Xcode 10.2 release notes had warned about these headers' deprecation and pending removal.)

Not sure if other older Qt5 versions' ports are affected.

See also the upstream mapbox-gl-native issue, which appears was dealt with (at the time) by bundling a replacement <optional>.

Change History (9)

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

Description: modified (diff)

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

not a whole lot of need to fix qt59-* ports to build on 10.15, is there? How about we just fail them out on newer systems?

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

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

I agree that users are probably better off with newer Qt5, at the expense of letting users on older OSes figure out build problems in older Qt5 versions which happen regardless of macOS version. (I was prompted to look into any of this when trying to test a fix for #61006. Also, #60889 was reported by a 10.15 user.)

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

qt5 is very complicated to make work properly across macports' range of systems.

Marcus has invested 100s if not 1000s of hours in the various qt5 ports.

I wouldn't do much to them until he returns unless really urgent.

we spend some time making newer qt5 versions work on older systems, but very little making older qt5 versions build on newer systems as there is generally little point to that.

In most cases, the user should install the newer qt5 version appropriate for their newer os instead.

Last edited 4 years ago by kencu (Ken) (previous) (diff)

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

Description: modified (diff)
Port: qt511-qtlocation added
Summary: qt59-qtlocation: fatal error: 'experimental/optional' file not foundqt5*-qtlocation: build errors due to <experimental/optional> removal

Revised to mention similar error with qt511-qtlocation, which I do not currently know of a possible fix for.

See also the upstream issue, which appears was dealt with (at the time) by bundling a replacement <optional>.

Version 0, edited 4 years ago by chrstphrchvz (Christopher Chavez) (next)

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

Description: modified (diff)

comment:8 Changed 21 months ago by chrstphrchvz (Christopher Chavez)

I have successfully built qt59-qtlocation on macOS 12, and qt511-qtlocation on macOS 10.15, by adding the 3rd-party <experimental/optional> header and updating the mapbox-gl-native build configuration (as done in slightly newer qtlocation), and backporting a build fix from upstream mapbox-gl-native. To be added to https://github.com/macports/macports-ports/pull/15454

Last edited 21 months ago by chrstphrchvz (Christopher Chavez) (previous) (diff)

comment:9 Changed 20 months ago by chrstphrchvz (Christopher Chavez)

Resolution: fixed
Status: assignedclosed

In 84cbbe27a97fc1068aaa75ef9e9ba6a155457ded/macports-ports (master):

qt(59|511)-qtlocation: fix build for Xcode ≥ 11

Fixes: #61031

[skip ci]

Note: See TracTickets for help on using tickets.