Skip to content

Incorporate UTF-32 changes #3

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

Merged
merged 51 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
37180fa
ci: switch to GitHub Actions
BurntSushi Jun 18, 2023
da42590
style: add rustfmt config and run it
BurntSushi Jun 18, 2023
65a7a3d
git: remove pcre2-sys/pcre2 submodule
BurntSushi Jun 18, 2023
9c9c05e
sys: update PCRE2 static build infrastructure
BurntSushi Jun 18, 2023
569dc3e
upstream: update to pcre2 10.42 release
BurntSushi Jun 18, 2023
0883d06
ci: run tests with PCRE2_SYS_STATIC set
BurntSushi Jun 18, 2023
0d830a1
sys: update bindings to 10.42
BurntSushi Jun 18, 2023
cd391b2
pcre2: various cleanups and polish
BurntSushi Jun 18, 2023
13971ef
sys: disable jit on android, aarch64 and armv7
bczhc Feb 21, 2023
2fde4fc
pcre2: use PCRE2_MATCH_INVALID_UTF
BurntSushi Jun 18, 2023
a862805
doc: fix badges, license format, etc
atouchet Dec 2, 2022
e02cf79
pcre2: fix Match::new bug
Jun 19, 2021
dbd8827
api: add 'escape' routine
BurntSushi Jun 18, 2023
f54ee2f
pcre2-sys-0.2.6
BurntSushi Jun 18, 2023
be9febf
deps: bump to pcre2-sys 0.2.6
BurntSushi Jun 18, 2023
58ccb86
0.2.4
BurntSushi Jun 18, 2023
5c5d720
sys/doc: update badges
atouchet Jun 18, 2023
65e6ca2
ci: bump pinned version to Rust 1.70
BurntSushi Sep 27, 2023
83e97e8
deps: remove thread_local dependency
BurntSushi Sep 28, 2023
c6b3a38
0.2.5
BurntSushi Sep 28, 2023
b068140
sys: use config.h to track default settings
carenas Nov 26, 2023
b17ffe5
pcre2-sys-0.2.7
BurntSushi Nov 26, 2023
1a7ff76
deps: bump to pcre2-sys 0.2.7
BurntSushi Nov 26, 2023
8b6f7a6
0.2.6
BurntSushi Nov 26, 2023
dd55b30
pcre2-sys: disable JIT for all ARM targets containing musleabi
yelkarama Jan 5, 2024
de949d1
pcre2-sys-0.2.8
BurntSushi Jan 5, 2024
28d312a
Update generate-bindings instructions to install bindgen-cli
ridiculousfish Mar 20, 2023
0637728
Switch from jit to jit_if_available in tests
ridiculousfish Feb 3, 2024
41a8085
Factor bytes into regex_impl and prepare for UTF-32
ridiculousfish Mar 21, 2023
17fb76a
Add support for UTF-32 matching
ridiculousfish Mar 23, 2023
27c6eb0
Add crate feature for JIT
ridiculousfish Feb 3, 2024
2893b6f
Expose the PCRE2_NEVER_UTF flag
ridiculousfish Mar 25, 2023
338a966
Mark Error::error_message as public
ridiculousfish Mar 25, 2023
f933dc9
Make is_jit_available() require a CodeUnitWidth
ridiculousfish Mar 25, 2023
f56601b
Add support for capture groups and substring replacement
henrikhorluck Jun 18, 2023
f0e5adb
Update the CI workflow to build and test UTF32
ridiculousfish Feb 4, 2024
1080799
upstream: update to pcre2 10.43 release
LeoniePhiline Mar 24, 2024
18a8cf3
lint: squash some warnings
BurntSushi Mar 24, 2024
9f9bee6
pcre2-sys-0.2.9
BurntSushi Mar 24, 2024
d37d87f
deps: bump to pcre2-sys 0.2.9
BurntSushi Mar 24, 2024
ea672ec
0.2.7
BurntSushi Mar 24, 2024
2a6f6ec
error: migrate bindgen install hint to bindgen-cli since 0.61.0
LeoniePhiline Mar 24, 2024
aea0175
pcre2: fix test failures on targets that don't support JIT
heiher Jul 25, 2024
fbce64a
0.2.8
BurntSushi Jul 25, 2024
3c490e6
ffi: pass non-empty slice when haystack is empty
BurntSushi Jul 30, 2024
9687dca
0.2.9
BurntSushi Jul 30, 2024
299f194
Merge remote-tracking branch 'upstream/master' into utf32-update
ridiculousfish Sep 15, 2024
a064b97
Fix build failures related to UTF-32
ridiculousfish Sep 15, 2024
21af6f5
Remove use of the "std" feature from pool.rs
ridiculousfish Sep 15, 2024
3ec0d49
Merge branch 'master' into utf32-update
ridiculousfish Sep 22, 2024
85b7afb
Update Cargo.toml of rust-pcre2
ridiculousfish Sep 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: ci
on:
pull_request:
push:
branches:
- master
schedule:
- cron: '00 01 * * *'
jobs:
test:
name: test
runs-on: ${{ matrix.os }}
strategy:
matrix:
build:
- pinned
- stable
- beta
- nightly
- macos
- win-msvc
- win-gnu
include:
- build: pinned
os: ubuntu-latest
rust: 1.70.0
- build: stable
os: ubuntu-latest
rust: stable
- build: beta
os: ubuntu-latest
rust: beta
- build: nightly
os: ubuntu-latest
rust: nightly
- build: macos
os: macos-latest
rust: stable
- build: win-msvc
os: windows-latest
rust: stable
- build: win-gnu
os: windows-latest
rust: stable-x86_64-gnu
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
- name: Build
run: cargo build --verbose --all --features utf32
- name: Build docs
run: cargo doc --verbose --all --features utf32
- name: Run tests
run: cargo test --verbose --all --features utf32
- name: Run tests with static build
shell: bash
run: PCRE2_SYS_STATIC=1 cargo test --verbose --all --features utf32

