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

 
 

bug #61542: Please switch to new PCRE2 library

Submitter:  Sébastien Villemot <svillemot>
Submitted:  Wed 24 Nov 2021 01:42:24 PM UTC
   
 
Category:  Coding Style and Maintenance Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Other
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 19 Nov 2022 12:50:21 PM UTC, comment #11: 

This seems to be working. It will be part of Octave 8.

Thank you again for your contribution.

Closing as fixed.

Markus Mützel <mmuetzel>
Group administrator
Tue 15 Nov 2022 12:22:47 PM UTC, comment #10: 

The changes from patch #10292 have landed in the repository.
Marking as ready for test.

Markus Mützel <mmuetzel>
Group administrator
Thu 10 Nov 2022 02:01:27 PM UTC, comment #9: 

I just proposed Patch #10292

Rafael Laboissière <rlaboiss>
Tue 27 Sep 2022 02:03:20 AM UTC, comment #8: 
Orion Poplawski <opoplawski>
Fri 29 Jul 2022 07:51:56 PM UTC, comment #7: 

FYI:

https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/K3BUC6T5VIG7LXOV4RVFO7IUPE2LGA2J/

<<<
Hi,

As from the pcre-8.45, the upstream stopped supporting this library. The
recommended procedure is to switch onto the new pcre2 library that has full
upstream support. [1]

As a result of this announcement, the older PCRE library in Fedora will be
retired.
Without upstream support, we don't have enough capacity to keep up with the
security and bugs-related issues, and thus we will support only the new
PCRE2 library. [2]
...

>>>


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
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:

https://github.com/php/php-src/pull/2857/commits/94e8a0c1a340eededc1fa922536e16dc72276d1a

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:
https://wiki.php.net/rfc/pcre2-migration

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
      <snip>
/usr/lib64/libpcre.so.1
/usr/lib64/libpcre.so.1.2.10
/usr/lib64/libpcreposix.so.0
/usr/lib64/libpcreposix.so.0.0.6
      <snip>



rpm -ql pcre2
      <snip>
/usr/lib64/libpcre2-8.so.0
/usr/lib64/libpcre2-8.so.0.7.1
/usr/lib64/libpcre2-posix.so.2
/usr/lib64/libpcre2-posix.so.2.0.1
      <snip>


And with devel:


rpm -ql pcre-devel
      <snip>
/usr/bin/pcre-config
/usr/include/pcre.h
/usr/include/pcre_scanner.h
/usr/include/pcre_stringpiece.h
/usr/include/pcrecpp.h
/usr/include/pcrecpparg.h
/usr/include/pcreposix.h
/usr/lib64/libpcre.so
/usr/lib64/libpcre16.so
/usr/lib64/libpcre32.so
/usr/lib64/libpcrecpp.so
/usr/lib64/libpcreposix.so
/usr/lib64/pkgconfig/libpcre.pc
/usr/lib64/pkgconfig/libpcre16.pc
/usr/lib64/pkgconfig/libpcre32.pc
/usr/lib64/pkgconfig/libpcrecpp.pc
/usr/lib64/pkgconfig/libpcreposix.pc
      <snip>



 rpm -ql pcre2-devel
/usr/bin/pcre2-config
/usr/include/pcre2.h
/usr/include/pcre2posix.h
/usr/lib64/libpcre2-16.so
/usr/lib64/libpcre2-32.so
/usr/lib64/libpcre2-8.so
/usr/lib64/libpcre2-posix.so
/usr/lib64/pkgconfig/libpcre2-16.pc
/usr/lib64/pkgconfig/libpcre2-32.pc
/usr/lib64/pkgconfig/libpcre2-8.pc
/usr/lib64/pkgconfig/libpcre2-posix.pc
/usr/share/doc/pcre2-devel
      <snip>


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

Dmitri.
--



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>
Group 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:
m4/acinclude.m4
configure.ac

Code:
libinterp/corefcn/regexp.cc
liboctave/util/lo-regexp.cc

Doc:
doc/interpreter/install.txi


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

Hi,

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:
https://lists.debian.org/debian-devel/2021/11/msg00176.html

Best,

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:
   
   
Comment:
   

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 mmuetzel (Posted a comment)
  • -email is unavailable- added by opoplawski (Posted a comment)
  • -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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-11-19 mmuetzel StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2022-11-15 mmuetzel StatusNone Ready For Test
    2022-04-09 jwe CategoryNone Coding Style and Maintenance

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code