Skip to content

feat: add optional RE2 regex engine support#336

Merged
Daan Timmer (daantimmer) merged 23 commits into
mainfrom
copilot/add-re2-dependency
May 28, 2026
Merged

feat: add optional RE2 regex engine support#336
Daan Timmer (daantimmer) merged 23 commits into
mainfrom
copilot/add-re2-dependency

Conversation

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor

Adds an optional RE2 regex engine backend via a CCR_USE_RE2 CMake option.

  • Introduces a RegexStrategy abstraction with StdRegexStrategy (std::regex) and Re2RegexStrategy (RE2) implementations; TreeRegexp now delegates to the strategy selected by RegexStrategyFactory, falling back to std::regex when RE2 is unavailable
  • RE2 and abseil are fetched via CCR_FETCH_DEPS or auto-detected via find_package; sanitizer flags moved after external dependency fetching to avoid abseil/GCC ASan incompatibility
  • CI matrix extended with -no-re2 presets to verify both code paths on all platforms
  • README updated with CMake options reference and FetchContent usage example

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown

Test Results

27 tests  ±0   27 ✅ ±0   17s ⏱️ -10s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 928f84e. ± Comparison against base commit f3c8f40.

♻️ This comment has been updated with latest results.

@github-actions

github-actions Bot commented May 13, 2026

Copy link
Copy Markdown

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 6 0 0 0.03s
✅ CPP clang-format 238 1 0 0 1.59s
✅ DOCKERFILE hadolint 1 0 0 0.04s
⚠️ MARKDOWN markdownlint 7 4 19 0 1.05s
✅ MARKDOWN markdown-table-formatter 7 4 0 0 0.3s
✅ REPOSITORY git_diff yes no no 0.02s
✅ REPOSITORY grype yes no no 51.63s
✅ REPOSITORY ls-lint yes no no 0.1s
✅ REPOSITORY secretlint yes no no 4.45s
✅ REPOSITORY syft yes no no 1.69s
✅ REPOSITORY trivy yes no no 9.26s
✅ REPOSITORY trivy-sbom yes no no 0.19s
✅ REPOSITORY trufflehog yes no no 5.17s
⚠️ SPELL lychee 86 2 0 3.15s
✅ YAML prettier 10 0 0 0 0.67s
✅ YAML v8r 10 0 0 8.58s
✅ YAML yamllint 10 0 0 0.54s

Detailed Issues

⚠️ SPELL / lychee - 2 errors
[ERROR] https://www.contributor-covenant.org/version/2/0/code_of_conduct.html | Network error: error sending request for url (https://www.contributor-covenant.org/version/2/0/code_of_conduct.html) Maybe a certificate error?
[404] https://github.com/yourname/amp-cucumber-cpp-runner.git | Network error: Not Found
📝 Summary
---------------------
🔍 Total..........169
✅ Successful.....167
⏳ Timeouts.........0
🔀 Redirected.......0
👻 Excluded.........0
❓ Unknown..........0
🚫 Errors...........2

Errors in CODE_OF_CONDUCT.md
[ERROR] https://www.contributor-covenant.org/version/2/0/code_of_conduct.html | Network error: error sending request for url (https://www.contributor-covenant.org/version/2/0/code_of_conduct.html) Maybe a certificate error?

Errors in CONTRIBUTING.md
[404] https://github.com/yourname/amp-cucumber-cpp-runner.git | Network error: Not Found
⚠️ MARKDOWN / markdownlint - 19 errors
CHANGELOG.md:31 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:37 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:44 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:51 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:59 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:63 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:72 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:78 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:86 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:90 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:95 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:104 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:115 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
CHANGELOG.md:123 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:127 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:152 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:159 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Chores"]
cmake/WindowsToolchainFilesProvidedBy.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "<https://github.com/MarkSchofi..."]
README.md:132 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]

See detailed reports in MegaLinter artifacts

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_GIT_DIFF,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

@daantimmer

Copy link
Copy Markdown
Collaborator

Copilot resolve the cmake configure issues

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Copilot resolve the cmake configure issues

Fixed in d625ab2. The issue was that re2's install(EXPORT re2Targets ...) references abseil targets, but they weren't in any export set because ABSL_ENABLE_INSTALL was set to Off. Enabling it (same pattern as JSON_Install "On" for nlohmann_json) puts abseil targets in their own export set, which satisfies re2's install rules.

Copilot AI commented May 28, 2026

Copy link
Copy Markdown
Contributor Author

Copilot there is now duplication in the matrix. I think we can get rid of the 'include' part and add an entry to the preset_suffix

Done — removed the include block and added "-no-re2" as an entry in preset_suffix: ["", "-no-re2"]. All 6 combinations (3 OS × 2 suffixes) are now generated from the single matrix definition without duplication.

Copilot AI requested review from Copilot and removed request for Copilot May 28, 2026 11:30
Copilot AI changed the title feat: add re2/abseil-cpp as optional regex backend docs: complete README usage section with CMake options and FetchContent dependency behavior May 28, 2026
@daantimmer Daan Timmer (daantimmer) changed the title docs: complete README usage section with CMake options and FetchContent dependency behavior feat: add optional RE2 regex engine support May 28, 2026
@sonarqubecloud

Copy link
Copy Markdown

@daantimmer Daan Timmer (daantimmer) merged commit 874dfb5 into main May 28, 2026
27 checks passed
@daantimmer Daan Timmer (daantimmer) deleted the copilot/add-re2-dependency branch May 28, 2026 12:07
Daan Timmer (daantimmer) pushed a commit that referenced this pull request Jul 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[4.1.0](v4.0.1...v4.1.0)
(2026-07-03)


### Features

* Add optional RE2 regex engine support
([#336](#336))
([874dfb5](874dfb5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: philips-software-forest-releaser[bot] <80338643+philips-software-forest-releaser[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants