Skip to content

Pcre2 zig14#2

Closed
pdx-daniel wants to merge 7 commits intodevelopfrom
pcre2-zig14
Closed

Pcre2 zig14#2
pdx-daniel wants to merge 7 commits intodevelopfrom
pcre2-zig14

Conversation

@pdx-daniel
Copy link
Owner

Pull Request: PCRE v1 → PCRE2 Migration with Zig 0.14+ Support

Overview

Migrates FastFEC from end-of-life PCRE v1 to PCRE2 while adding Zig 0.14+ support and cleaning up the build system.

Why This Change

  • Homebrew Compatibility: PCRE v1 is EOL, PCRE2 is required for modern distros
  • Zig Modernization: Support current Zig versions (≥0.14)
  • Build Simplification: Remove unnecessary complexity while maintaining functionality

What Changed

  • Added PCRE2: Vendored PCRE2 10.42 source tree in src/pcre2/
  • Thin Wrapper: Created src/regex.h and src/regex.c to maintain API compatibility
  • Build Updates: Modernized build.zig for Zig 0.14+ with flexible PCRE2 linking
  • Removed Legacy: Deleted old PCRE v1 source tree

Key Features

  • Zero Breaking Changes: All existing code works unchanged
  • Flexible Linking: -Dvendored-pcre option (defaults to true)
  • Cross-Platform: Works on macOS, Linux, Windows, WASM
  • Performance: Maintained ~11.89 MB/s processing speed

Test Results

  • C Tests: 21/21 passing
  • Python Tests: 8/8 passing
  • All Build Targets: Working across platforms
  • Performance: No regression in benchmark tests

Build Options

# Default (vendored PCRE2)
zig build

# System PCRE2 (for package maintainers)
zig build -Dvendored-pcre=false

# WASM build
zig build -Dwasm=true

Files Changed

  • 91 files changed: 41,021 insertions(+), 66,819 deletions(-)
  • Major additions: PCRE2 source tree, regex wrapper
  • Major removals: Legacy PCRE v1, build complexity

Ready for merge ✅ - All tests passing, no breaking changes.

- Add complete PCRE2 10.42 source tree in src/pcre2/
- Includes all headers, source files, and build configuration
- No functional changes, pure vendor import
- Add .gitattributes to mark src/pcre2/ as linguist-vendored
- Update .gitignore to allow .gitattributes tracking
- This will hide PCRE2 vendor files in GitHub PR diffs
- Delete src/pcre/ directory and all PCRE v1 files
- No functional impact, just cleanup before PCRE2 migration
- Add commit 94e6050 to blame ignore list
- This prevents the large PCRE v1 deletion from cluttering git blame
- Reviewers can use: git blame --ignore-revs-file .git-blame-ignore-revs <file>
…ange

- Add regex wrapper (src/regex.h, src/regex.c) for PCRE v1 → PCRE2 compatibility
- Update build.zig to use vendored PCRE2 with flexible linking options
- Update cli.h and memory.h to use regex.h instead of pcre/pcre.h
- Update .gitignore to allow .gitattributes and .git-blame-ignore-revs
- Maintains exact same API and behavior, just internal implementation change
- Add missing CI workflow files (.github/workflows/)
- Restore original python/src/fastfec/utils.py with proper library detection
- Add missing python build files (make_wheels.py, pyproject.toml, requirements-dev.txt)
- Add benchmark script and README updates
- All tests now pass: C tests (21/21), Python tests (8/8)
- Remove .gitattributes and .git-blame-ignore-revs
- Keep the clean commit structure but without git hygiene files
- Focus on the actual code changes for reviewers
@pdx-daniel pdx-daniel closed this Sep 26, 2025
@pdx-daniel pdx-daniel deleted the pcre2-zig14 branch September 26, 2025 16:11
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.

1 participant