Bug 250376 - devel/abseil: Change to C++17 to allow all dependent ports to build
Summary: devel/abseil: Change to C++17 to allow all dependent ports to build
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-15 18:34 UTC by Yuri Victorovich
Modified: 2020-12-29 22:29 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments
patch (474 bytes, patch)
2020-10-15 18:34 UTC, Yuri Victorovich
no flags Details | Diff
Change devel/abseil to C++17 (570 bytes, patch)
2020-12-12 16:44 UTC, Yuri Victorovich
no flags Details | Diff
Change multimedia/libgav1 to C++17 (1.05 KB, patch)
2020-12-12 16:47 UTC, Yuri Victorovich
jbeich: maintainer-approval+
Details | Diff
Change audio/webrtc-audio-processing to C++17 (1.70 KB, patch)
2020-12-12 16:49 UTC, Yuri Victorovich
jbeich: maintainer-approval+
Details | Diff
Change multimedia/libgav1 to C++17 (1.39 KB, patch)
2020-12-12 17:27 UTC, Yuri Victorovich
no flags Details | Diff
Change audio/webrtc-audio-processing to C++17 (1.74 KB, patch)
2020-12-12 17:29 UTC, Yuri Victorovich
no flags Details | Diff
Change multimedia/libgav1 to C++17 (1.39 KB, patch)
2020-12-12 18:59 UTC, Yuri Victorovich
jbeich: maintainer-approval+
Details | Diff
Change audio/webrtc-audio-processing to C++17 (1.74 KB, patch)
2020-12-12 19:00 UTC, Yuri Victorovich
jbeich: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2020-10-15 18:34:28 UTC
Created attachment 218773 [details]
patch

Hello Alexey,

Without -std=c++17 devel/abseil causes dependent port failure, for example math/or-tools (version 8.0) fails to compile. See the suggestion of or-tools' upstream maintainer that abseil needs c++17 here: https://github.com/google/or-tools/issues/2196#issuecomment-707762185


Thank you,
Yuri
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2020-10-15 19:20:45 UTC
Comment on attachment 218773 [details]
patch

I take back the original patch.

It looks like this port should be flavorized based on the C++ standard used in it, since users seem to be sensitive to this.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2020-10-15 19:39:12 UTC
I suggested the upstream to uniquify paths based on CMAKE_CXX_STANDARD: https://github.com/abseil/abseil-cpp/issues/820

Otherwise it wouldn't be possible to update math/or-tools to 8.0.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 16:44:03 UTC
Created attachment 220498 [details]
Change devel/abseil to C++17

abseil's API changes depending on C++ standard it was built with.

As a consequence, dependent ports have to use the same C++ standard.

One abseil user, math/or-tools, uses C++17 and fails to compile with abseil because it currently uses the default C++ level, which is less than C++17.

The easy solution is to force C++17 in devel/abseil and its dependencies.

The attached patch does this in devel/abseil, patches for dependencies are to follow.
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 16:47:16 UTC
Created attachment 220499 [details]
Change multimedia/libgav1 to C++17

multimedia/libgav1 depends on abseil, for approval by jbeich@.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 16:49:14 UTC
Created attachment 220500 [details]
Change audio/webrtc-audio-processing to C++17

audio/webrtc-audio-processing depends on abseil, for approval by jbeich@.
Comment 6 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 16:55:01 UTC
One example of API differences:

abseil compiled by default exports the symbol:
> absl::lts_2020_09_23::FailedPreconditionError(absl::lts_2020_09_23::string_view)

In abseil compiled with C++17 this symbol becomes:
> absl::lts_2020_09_23::FailedPreconditionError(std::__1::basic_string_view<char, std::__1::char_traits<char> >)
Comment 7 Jan Beich freebsd_committer freebsd_triage 2020-12-12 17:02:11 UTC
Comment on attachment 220499 [details]
Change multimedia/libgav1 to C++17

Looks OK but add "- Sync -std= with devel/abseil to match ABI" as patch header (top of the file).
Comment 8 Jan Beich freebsd_committer freebsd_triage 2020-12-12 17:05:56 UTC
Comment on attachment 220500 [details]
Change audio/webrtc-audio-processing to C++17

Same as comment 7.
Comment 9 Jan Beich freebsd_committer freebsd_triage 2020-12-12 17:08:48 UTC
Comment on attachment 220499 [details]
Change multimedia/libgav1 to C++17

