Migrate from PCRE to PCRE2 API #7
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR updates the xrootd-cmstfc repository to support PCRE2, replacing the legacy PCRE library with the modern PCRE2 API. This migration ensures compatibility with modern systems where legacy PCRE is deprecated or unavailable.
Changes Made
CMake Configuration
FindPcre2.cmake
module to locate PCRE2 library and headersCMakeLists.txt
to use PCRE2 instead of PCREFindPcre.cmake
configurationSource Code Migration
<pcre.h>
to<pcre2.h>
with proper code unit width definitionpcre *
topcre2_code *
pcre_compile()
→pcre2_compile()
pcre_exec()
→pcre2_match()
pcre_free()
→pcre2_code_free()
andpcre2_match_data_free()
API Differences Handled
PCRE2_CODE_UNIT_WIDTH 8
)pcre2_match_data
structures instead of raw arraysPCRE_ANCHORED
→PCRE2_ANCHORED
)Verification
libpcre2-8
This migration ensures the project remains maintainable and compatible with modern Linux distributions that are phasing out legacy PCRE in favor of PCRE2.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
esm.ubuntu.com
/usr/lib/apt/methods/https
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.