Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support non-x86_64 by switching from Hyperscan to Vectorscan #5

Closed
bradlarsen opened this issue Dec 9, 2022 · 1 comment · Fixed by #41
Closed

Support non-x86_64 by switching from Hyperscan to Vectorscan #5

bradlarsen opened this issue Dec 9, 2022 · 1 comment · Fixed by #41
Assignees
Labels
enhancement New feature or request packaging Related to packaging and distribution

Comments

@bradlarsen
Copy link
Collaborator

Hyperscan only supports x86. It has been forked, however, to support ARM and other architectures as well: https://github.com/vectorcamp/vectorscan

I experimented in a local copy on an M1 MacBook Pro, and was able to get Nosey Parker building and running there using vectorscan instead of hyperscan. The build process for that experiment was rather manual:

  • Install boost, ragel, cmake, etc in order to build vectorscan from source
  • Build vectorscan
  • Ensure vectorscan's test suite passed
  • export HYPERSCAN_ROOT=$PATH_TO_VECTORSCAN_BUILD (causes the hyperscan-sys crate to use vectorscan instead)
  • cargo build --release for Nosey Parker

After this process, I was able to run Nosey Parker on the M1 MacBook Pro, and it seemed to behave as expected. The resulting binary was also statically linked against vectorscan, and didn't have a dynamic dependency on libhs.

I'd like to figure out how to streamline this build process so that nothing more than a cargo build in Nosey Parker is required.

@bradlarsen
Copy link
Collaborator Author

Note, it appears that the pkg-config files in vectorscan are mis-specified for static linking: VectorCamp/vectorscan@e5e2057#commitcomment-93267668

bradlarsen added a commit that referenced this issue Mar 31, 2023
This commit switches from using the `rust-hyperscan` crate to using a custom set of bindings based on those found in  `pyperscan`. These new custom bindings statically link against a bundled version of Vectorscan that is built from source, instead of linking sometimes non-statically against Hyperscan.

These new custom bindings appear in the `vectorscan` and `vectorscan-sys` directories.

These changes make it simpler to build Nosey Parker from source, especially on ARM systems, and make it feasible to distribute prebuilt binaries in future releases (#28).

Fixes #5.

References:
- https://github.com/flier/rust-hyperscan
- https://github.com/vlaci/pyperscan
- https://github.com/Vectorcamp/vectorscan
- https://github.com/intel/hyperscan
@bradlarsen bradlarsen added the packaging Related to packaging and distribution label Mar 31, 2023
bradlarsen added a commit that referenced this issue Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request packaging Related to packaging and distribution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant