Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

vectorscan-rs-sys

Overview

This crate implements minimal Rust bindings to the Vectorscan fork of Hyperscan, the high-performance regular expression engine. This crate builds a vendored copy of Vectorscan from source.

Dependencies

  • Boost >= 1.57
  • CMake
  • Optional: Clang, when building with the bindgen feature

This has been tested on x86_64 Linux, x86_64 macOS, and aarch64 macOS.

Implementation Notes

This crate was originally written as part of Nosey Parker. It was adapted from the pyperscan project, which uses Rust to expose Hyperscan to Python. (That project is released under either the Apache 2.0 or MIT license.)

The only bindings exposed at present are for Vectorscan's block-based matching APIs. The various other APIs such as stream- and vector-based matching are not exposed. Other features, such as the Chimera PCRE library, test code, benchmark code, and supporting utilities are disabled.

The source of Vectorscan 5.4.12 is included here in the vectorscan directory. It has been modified with a few patches:

  • The CMake-based build system is modified to eliminate the build-time dependency on ragel
  • The precompiled version of 4 Ragel .rl files are added to the source tree
  • The CMake-based build system is modified to allow disabling several components that are not used in this crate

Previously these modifications were stored in a patchfile that was applied to a pristine copy of the Vectorscan sources at build time. However, that approach proved problematic with the upgrade to Vectorscan 5.4.12, which is a 20MB tarball, putting the Cargo crates over the 10MB limit for Crates.io. Hence, we go with the grungier approach of keeping a modified vendored copy of the sources within this repository.

If you want to see the exact contents of the modifications that have been applied to Vectorscan, diff the vectorscan directory against a pristine version of the 5.4.12 release tarball from the Vectorscan repo.

License

This project is licensed under either of

at your option.

This project contains a vendored copy of Vectorscan, which is released under a 3-clause BSD license. See the NOTICE file for details.

Contributing

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in vectorscan-rs-sys by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.