Skip to content

feat: make pcre2 an optional cargo feature with docs#6

Open
biswapanda wants to merge 1 commit intocrusoecloud:mainfrom
biswapanda:feature-gating-pcre2
Open

feat: make pcre2 an optional cargo feature with docs#6
biswapanda wants to merge 1 commit intocrusoecloud:mainfrom
biswapanda:feature-gating-pcre2

Conversation

@biswapanda
Copy link
Copy Markdown
Collaborator

@biswapanda biswapanda commented Mar 15, 2026

Add [features] section to Cargo.toml with pcre2 as an optinal and default feature.

  • Gate all pcre2-related code in split.rs behind #[cfg(feature = pcre2)] so consumers can opt out with default-features = false.

  • Add feature-gated tests for both pcre2-on and fallback paths.

  • Document the feature flag in README.md and add CONTRIBUTING.md with build/test instructions.

Related Dynamo CI failure - https://github.com/ai-dynamo/dynamo/actions/runs/23101799392/job/67103786703

This will allow disabling strict pcre2 (libpcre2-dev) dependency -

=================================== FAILURES ===================================
_______________________ test_no_bundled_shared_libraries _______________________
tests/basic/test_wheel_contents.py:34: in test_no_bundled_shared_libraries
    assert (
E   AssertionError: Unexpected shared libraries bundled in ai-dynamo-runtime:
E       ai_dynamo_runtime.libs/libpcre2-8-516f4c9d.so.0
E   assert not ['ai_dynamo_runtime.libs/libpcre2-8-516f4c9d.so.0']
        bundled_libs = ['ai_dynamo_runtime.libs/libpcre2-8-516f4c9d.so.0']
        installed_files = [PackagePath('ai_dynamo_runtime-1.0.0.dist-info/INSTALLER'), PackagePath('ai_dynamo_runtime-1.0.0.dist-info/METADATA')...Path('ai_dynamo_runtime-1.0.0.dist-info/WHEEL'), PackagePath('ai_dynamo_runtime-1.0.0.dist-info/direct_url.json'), ...]

Add [features] section to Cargo.toml with pcre2 as a default feature.
Gate all pcre2-related code in split.rs behind #[cfg(feature = pcre2)]
so consumers can opt out with default-features = false. Add feature-gated
tests for both pcre2-on and fallback paths. Document the feature flag in
README.md and add CONTRIBUTING.md with build/test instructions.
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