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:

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