Maybe convert USES=compiler:c++11-lib to USES=compiler:c++17-lang for consistency with audio/webrtc-audio-processing. Nowadays there's no difference between individual USES=compiler:c++* values other than requesting newer GCC on FreeBSD < 13 powerpc*.
Comment 10 Jan Beich freebsd_committer freebsd_triage 2020-12-12 17:22:07 UTC
Comment on attachment 220498 [details]
Change devel/abseil to C++17

Maybe convert CMAKE_ARGS=-DBUILD_SHARED_LIBS:BOOL=on to CMAKE_ON=BUILD_SHARED_LIBS then put CMAKE_ARGS=-DCMAKE_CXX_STANDARD:STRING=17 on a separate line with a commented URL above it.
Comment 11 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 17:27:59 UTC
Created attachment 220501 [details]
Change multimedia/libgav1 to C++17
Comment 12 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 17:29:53 UTC
Created attachment 220502 [details]
Change audio/webrtc-audio-processing to C++17
Comment 13 Jan Beich freebsd_committer freebsd_triage 2020-12-12 18:04:33 UTC
Comment on attachment 220501 [details]
Change multimedia/libgav1 to C++17

Typo: c++17-lib vs. c++17-lang.

$ make
===>  libgav1-0.16.0_1 Invalid argument "c++17-lib", valid arguments are:
c++11-lib c++11-lang c++14-lang c++17-lang c11 features openmp env nestedfct
c++0x gcc-c++11-lib.
*** Error code 1
Comment 14 Jan Beich freebsd_committer freebsd_triage 2020-12-12 18:08:17 UTC
Comment on attachment 220502 [details]
Change audio/webrtc-audio-processing to C++17

> @@ -0,0 +1,12 @@
> +- Sync -std= with devel/abseil to match ABI
> +--- meson.build.orig	2020-12-12 16:13:37 UTC
> ++++ meson.build
> +@@ -4,7 +4,7 @@ project('webrtc-audio-processing-1', 'c', 'cpp',

Can you separate the patch header ("- Sync ...") and the patch itself ("--- meson.build ...") with a newline for better readability? See how it's done in multimedia/libgav1 or apply the following:

--- audio/webrtc-audio-processing/files/patch-meson.build.orig
+++ audio/webrtc-audio-processing/files/patch-meson.build
@@ -1,4 +1,5 @@
 - Sync -std= with devel/abseil to match ABI
+
 --- meson.build.orig	2020-12-12 16:13:37 UTC
 +++ meson.build
 @@ -4,7 +4,7 @@ project('webrtc-audio-processing-1', 'c', 'cpp',
Comment 15 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 18:59:40 UTC
Created attachment 220508 [details]
Change multimedia/libgav1 to C++17
Comment 16 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-12 19:00:58 UTC
Created attachment 220509 [details]
Change audio/webrtc-audio-processing to C++17
Comment 17 commit-hook freebsd_committer freebsd_triage 2020-12-29 22:26:00 UTC
A commit references this bug:

Author: yuri
Date: Tue Dec 29 22:25:03 UTC 2020
New revision: 559622
URL: https://svnweb.freebsd.org/changeset/ports/559622

Log:
  devel/abseil: Change to C++17 to allow all dependent ports to build

  PR:		250376
  Approved by:	danfe (maintainer's timeout)

Changes:
  head/devel/abseil/Makefile
Comment 18 commit-hook freebsd_committer freebsd_triage 2020-12-29 22:27:01 UTC
A commit references this bug:

Author: yuri
Date: Tue Dec 29 22:26:41 UTC 2020
New revision: 559624
URL: https://svnweb.freebsd.org/changeset/ports/559624

Log:
  multimedia/libgav1: Sync -std= with devel/abseil to match ABI

  PR:		250376
  Approved by:	jbeich

Changes:
  head/multimedia/libgav1/Makefile
  head/multimedia/libgav1/files/patch-CMakeLists.txt
Comment 19 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-29 22:28:32 UTC
All committed.
Comment 20 commit-hook freebsd_committer freebsd_triage 2020-12-29 22:29:02 UTC
A commit references this bug:

Author: yuri
Date: Tue Dec 29 22:28:15 UTC 2020
New revision: 559625
URL: https://svnweb.freebsd.org/changeset/ports/559625

Log:
  audio/webrtc-audio-processing: Sync -std= with devel/abseil to match ABI

  PR:		250376
  Approved by:	jbeich (maintainer)

Changes:
  head/audio/webrtc-audio-processing/Makefile
  head/audio/webrtc-audio-processing/files/
  head/audio/webrtc-audio-processing/files/patch-meson.build