rustfmt:
name: rustfmt
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: |
cargo fmt --all -- --check
4 changes: 0 additions & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
[submodule "pcre2-sys/pcre2"]
path = pcre2-sys/pcre2
url = https://github.com/BurntSushi/pcre2-mirror
branch = release/10.32
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

30 changes: 16 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
[package]
name = "pcre2"
version = "0.2.3" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
description = "High level wrapper library for PCRE2."
version = "0.2.9" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>", "fish-shell contributors"]
description = "High level wrapper library for PCRE2, with UTF-32 support."
documentation = "https://docs.rs/pcre2"
homepage = "https://github.com/BurntSushi/rust-pcre2"
repository = "https://github.com/BurntSushi/rust-pcre2"
homepage = "https://github.com/fish-shell/rust-pcre2"
repository = "https://github.com/fish-shell/rust-pcre2"
readme = "README.md"
keywords = ["pcre", "pcre2", "regex", "jit", "perl"]
license = "Unlicense/MIT"
license = "Unlicense OR MIT"
categories = ["text-processing"]
edition = "2021"

[workspace]
members = ["pcre2-sys"]

[dependencies]
libc = "0.2.146"
log = "0.4.19"
pcre2-sys = { version = "0.2.9", path = "pcre2-sys" }

[features]
default = ["utf8"]
utf8 = ["pcre2-sys/utf8"]
default = ["jit"]

# Enable matching on UTF-32 strings
utf32 = ["pcre2-sys/utf32"]
static-pcre2 = []

[dependencies]
libc = "0.2.46"
log = "0.4.5"
pcre2-sys = { version = "0.2.0", path = "pcre2-sys" }
thread_local = "1"
# Enable the PCRE2 JIT
jit = ["pcre2-sys/jit"]
26 changes: 23 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,27 @@
# pcre2

