Bug 260402 - devel/re2: Update to 2023-06-02
Summary: devel/re2: Update to 2023-06-02
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL: https://github.com/google/re2/compare...
Keywords:
: 272832 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-12-13 22:51 UTC by Yuri Victorovich
Modified: 2023-08-28 13:41 UTC (History)
6 users (show)

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


Attachments
patch (1.90 KB, patch)
2021-12-13 22:51 UTC, Yuri Victorovich
no flags Details | Diff
patch (1.89 KB, patch)
2021-12-13 22:53 UTC, Yuri Victorovich
no flags Details | Diff
patch (1.37 KB, patch)
2022-04-24 19:24 UTC, Yuri Victorovich
no flags Details | Diff
patch (1.57 KB, patch)
2022-04-25 16:14 UTC, Yuri Victorovich
no flags Details | Diff
patch (1.55 KB, patch)
2022-04-25 16:23 UTC, Yuri Victorovich
no flags Details | Diff
patch (2.59 KB, patch)
2022-05-22 03:47 UTC, Yuri Victorovich
no flags Details | Diff
Patch for CMake-ification (4.88 KB, patch)
2022-11-12 23:12 UTC, Adriaan de Groot
no flags Details | Diff
Refresh Patch for CMake-ification (4.69 KB, patch)
2023-02-03 22:06 UTC, Daniel Engberg
no flags Details | Diff
Patch for re2 (3.94 KB, patch)
2023-06-18 07:50 UTC, Daniel Engberg
no flags 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 2021-12-13 22:51:45 UTC
Created attachment 230092 [details]
patch

Hello Sunpoet,

Besides the update, the attached patch:
* changes to cmake and makes the package install cmake files
* adds the 'test' target


databases/arrow finds re2 through cmake, this was the motivation.


Thank you,
Yuri
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2021-12-13 22:53:03 UTC
Created attachment 230093 [details]
patch
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2021-12-14 10:15:04 UTC
We still need the pc file afaik?

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=254697
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2022-04-24 19:24:00 UTC
Created attachment 233454 [details]
patch

Update the patch.

Some projects (or-tools) now depend on cmake files, and some other projects (bloaty) depend on .pc files.

The linked upstream bug report needs to be fixed first.
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2022-04-25 16:14:29 UTC
Created attachment 233482 [details]
patch

Now .pc file is installed along with cmake files.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2022-04-25 16:23:00 UTC
Created attachment 233484 [details]
patch
Comment 6 Adriaan de Groot freebsd_committer freebsd_triage 2022-05-02 13:51:44 UTC
Is there a specific reason to replace `USES=gmake` ? Is it incompatible with the CMake build? Why is gmake still involved, anyway, since the CMake use on FreeBSD defaults to using ninja as the actual build system? (Answer: to invoke the common-install target; it would probably be better to generate and install the PC files from CMake as well, even if that needs a downstream patch)

There's a duplicate CMAKE_*_ON setting for RE2_BUILD_TESTING; you only need CMAKE_TESTING_ON for that one (because then TESTING off means that the CMake option will be explicitly turned off, too).
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-02 15:48:14 UTC
(In reply to Adriaan de Groot from comment #6)

> Is there a specific reason to replace `USES=gmake` ?

USES=gmake doesn't install .cmake files needed for some dependencies.

> Why is gmake still involved [...]

gmake is used to install the .pc file in a post- step, which is still needed for some dependencies. This was recommended by the upstream.

> There's a duplicate CMAKE_*_ON setting for RE2_BUILD_TESTING [...]

It isn't duplicate. If you would remove CMAKE_OFF=RE2_BUILD_TESTING it would build tests during normal build. This line prevents that.



Hope this answers your questions.


Best,
Yuri
Comment 8 Daniel Engberg freebsd_committer freebsd_triage 2022-05-02 23:35:33 UTC
@sunpoet
If the reason for holding this back is because you don't feel comfortable with CMake please consider letting someone else adopt the port.
Comment 9 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-05-09 18:42:48 UTC
(In reply to Yuri Victorovich from comment #0)

> databases/arrow finds re2 through cmake, this was the motivation.

arrow builds fine right now. Why do we need this patch?

(In reply to Yuri Victorovich from comment #5)

Is it possible to simply run cmake to generate and install .cmake files?
Otherwise, please install libre2.a.
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-09 18:48:58 UTC
(In reply to Po-Chuan Hsieh from comment #9)



> arrow builds fine right now. Why do we need this patch?

Because some of Facebook ports (devel/folly or its dependencies) require cmake files.


> Is it possible to simply run cmake to generate and install .cmake files?
> Otherwise, please install libre2.a.

That's what is done here - cmake installs cmake files. I don't think cmake can be run as an add-on to gnake build, though.


Yuri
Comment 11 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-18 02:41:45 UTC
sunpoet,

What's your objection for this patch?

All it does is adding *.cmake files for some dependencies that expect them.

I have ~8 Facebook ports held up by this issue.



Yuri
Comment 12 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-05-22 03:34:17 UTC
(In reply to Yuri Victorovich from comment #11)

As I said in comment #9, please install libre2.a.
Comment 13 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-22 03:47:54 UTC
Created attachment 234102 [details]
patch

The updated patch installs the static library.
Comment 14 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-06-04 01:53:48 UTC
(In reply to Yuri Victorovich from comment #13)

It does not install libre2.a.

I do not like combining cmake and gmake. I'm working on the cmake patch to install re2.pc.
Comment 15 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-06-04 02:20:48 UTC
BTW, I thought CXXFLAGS+=-I${WRKSRC} can be removed by patching CMakeLists.txt. Do you have any idea why "target_include_directories(re2 PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)" does not work?
Comment 16 Yuri Victorovich freebsd_committer freebsd_triage 2022-06-04 02:46:20 UTC
(In reply to Po-Chuan Hsieh from comment #15)

I am not sure why doesn't it work.
I'd personally keep CXXFLAGS+=-I${WRKSRC} since it looks simpler.
Comment 17 Po-Chuan Hsieh freebsd_committer freebsd_triage 2022-06-16 14:09:02 UTC
I still does not find a way to remove CXXFLAGS+=-I${WRKSRC}.

Here's my work to install all required file via cmake.
https://people.freebsd.org/~sunpoet/patch/devel-re2.txt
Comment 18 Adriaan de Groot freebsd_committer freebsd_triage 2022-11-12 23:12:00 UTC
Created attachment 238046 [details]
Patch for CMake-ification

I have updated Yuri's patch so it works better:
- When doing testing, you also need pkgconf and pcre installed (because the tests compare against pcre behavior, and we need pkgconf to find pcre). I have added that to the CMakeLists.txt, not to the port Makefile (because I don't know if TESTING_BUILD_DEPENDS is even a thing -- strikes me as something Yuri should chase).
- Running `make test` does take about 10 minutes, the exhaustive tests are exhaustive.
- I have ignored the BUILD_INTERFACE issue and just added the source directory to the includes. Bear in mind that the generator (make vs ninja) might influence things here.
- The tests need to link to pcre, but also need the include path (because we're not Linux, and pcre lives in ${LOCALBASE}).

I don't have any tests -- e.g. "can you find re2 with pkgconf after this" and "can you find re2 with CMake" -- and consider that's something Yuri should figure out.
Comment 19 Adriaan de Groot freebsd_committer freebsd_triage 2022-11-12 23:13:14 UTC
Er .. I mean "Po-Chuan Hsieh's patch" in that last comment, I used the last patch attached to this issue, which was from them.
Comment 20 Adriaan de Groot freebsd_committer freebsd_triage 2022-12-30 22:28:13 UTC
@yuri: ping? I believe the test-this-patch part is in your court now.
Comment 21 Daniel Engberg freebsd_committer freebsd_triage 2022-12-31 11:03:27 UTC
Please also submit this patch upstream, https://github.com/google/re2
Comment 22 Daniel Engberg freebsd_committer freebsd_triage 2023-02-03 22:06:11 UTC
Created attachment 239890 [details]
Refresh Patch for CMake-ification

Update to latest upstream version
Adjust port for follow Porters Handbook more closely
Add TEST option

Compile and runtime tested on FreeBSD 13.1-STABLE (amd64) (make, make check-plist, make test)
Poudriere testport OK 12.3-RELEASE (amd64)
Poudriere testport OK 13.1-RELEASE (i386)
Comment 23 Daniel Engberg freebsd_committer freebsd_triage 2023-06-18 07:50:30 UTC
Created attachment 242859 [details]
Patch for re2
Comment 24 Daniel Engberg freebsd_committer freebsd_triage 2023-06-18 08:08:01 UTC
Compile and runtime tested on FreeBSD 13.2-RELEASE (aarch64) (make, make check-plist, make test)
Compile and runtime tested on FreeBSD 13.2-RELEASE (amd64) (make, make check-plist, make test)

Poudriere testport OK 12.4-RELEASE (amd64)
Poudriere testport OK 13.2-RELEASE (amd64)

Tested with following users in Poudriere (13.2-RELEASE, amd64):
cad/camotics
databases/arrow - Fails (also fails due to Googletest on build cluster)
  error: no member named 'as_string' in 'absl::string_view'
devel/bear
devel/bloaty -Fails
  error: no member named 'LogPrefixHook' in namespace 'absl::raw_logging_internal'
devel/cbang
devel/electron19
devel/electron21
devel/electron22
devel/electron23
devel/electron24 - Fails unrelated (unable to fetch)
devel/google-cloud-cpp
devel/google-cloud-cpp117
devel/grpc
devel/grpc142
devel/libddwaf
devel/py-google-re2
devel/rubygem-re2
dns/dnsdist
editors/vscode
math/or-tools - Fails
  error: no member named 'as_string' in 'std::string_view'
math/py-or-tools - Fails, same as above
net-im/mtxclient
science/py-tensorflow
textproc/kibana7 - Fails
  error: no member named 'as_string' in 'absl::string_view'
textproc/kibana8 - Fails, same as above
www/chromium
www/iridium
www/qt5-webengine
www/qt6-webengine - Fails,
  error: no member named 'set' in 'absl::string_view'
www/ungoogled-chromium
Comment 25 Daniel Engberg freebsd_committer freebsd_triage 2023-07-31 00:36:46 UTC
*** Bug 272832 has been marked as a duplicate of this bug. ***
Comment 26 commit-hook freebsd_committer freebsd_triage 2023-08-28 13:41:37 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9d23691afbbc151dbc63933dc8ea370afc391eed

commit 9d23691afbbc151dbc63933dc8ea370afc391eed
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2023-08-28 13:23:32 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2023-08-28 13:40:40 +0000

    www/qt6-webengine: Switch to bundled re2

    * Prepare the port for newer versions of devel/re2, which also require
      devel/abseil.  This combination however causes build errors [1] due
      to missing symbols:

    [...]
    In file included from gen/extensions/browser/browser_sources_jumbo_8.cc:6:
    ./../../../../../qtwebengine-everywhere-src-6.5.2/src/3rdparty/chromium/extensions/browser/api/web_request/form_data_parser.cc:429:11: error: no member named 'set' in 'absl::string_view'
      source_.set(source.data(), source.size());
      ~~~~~~~ ^
    ./../../../../../qtwebengine-everywhere-src-6.5.2/src/3rdparty/chromium/extensions/browser/api/web_request/form_data_parser.cc:573:11: error: no member named 'set' in 'absl::string_view'
      source_.set(source.data(), source.size());
      ~~~~~~~ ^
    [...]

      Unbundling abseil and its-subcomponents via "replace_gn_files.py" didn't
      help hence switch to the bundled re2 for now to have a consistent
      combination of re2 and abseil.

    * Bump PORTREVISION due dependency change.

    PR:             260402 [1]
    Reported by:    diizzy [1]
    Reviewed by:    diizzy, tcberner
    Differential Revision:  https://reviews.freebsd.org/D41571

 www/qt6-webengine/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)