Skip to content

Remove PCRE references, complete migration to PCRE2 - #12685

Merged
bryancall merged 2 commits into
apache:masterfrom
bryancall:remove-pcre-refs
Dec 1, 2025
Merged

bryancall merged 2 commits into
apache:masterfrom
bryancall:remove-pcre-refs

Conversation

@bryancall

@bryancall bryancall commented Nov 21, 2025

Copy link
Copy Markdown
Contributor

This PR completes the migration from PCRE (version 1) to PCRE2 throughout the Apache Traffic Server codebase by removing all remaining PCRE references.

Fixes #8780

Changes

  • Remove cmake/FindPCRE.cmake (no longer needed)
  • Update all CMakeLists.txt files to use PkgConfig::PCRE2 instead of PCRE::PCRE
  • Remove find_package(PCRE) from main CMakeLists.txt
  • Update code comments from PCRE to PCRE2 in plugin sources:
    • plugins/prefetch
    • plugins/cachekey
    • plugins/experimental/access_control
    • plugins/experimental/tls_bridge
    • plugins/experimental/txn_box
    • plugins/lua
  • Update coverity model from PCRE to PCRE2 API
  • Update README example to remove obsolete PCRE_ROOT reference
  • Update tools/hrw4u LSP documentation to reference PCRE2

Notes

  • The cripts::Matcher::PCRE class name is intentionally unchanged as it's part of the public API
  • Documentation files (doc/) are not included in this PR to keep changes focused on code and build system
    • I didn't see anything important under doc/ to change

Testing

The changes are primarily code comments and build system updates. All existing PCRE2 functionality remains intact.

@bryancall bryancall self-assigned this Nov 21, 2025
@bryancall bryancall added this to the 10.2.0 milestone Nov 21, 2025
@bryancall

Copy link
Copy Markdown
Contributor Author

This PR addresses parts of #8780 by removing remaining PCRE references from the codebase.

Specifically, this completes the cleanup for:

  • ✅ Cachekey (code comments updated)
  • ✅ Prefetch (code comments updated)

All CMakeLists.txt files now exclusively reference PCRE2, and the obsolete FindPCRE.cmake has been removed.

- Remove cmake/FindPCRE.cmake (no longer needed)
- Update all CMakeLists.txt files to use PkgConfig::PCRE2 instead of PCRE::PCRE
- Remove find_package(PCRE) from main CMakeLists.txt
- Update code comments from PCRE to PCRE2 in plugin sources
- Update coverity model from PCRE to PCRE2 API
- Update README example to remove obsolete PCRE_ROOT reference
- Update tools/hrw4u/src/lsp/documentation.py to reference PCRE2
- Note: cripts::Matcher::PCRE class name intentionally unchanged (public API)

This completes the transition from PCRE (version 1) to PCRE2
throughout the Apache Traffic Server codebase.
Cleaned up PCRE2 linking throughout the codebase:

- Use RE_ERROR_NOMATCH from tsutil instead of PCRE2_ERROR_NOMATCH in
  ControlMatcher to properly use the Regex wrapper
- Remove direct pcre2.h include from ControlMatcher.h
- Remove redundant PCRE2 links from components that get it transitively
  through tsutil (tscore, tsapi)
- Remove redundant PCRE2 links from plugins that only use tsutil/Regex.h
  (cachekey, prefetch, slice, tls_bridge)

Only components that directly use PCRE2 APIs (tsutil, cripts, txn_box)
should explicitly link PCRE2. Others get it transitively through tsutil
which publicly exports PCRE2.
@bryancall
bryancall requested review from cmcfarlen and zwoop November 21, 2025 19:02

@cmcfarlen cmcfarlen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥳

@bryancall
bryancall merged commit b38147f into apache:master Dec 1, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pcre library needs to be upgrade to pcre2

2 participants