Commit Graph

2095 Commits

Author SHA1 Message Date
Nicholas Wilson
e0918c0b7c XXX temp changes to perltest 2025-06-02 08:17:41 +00:00
Nicholas Wilson
abc24458b8 Small update to pcre2compat description of braced quantifiers 2025-06-02 08:15:38 +00:00
Nicholas Wilson
890548adac In CI, stop Solaris VM setup on failure 2025-06-02 08:03:41 +00:00
dependabot[bot]
df42c7375a Bump the minor-and-patch group with 4 updates (#755)
Bumps the minor-and-patch group with 4 updates: [vmactions/solaris-vm](https://github.com/vmactions/solaris-vm), [codecov/codecov-action](https://github.com/codecov/codecov-action), [github/codeql-action](https://github.com/github/codeql-action) and [ossf/scorecard-action](https://github.com/ossf/scorecard-action).


Updates `vmactions/solaris-vm` from 1.1.1 to 1.1.4
- [Release notes](https://github.com/vmactions/solaris-vm/releases)
- [Commits](cc8f82fa1a...170f1f96f3)

Updates `codecov/codecov-action` from 5.4.2 to 5.4.3
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](ad3126e916...18283e04ce)

Updates `github/codeql-action` from 3.28.16 to 3.28.18
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](28deaeda66...ff0a06e83c)

Updates `ossf/scorecard-action` from 2.4.1 to 2.4.2
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](f49aabe0b5...05b42c6244)

---
updated-dependencies:
- dependency-name: vmactions/solaris-vm
  dependency-version: 1.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: codecov/codecov-action
  dependency-version: 5.4.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: github/codeql-action
  dependency-version: 3.28.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
- dependency-name: ossf/scorecard-action
  dependency-version: 2.4.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-01 19:32:31 +01:00
