bugGNU Octave - Bugs: bug #61542, Please switch to new PCRE2 library


bug #61542: Please switch to new PCRE2 library

Submitted by:  Sébastien Villemot <svillemot>
Submitted on:  Wed 24 Nov 2021 01:42:24 PM UTC  
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Fri 26 Nov 2021 07:10:33 PM UTC, comment #6: 

I wrote a patch for migrating the strings package from PCRE to PCRE2 (see bug #61570). I did not test it extensively, but all 6 unit tests, as well as the demo, succeed.

This may be used as inspiration for migrating the code in Octave.

Rafael Laboissière <rlaboiss>
Thu 25 Nov 2021 06:18:46 PM UTC, comment #5: 

The API seems to have been substantially changed between PCRE and PCRE2. As Sébastien wrote, there does not seem to be a migration guide. However, you could look a what was done in other projects, like this commit in the PHP project:


Rafael Laboissière <rlaboiss>
Wed 24 Nov 2021 08:59:46 PM UTC, comment #4: 

@jwe I’m sorry, I do not have more information than what I put in this bug report. I have just forwarded the information sent to all Debian developers.

Regarding the choice of the library flavour, you can have a look  at the shared library package descriptions (libpcre2-8-0, libpcre2-16-0, libpcre2-32-0 and libpcre2-posix3). They seem to differ on the type of input they are capable of handling (ASCII/UTF-8, UTF-16, UTF-32; I’m unsure about the purpose of the POSIX version).

Note that the pkgconfig files are in the libpcre2-dev package (they’re called libpcre2-8.pc, libpcre2-16.pc…).

Regarding the changes between legacy PCRE and PCRE2, I found this page from the PHP project which may be useful:

Unfortunately there does not seem to be an official migration guide on pcre.org

Sébastien Villemot <svillemot>
Wed 24 Nov 2021 08:44:03 PM UTC, comment #3: 

At least on Fedora pcre comes with:

rpm -ql pcre

rpm -ql pcre2

And with devel:

rpm -ql pcre-devel

 rpm -ql pcre2-devel

So it looks to me that libpcre should corresponds to libpcre2-8
and libpcre.pc to libpcre2-8.pc


Dmitri A. Sergatskov <dasergatskov>
Wed 24 Nov 2021 06:40:16 PM UTC, comment #2: 

Can you point to any guide about how to migrate?  The libpcre2-dev package on Debian appears to provide 4 different libraries.  But unlike the old PCRE library, there doesn't seem to be a libpcre2 library, just ones with an additional suffix.  Which one are we supposed to use?

I see there is a pcre2-config program but normally we try to use pkconfig first.  But as with the libraries there is no libpcre2.pc file, just libpcre-{8,16,32,posix}.

John W. Eaton <jwe>
Project Administrator
Wed 24 Nov 2021 02:48:50 PM UTC, comment #1: 

Places in Octave codebase referring to PCRE that might need to be updated listed below. A Gnulib update might address part of it.

Build system:



Wed 24 Nov 2021 01:42:24 PM UTC, original submission:  


Octave currently relies on the old (and mostly unmaintained) PCRE library.

Please consider switching it to the new PCRE2 library. Debian is aiming at removing the old PCRE library from its next release.

For more background, see:


Sébastien Villemot
Co-maintainer of Octave in Debian

Sébastien Villemot <svillemot>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by rlaboiss (Posted a comment)
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by svillemot (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    No changes have been made to this item

    Back to the top

    Powered by Savane 3.7