Opened 5 months ago

Closed 9 days ago

#69975 closed defect (fixed)

re2 @2024-04-01_2: fails to build on macOS 10.12/Xcode 9.2 due to <optional> not found in abseil headers

Reported by: andlabs (Pietro Gagliardi) Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version: 2.9.3
Keywords: haspatch Cc: FlyingSamson
Port: re2

Description

Not sure if this is an issue with re2 or with abseil, but re2 is including abseil's std::optional improvements and it's failing to build on macOS 10.12 with Xcode 9.2:

:info:build /usr/bin/clang++ -Dre2_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01 -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -std=gnu++1z -arch x86_64 -mmacosx-version-min=10.12 -fPIC -MD -MT CMakeFiles/re2.dir/re2/compile.cc.o -MF CMakeFiles/re2.dir/re2/compile.cc.o.d -o CMakeFiles/re2.dir/re2/compile.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/compile.cc
:info:build /usr/bin/clang++ -Dre2_EXPORTS -I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01 -isystem /opt/local/include -pipe -Os -DNDEBUG -I/opt/local/include -stdlib=libc++ -std=gnu++1z -arch x86_64 -mmacosx-version-min=10.12 -fPIC -MD -MT CMakeFiles/re2.dir/re2/bitmap256.cc.o -MF CMakeFiles/re2.dir/re2/bitmap256.cc.o.d -o CMakeFiles/re2.dir/re2/bitmap256.cc.o -c /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/bitmap256.cc
:info:build In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/filtered_re2.cc:5:
:info:build In file included from In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/bitstate.cc:28:
:info:build /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/filtered_re2.hIn file included from :/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/prog.h:2922:
:info:build :
:info:build In file included from In file included from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/re2.h/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_re2/re2/work/re2-2024-04-01/re2/re2.h::224224:
:info:build :
:info:build /opt/local/include/absl/types/optional.h:43:10: fatal error: 'optional' file not found
:info:build /opt/local/include/absl/types/optional.h:43:10: fatal error: 'optional' file not found
:info:build #include <optional>  // IWYU pragma: export
:info:build          ^~~~~~~~~~
:info:build #include <optional>  // IWYU pragma: export
:info:build          ^~~~~~~~~~

Is this a case of needing MacPorts libc++? This only started happening with this version; I'd have assumed it would show up sooner, *and* that <optional> would be in system libc++ if it supports c++1z...

I have no variants set on either abseil or re2.

Attachments (1)

main.log (28.8 KB) - added by andlabs (Pietro Gagliardi) 5 months ago.
build log

Download all attachments as: .zip

Change History (11)

Changed 5 months ago by andlabs (Pietro Gagliardi)

Attachment: main.log added

build log

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

Summary: re2@2024-04-01_2: fails to build on macOS 10.12/Xcode 9.2 due to <optional> not found in abseil headersre2 @2024-04-01_2: fails to build on macOS 10.12/Xcode 9.2 due to <optional> not found in abseil headers

The <optional> header is new in C++17. Anything using Abseil now needs C++17. re2 currently only asks for C++14 so that needs to be changed.

comment:2 Changed 5 months ago by andlabs (Pietro Gagliardi)

Is that not what gnu++1z enables? Or does that use a different header path?

comment:3 Changed 4 months ago by FlyingSamson

In theory yes. But in the end the availability of a features also depends on whether it was implemented in the specific compiler. The compiler support list lists std::optional as available since apple clang 10.0.0. Does the /usr/bin/clang++ shown in your log meet this version requirement?

comment:4 Changed 4 months ago by FlyingSamson

From this apple clang vs Xcode version list, I would expect that your /usr/bin/clang++ is of version 9.0.0.

comment:5 Changed 4 months ago by andlabs (Pietro Gagliardi)

Correct

Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Last edited 4 months ago by andlabs (Pietro Gagliardi) (previous) (diff)

comment:6 Changed 4 months ago by FlyingSamson

Cc: FlyingSamson added

comment:7 Changed 4 months ago by FlyingSamson

I'm no expert with this, but could this be solved by changing

compiler.blacklist-append \
                    {clang < 900} 

to

compiler.blacklist-append \
                    {clang < 1000} 

in abseil's portfile?

Last edited 4 months ago by FlyingSamson (previous) (diff)

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

Keywords: haspatch added

Don't blacklist compilers manually; use compiler.cxx_standard 2017 to tell MacPorts what standard is needed so that it can select a compiler that supports that.

See https://github.com/macports/macports-ports/pull/23963

comment:9 Changed 4 weeks ago by andlabs (Pietro Gagliardi)

Still occurring with @2024-04-01_3. Furthermore, abseil @20240722.0_0 has a linking incompatibility with re2 @2024-04-01_1, forcing a rebuild that also fails (since I only have _3's source now). Have to activate abseil @20240116.2_1 to fix it for now.

Last edited 4 weeks ago by andlabs (Pietro Gagliardi) (previous) (diff)

comment:10 Changed 9 days ago by FlyingSamson

Resolution: fixed
Status: assignedclosed

In 765dbb8903b4ed6e63e724a90ed6a34cab292a65/macports-ports (master):

abseil-dependents: Use c++17 standard

Fixes: #69975
Fixes: #70047

Note: See TracTickets for help on using tickets.