Nicholas Wilson
4e8ab8616a Remove PCRE2_STATIC_RUNTIME (#753)
Since we have raised our minimum CMake version to 3.15, this updates the
default value of the "CMP0091" backwards-compatibility policy, such that
PCRE2_STATIC_RUNTIME is now broken (since 10.45	when
cmake_minimum_required was increased).

We can remove this flag, since the new built-in
CMAKE_MSVC_RUNTIME_LIBRARY provides the same behaviour.
2025-05-23 15:12:30 +01:00
Nicholas Wilson
c8e66a0f12 Fix test failure on z/OS 2025-05-23 09:02:35 +00:00
Nicholas Wilson
a014fb94b9 Add additional warnings to CMake CI jobs (#754)
This should enable us to detect errors or issues in our CMake files earlier.
2025-05-23 09:49:04 +01:00
Nicholas Wilson
716c1fd811 Add test output to make erroroffsets more readable (#750)
Currently, pcre2test prints the erroroffset as a simple number, which makes it hard to see in the test output where it's actually pointing.

I have added printing of the relevant portion of the pattern, to show visually where the offset points.

There is also a new function error_direction() where I have started to classify which PCRE2 errors point to the left or right of the erroroffset. When I have fixed this all to be consistent to my satisfaction, I will document this so that clients have a better way to indicate which character is wrong in a regex.
2025-05-21 19:51:15 +01:00
Nicholas Wilson
098655996c Add missing macro names for new errors (#749) 2025-05-14 12:14:41 +01:00
Zoltan Herczeg
bcc12d9056 Fix heapsort in capture list construction (#748) 2025-05-12 18:43:08 +02:00
Nicholas Wilson
c987eb81e3 Add a simple .editorconfig file (#747)
This ensures that (most) compatible editors will insert tabs into the makefiles and spaces elsewhere. We also don't want trailing whitespace to be stripped when we edit the test files. Finally, it helps to open testinput1 in Latin-1 and testinput2 in UTF-8 mode. All this can be automated.

The editorconfig file should work with any text editor - although note that VS Code needs an extension to make use of it.
2025-05-12 15:05:27 +01:00
Nobuhiro Iwamatsu
8f6c990c9b Add License field to pkg-config files (#746)
The pkg-config file has a License field which describes the software license.
Set this to 'BSD-3-Clause WITH PCRE2-exception'.

Ref: https://github.com/pkgconf/pkgconf/blob/master/man/pc.5#L116
2025-05-02 13:27:09 +01:00
dependabot[bot]
d8a0219f02 Bump the minor-and-patch group with 5 updates (#745)
Bumps the minor-and-patch group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) | `1.1.9` | `1.2.0` |
| [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) | `2.2.3` | `2.3.0` |
| [codecov/codecov-action](https://github.com/codecov/codecov-action) | `5.4.0` | `5.4.2` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.28.13` | `3.28.16` |
| [uraimo/run-on-arch-action](https://github.com/uraimo/run-on-arch-action) | `3.0.0` | `3.0.1` |


Updates `vmactions/freebsd-vm` from 1.1.9 to 1.2.0
- [Release notes](https://github.com/vmactions/freebsd-vm/releases)
- [Commits](8873d98fd1...c3ae29a132)

Updates `actions/attest-build-provenance` from 2.2.3 to 2.3.0
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](c074443f1a...db473fddc0)

Updates `codecov/codecov-action` from 5.4.0 to 5.4.2
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](0565863a31...ad3126e916)

Updates `github/codeql-action` from 3.28.13 to 3.28.16
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](1b549b9259...28deaeda66)

Updates `uraimo/run-on-arch-action` from 3.0.0 to 3.0.1
- [Release notes](https://github.com/uraimo/run-on-arch-action/releases)
- [Commits](4141da824f...d94c13912e)

...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-02 11:18:53 +01:00
Nicholas Wilson
3cd3e92fb3 Fix a build issue due to previous CMake change (#744)
The problem is that the Readline/zlib include paths were being included
before our own include path (wrong import order). This caused a problem
if the zlib include path was /usr/local/include, and that directory
happened to unfortunately contain a pcre2.h file for an (older) version
of PCRE2.
2025-04-09 13:44:13 +01:00
Nicholas Wilson
e62c0e0916 Re-apply "Use standard CMake constructs to export the targets. (#260)" (#739)
Additionally, I have attempted to clean up some CMake issues to make the
package's build interface cleaner, in particular, avoiding polluting the
parent directory's include path with our config.h file (if PCRE2 is being
included as a subdirectory).

This re-adds changes from Theodore's commit:
    def175f4a9
and partially reverts changes from Carlo's commit:
    92d56a1f7c

---------

Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
2025-04-08 17:37:19 +01:00
Nicholas Wilson
c98e5d5330 Remove use of 'head' Unix tool in pcre2grep test (#743)
It's not available on Windows, but we hadn't noticed this because it's
provided by the Git for Windows tools which I have installed. This is
not good practice to require these tools as a build dependency.

I have replaced "head -1" with "pcre2grep -m1 .*" which matches and
prints the first line. For consistency, I have made the same change on
Unix.
2025-04-02 20:00:42 +01:00
Nicholas Wilson
a80dd59111 Update my maintainer documentation to remind me to merge releases to master
See user request in #742.
2025-04-02 19:52:28 +01:00
Nicholas Wilson
e2ed5aa4be Merge branch 'release/pcre2-10.45' 2025-04-02 19:44:47 +01:00
dependabot[bot]
54302edc17 Bump the minor-and-patch group with 5 updates (#740)
Bumps the minor-and-patch group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [vmactions/freebsd-vm](https://github.com/vmactions/freebsd-vm) | `1.1.8` | `1.1.9` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4.6.1` | `4.6.2` |
| [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance) | `2.2.2` | `2.2.3` |
| [github/codeql-action](https://github.com/github/codeql-action) | `3.28.10` | `3.28.13` |
| [actions/cache](https://github.com/actions/cache) | `4.2.2` | `4.2.3` |
2025-04-01 20:18:16 +01:00
Nicholas Wilson
a73417315a Add documentation for subroutine return values (#738) 2025-03-28 14:53:39 +00:00
Zoltan Herczeg
903bdebae6 Remove colon from recurse with kept groups (#737) 2025-03-28 11:00:47 +01:00
github-actions[bot]
2e03e32333 Sync autogenerated files #noupdate 2025-03-24 13:30:18 +00:00
Nicholas Wilson
eb3bd3cf14 New pcre2_next_match() API to simplify pcre2demo, test, and substitute (#733)
* The primary purpose of pcre2_next_match() is to make it much easier for
  PCRE2 clients to iterate over matches, without needing an advanced knowledge
  of regular expressions.
* Secondly, we can simplify our own code by merging the three duplicate
  implementations of the /g global match behaviour: pcre2demo, pcre2_substitute,
  and pcre2test.
* Thirdly, as I look closely at the issue, I can improve the documentation.
* Fourthly, I would like to actually simplify the logic, removing a complex loop
  which makes several match attempts, swallows duplicate matches, and more.
  We can have identical behaviour with a simple retry using
  PCRE2_NOTEMPTY_ATSTART.
2025-03-24 13:29:52 +00:00
Nicholas Wilson
f63b5d2658 Add a little additional documentation on how to emulate pcre2_substitute's loop (#735)
We won't implement more advanced/alternative global replacement strategies, but we can at least write a few sentences explaining how to do it in application code.
2025-03-24 10:08:12 +00:00
Nicholas Wilson
d606adfe36 Fix some nasty incompatible pointer casts (#734)
The value `""` is a `char[1]` array with a single zero byte. It should not be cast to a PCRE2_SPTR, which is a pointer to an array of 1/2/4-byte values. It may not even have the required pointer alignment for a PCRE2_SPTR (in 16 or 32 bit mode).

The pointer is never dereferenced anyway, since the length is zero.

Reported by Microsoft's OACR linter.

As a quick and easy fix, I'll just set it a non-null value with the shortest possible length (no zero-length arrays allowed in C).

This has the best chance of silencing linters that want us to have a non-NULL value for the zero-length pointer.
2025-03-24 10:07:32 +00:00
Nicholas Wilson
d33251ec0f Fix a few small cosmetic issues 2025-03-19 20:22:19 +00:00
Nicholas Wilson
990d53f192 Add linker scripts with symbol versioning (#721)
Both the Autoconf and CMake build systems are updated to detect linker support for symbol versioning.

Currently, Linux, Solaris, and FreeBSD are tested and working. Windows (COFF) and macOS (Mach-O) have no symbol versioning.

There is an Autoconf/CMake flag to opt out of the versioning behaviour.
2025-03-18 08:55:38 +00:00
Nicholas Wilson
b3ecb621bd Remove the old WORKSPACE.bazel file (#732) 2025-03-17 20:24:33 +00:00
Nicholas Wilson
03a00fd407 A few further tweaks to Zig 0.14 support (#731)
Followup to #722

* Fix Windows build warning by adding PCRE2_STATIC to pcre2test
* Remove unnecessary `.linkLibc()` command, now that we have `link_libc = true` in the Module declarations
* Update the old `std.Build.Step.Compile.create(...)` calls to the brand-new `b.addLibrary(...)` function. They added this exactly for our use-case, to allow dynamically selecting between `addStaticLibrary/addDynamicLibrary` variants.
* Bump zig stack usage in CI
2025-03-17 20:23:59 +00:00
Marco Feuerstein
3a4310ec5d Bazel: Stop leaking internal headers to other libraries (#729)
This is important for e.g. glib/gio, which also has an internal config.h, and fails to compile, as it often picks up the pcre2 config.h first.

---------

Co-authored-by: Nicholas Wilson <nicholas@nicholaswilson.me.uk>
2025-03-17 16:22:07 +00:00
Rocco Ruscitti
fa68936317 Update build.zig for release of 0.14.0 breaking language changes (#724)
With the release of zig 0.14.0, there are some breaking changes to syntax in build.zig.

Here, we drop support for zig 0.13, and add support for 0.14. There does not seem to be any advantage to try and support both simultaneously (nor did the zig maintainers make this easy).

---

Co-authored-by: qaptoR <rocco.ruscitti@outlook.com>
2025-03-17 16:15:16 +00:00
Nicholas Wilson
b790e021cb Squash automake warning when conditionally adding prerequisites to a target (#720) 2025-03-13 22:24:43 +00:00
Nicholas Wilson
878e2d76cc Fix test-only bug in pcre2_printint
Fixes #725, #726, #727

Found by YinChen001 <497907957@qq.com>
2025-03-13 10:44:43 -07:00
Nicholas Wilson
f5150803cf Fix divide-by-zero in pcre2test
Fixes #728

Found by YinChen001 <497907957@qq.com>
2025-03-13 10:44:42 -07:00
Zoltan Herczeg
d37c6dfe2d JIT compiler update (#723) 2025-03-07 17:26:03 +01:00
Zoltan Herczeg
c1c1b78143 Track recorded captures during frame construction (#719)
Avoid saving the same capture twice. Furthermore use a
bitset for optimized captures to reduce memory consumption.
2025-03-04 23:07:05 +01:00
Zoltan Herczeg
e1737b5d88 Remove duplicated scan substring captures (#710) 2025-03-04 06:25:06 +01:00
Nicholas Wilson
d1288ee458 Run build on deprecated Ubuntu 20.04 in a container (#718)
The ubuntu-20.04 GitHub runner will be discontinued in around a month.

We can still test on this OS, by running these jobs in a container.
2025-03-01 22:29:55 +00:00
dependabot[bot]
457adbb696 Bump the minor-and-patch group with 3 updates (#717)
Bumps the minor-and-patch group with 3 updates: [actions/attest-build-provenance](https://github.com/actions/attest-build-provenance), [msys2/setup-msys2](https://github.com/msys2/setup-msys2) and [ossf/scorecard-action](https://github.com/ossf/scorecard-action).


Updates `actions/attest-build-provenance` from 2.1.0 to 2.2.2
- [Release notes](https://github.com/actions/attest-build-provenance/releases)
- [Changelog](https://github.com/actions/attest-build-provenance/blob/main/RELEASE.md)
- [Commits](7668571508...bd77c07785)

Updates `msys2/setup-msys2` from 2.26.0 to 2.27.0
- [Release notes](https://github.com/msys2/setup-msys2/releases)
- [Changelog](https://github.com/msys2/setup-msys2/blob/main/CHANGELOG.md)
- [Commits](d44ca8e88d...61f9e5e925)

Updates `ossf/scorecard-action` from 2.4.0 to 2.4.1
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](62b2cac7ed...f49aabe0b5)

---
updated-dependencies:
- dependency-name: actions/attest-build-provenance
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: msys2/setup-msys2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: minor-and-patch
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 22:29:31 +00:00
dependabot[bot]
47e79f1088 Bump uraimo/run-on-arch-action from 2 to 3 (#715)
Bumps [uraimo/run-on-arch-action](https://github.com/uraimo/run-on-arch-action) from 2 to 3.
- [Release notes](https://github.com/uraimo/run-on-arch-action/releases)
- [Commits](ac33288c37...1c358dc493)

---
updated-dependencies:
- dependency-name: uraimo/run-on-arch-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 21:43:05 +00:00
Nicholas Wilson
348f047cd4 Reduce dependabot PR spam 2025-03-01 21:19:22 +00:00
dependabot[bot]
57adc4d403 Bump actions/cache from 4.2.0 to 4.2.2 (#716)
Bumps [actions/cache](https://github.com/actions/cache) from 4.2.0 to 4.2.2.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](1bd1e32a3b...d4323d4df1)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 09:15:12 +00:00
dependabot[bot]
43e049ed02 Bump actions/upload-artifact from 4.6.0 to 4.6.1 (#714)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.6.0 to 4.6.1.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](65c4c4a1dd...4cec3d8aa0)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 09:13:44 +00:00
dependabot[bot]
938b892e2d Bump github/codeql-action from 3.28.8 to 3.28.10 (#713)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.28.8 to 3.28.10.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](dd746615b3...b56ba49b26)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 09:13:21 +00:00
dependabot[bot]
43ded26e07 Bump codecov/codecov-action from 5.3.1 to 5.4.0 (#712)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](13ce06bfc6...0565863a31)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-01 09:12:46 +00:00
Nicholas Wilson
02a0166265 Extract CI sync actions into their own file (#711) 2025-03-01 09:12:05 +00:00
github-actions[bot]
773486b4b5 Sync autogenerated files #noupdate 2025-02-28 22:29:19 +00:00
Nicholas Wilson
a792b72210 Add /i option to pcre2demo.c
Co-authored-by: Greg Minshall <minshall@umich.edu>
2025-02-28 21:09:46 +00:00
Zoltan Herczeg
9d1a620820 Improve error descriptions for capture lists (#709) 2025-02-27 11:55:35 +01:00
Nicholas Wilson
b79ee1dea5 Rename files which are #included (#708)
We have four files which have .c extensions, but which are actually #included rather than treated as their own compilation unit.

This goes against conventions - Autotools, CMake, and Bazel all assume that the .h/.c distinction indicates which files are compilation units.

pcre2_jit_match.c -> _inc.h
pcre2_jit_misc.c -> _inc.h
pcre2_printint.c -> _inc.h
pcre2_ucptables.c -> _inc.h
2025-02-27 06:57:44 +00:00