pcre2
=====
A high level Rust wrapper library for [PCRE2](https://www.pcre.org/).

[![Build status](https://github.com/BurntSushi/rust-pcre2/workflows/ci/badge.svg)](https://github.com/BurntSushi/rust-pcre2/actions)
[![crates.io](https://img.shields.io/crates/v/pcre2.svg)](https://crates.io/crates/pcre2)

Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).

This has been forked to support UTF-32 matching, for use in fish-shell.

### Documentation

https://docs.rs/pcre2


### Usage

Run `cargo add pcre2` to add this crate to your `Cargo.toml` file.


### Notes

Currently, this is a fairly light layer around PCRE2 itself and does not even
come close to covering all of its functionality. There are no specific plans
in place to build out the wrapper further, but PRs for making more of PCRE2
available are welcome, although my bandwidth for maintenance is limited. If
you're interested in sharing this maintenance burden, please reach out.
26 changes: 0 additions & 26 deletions appveyor.yml

This file was deleted.

7 changes: 0 additions & 7 deletions ci/script.sh

This file was deleted.

1 change: 1 addition & 0 deletions pcre2-sys/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tmp
28 changes: 13 additions & 15 deletions pcre2-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
[package]
name = "pcre2-sys"
version = "0.2.4" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>"]
version = "0.2.9" #:version
authors = ["Andrew Gallant <jamslam@gmail.com>", "fish-shell contributors"]
description = "Low level bindings to PCRE2."
documentation = "https://docs.rs/pcre2-sys"
homepage = "https://github.com/BurntSushi/rust-pcre2"
repository = "https://github.com/BurntSushi/rust-pcre2"
homepage = "https://github.com/fish-shell/rust-pcre2"
repository = "https://github.com/fish-shell/rust-pcre2"
readme = "README.md"
keywords = ["pcre", "pcre2", "regex", "jit"]
license = "Unlicense/MIT"
license = "Unlicense OR MIT"
categories = ["external-ffi-bindings"]
edition = "2018"

[features]
default = ["utf8"]
utf8 = []
utf32 = []

edition = "2021"

[dependencies]
libc = "0.2"
libc = "0.2.146"

[build-dependencies]
cc = { version = "1", features = ["parallel"] }
pkg-config = "0.3.13"
cc = { version = "1.0.73", features = ["parallel"] }
pkg-config = "0.3.27"

[features]
utf32 = []
jit = []
22 changes: 5 additions & 17 deletions pcre2-sys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ pcre2-sys
=========
Bindings for [PCRE2](https://www.pcre.org/).

[![Linux build status](https://api.travis-ci.org/BurntSushi/rust-pcre2.png)](https://travis-ci.org/BurntSushi/rust-pcre2)
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/BurntSushi/rust-pcre2?svg=true)](https://ci.appveyor.com/project/BurntSushi/rust-pcre2)
[![](https://meritbadge.herokuapp.com/pcre2-sys)](https://crates.io/crates/pcre2-sys)
[![Build status](https://github.com/BurntSushi/rust-pcre2/workflows/ci/badge.svg)](https://github.com/BurntSushi/rust-pcre2/actions)
[![crates.io](https://img.shields.io/crates/v/pcre2-sys.svg)](https://crates.io/crates/pcre2-sys)

Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).

Expand All @@ -16,18 +15,7 @@ https://docs.rs/pcre2-sys

### Usage

Add this to your `Cargo.toml`:

```toml
[dependencies]
pcre2-sys = "0.2"
```

and this to your crate root:

```rust
extern crate pcre2_sys;
```
Run `cargo add pcre2-sys` to add this crate to your `Cargo.toml` file.


### Notes
Expand All @@ -36,7 +24,7 @@ As a `-sys` crate, this exposes only the bindings to PCRE2 based on the header
file. The PCRE2 documentation itself should be consulted in order to use this
crate.

The bindings for this crate were generated for PCRE **10.31**. This crate
The bindings for this crate were generated for PCRE **10.42**. This crate
intends to track the current release of PCRE2.

The build script for this crate prefers dynamically linking with the host's
Expand All @@ -56,7 +44,7 @@ may work, and PRs to support them are welcome.

If you're compiling this crate on Windows with the GNU toolchain, then you'll
need to make sure you have a compatible C compiler installed, such as the one
provided by the [mingw-w64](http://mingw-w64.org) project.
provided by the [MinGW-w64](https://www.mingw-w64.org/) project.

Set the `PCRE2_SYS_DEBUG` flag to forcefully enable debug symbols when doing a
static build, even when compiling in release mode.
Loading
Loading