Skip to content
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

Migration from PCRE to PCRE2 #22006

Closed
29 of 30 tasks
BKPepe opened this issue Sep 3, 2023 · 56 comments · Fixed by #24035
Closed
29 of 30 tasks

Migration from PCRE to PCRE2 #22006

BKPepe opened this issue Sep 3, 2023 · 56 comments · Fixed by #24035

Comments

@BKPepe
Copy link
Member

BKPepe commented Sep 3, 2023

Due to recent findings described in #21800, we should track somewhere (= here) packages that are still using PCRE instead of PCRE2 to propose their developers to look into PCRE2 and prepare the support (Assignee: Here maintainers of relevant packages).


Reasons to switch to PCRE - Perl Compatible Regular Expressions 2:

  • PCRE2 was first released in 2015 to replace the API in the original PCRE library, which is now obsolete and no longer maintained. 1 2
  • Since OpenWrt targets to be minimalistic, there is no reason to have installed these two libraries side by side on the device, which results in being bigger and it may not fit devices with small storage.  3

Packages, which needs to be taken care of:

  • aircrack-ng
    Maintainer: @ZeroChaos- even though I thought this package is rather not maintained
    Steps to be done:
  1. Ask aircrack-ng developer to release a new version with PCRE2 as those changes were merged to the master branch (See PR: add PCRE2 support (follow-up) aircrack-ng/aircrack-ng#2391 )
  2. Seek a new maintainer for this package in OpenWrt or if not found, we should decide if we want to keep this package here or not.
  3. Backporting patch is simple enough, while backporting an additional patch proposed upstream is now needed. autotools: reset PCRE CFLAGS/LIBS with both PCRE and PCRE2 present aircrack-ng/aircrack-ng#2580
  4. Pending aircrack-ng: bump to release 1.7 + PCRE2 #22256
  • atftp
    Maintainer: @dddaniel
    Steps to be done:
  1. Backport patch from https://sourceforge.net/p/atftp/support-requests/11/
  2. Someone should step it and take maintainership of this package here.
  3. Pending: atftp: bump to release 0.8.0 + PCRE2 #22228
  • net-snmp
    Maintainer: @stintel
    Steps to be done:
  1. Waiting for Does net-snmp plan to switch to pcre2? net-snmp/net-snmp#420 Support merged but still not in latest release net-snmp/net-snmp@d3e95c8
  2. Pending net-snmp: move to PCRE2 library #22254
  • shadowsocks-libev
    Maintainer: @yousong
    Steps to be done:
  1. Remove this package because there were efforts to port it to PCRE2 and it is not merged and as well, this package is getting to be removed from Debian. See: Upgrade to pcre2 shadowsocks/shadowsocks-libev#1788
  2. Pending and under consideration: shadowsocks-libev: convert to PCRE2 #22356
  1. Is anyone interested to take maintainership of this package?
  2. Support is already there https://svn.apache.org/viewvc?view=revision&revision=1898399 , so we need to
    bump this package and switch the library in the Makefile
  3. Pending: apache: bump to release 2.4.57 + PCRE2 #22225
  • kismet
    Maintainer: @padre-lacroix and @sourceindex
    Steps to be done:
    This package is not maintained in our repository since it was introduced here even though upstream are releasing new versions
    This package is going to be removed in kismet: drop the package #22236
  • mg
    Maintainer: @nxhack
    Steps to be done:
  1. Needs to be investigated further
  1. Needs to be investigated further
  1. Needs to be investigated further
  • micropython-lib
    Maintainer: @jefferyto
    Steps to be done:
  1. Needs to be investigated further
  2. Pending micropython-lib: move to PCRE2 #22243
  1. Since version 1.12.5 is using pcre2 by default according to https://nginx.org/en/CHANGES , but still in the Makefile, there is legacy pcre being used. Pending nginx: openresty lua module + PCRE2 switch #21018
  1. Adapt source to pcre2. Pending nginx-util: move to pcre2 #22185
  • postfix
    Maintainer: @Shulyaka
    Steps to be done:
  1. Pending postfix: bump to 3.8.2 release + PCRE2 #22533
  • zabbix
    Maintainer: @champtar
    Steps to be done:
  1. Pending zabbix: move to PCRE2 library #22534
  • fdm
    Maintainer:
    Steps to be done:
  1. Pending fdm: update to 2.2 release and switch to PCRE2 #22536
  1. Pending freeradius3: switch to pcre2 #22532
  • haproxy
    Maintainer:
    Steps to be done:
  1. Pending haproxy: move to PCRE2 #22537
  • libndpi
    Maintainer:
    Steps to be done:
  1. Need further investigation.
  2. Pending: libndpi: bump to release 4.8 + PCRE2 #22570
  • privoxy
    Maintainer:
    Steps to be done:
  1. Pending privoxy: update to release 3.0.34 + PCRE2 #22539
  • tvheadend
    Maintainer:
    Steps to be done:
  1. Pending tvheadend: drop support for PCRE #22540
  • snort3
    Maintainer:
    Steps to be done:
  1. Planned support for last year... Still not done... Took care of manually converting it
  2. Pending snort3: add patch and move to PCRE2 #22610
  • snort
    Maintainer:
    Steps to be done:
  1. Pending snort: bump to release 2.9.20 + experimental PCRE2 #22600

Packages in other feeds, which needs to be taken care of:

  • freeswitch
    Maintainer:
    Steps to be done:
  1. Pending freeswitch: add patch moving package to PCRE2 telephony#841
  • sipgrep
    Maintainer:
    Steps to be done:
  1. Pending sipgrep: Move package to PCRE2 telephony#838
  • rtpengine
    Maintainer:
    Steps to be done:
  1. Pending rtpengine: bump to 11.5.1.12 release and set PCRE2 telephony#839
  • kamailio
    Maintainer:
    Steps to be done:
  1. Pending kamailio: bump to release 5.7.2 + PCRE2 telephony#840

I ask anyone to be responsible and look into it, sooner than later. Otherwise, if there is no response to the package, which you are maintaining, the package will be removed at the beginning of the next month - 1st October 2023, so we have a soft deadline. I am fully aware that if there is no deadline, no further actions will be taken. You are not doing it just for me but also for others, including OpenWrt users.

Thank you for your cooperation, guys and make sure that it is run-tested on the router! ;)

Footnotes

  1. https://github.com/PCRE2Project/pcre2#pcre2---perl-compatible-regular-expressions

  2. https://www.pcre.org

  3. https://openwrt.org/toh/recommended_routers

@BKPepe BKPepe pinned this issue Sep 3, 2023
@1715173329
Copy link
Member

shadowsocks-libev

I guess it's time to switch to shadowsocks-rust, which has much better performance (10x faster on aarch64 platform).

@stintel
Copy link
Member

stintel commented Sep 3, 2023

net-snmp/net-snmp#420

@BKPepe
Copy link
Member Author

BKPepe commented Sep 3, 2023

Thanks, @stintel, I included your referenced issue to OP.

@padre-lacroix
Copy link
Contributor

For the package kismet, I originally become the maintainer to prevent this package to be abandoned.
But, I do not wish to maintain it anymore, mostly because this is a package that I do not use and also because I have no way to test it.
If somebody wants to become the maintainer, then I am OK with that, otherwise it can be dropped.

@jefferyto
Copy link
Member

slang2 is done in #22020.

@neheb
Copy link
Contributor

neheb commented Sep 21, 2023

I looked into kismet before. seems to now be a convoluted project with protocol buffers and a bunch of other dependencies.

edit: also if I had to guess, kismet being C++ would mean pcre is not used.

@Ansuel
Copy link
Member

Ansuel commented Sep 21, 2023

@BKPepe is it ok to include patch while we wait for a release? (for pcre2 support)

nxhack added a commit to nxhack/packages that referenced this issue Sep 22, 2023
Switch pcre to pcre2
openwrt#22006

Signed-off-by: Hirokazu MORIKAWA <[email protected]>
@nxhack
Copy link
Contributor

nxhack commented Sep 22, 2023

@BKPepe mg editor done.

neheb pushed a commit that referenced this issue Sep 22, 2023
Switch pcre to pcre2
#22006

Signed-off-by: Hirokazu MORIKAWA <[email protected]>
BKPepe pushed a commit that referenced this issue Sep 22, 2023
Switch pcre to pcre2
#22006

Signed-off-by: Hirokazu MORIKAWA <[email protected]>
(cherry picked from commit 3d11e5c)
BKPepe pushed a commit that referenced this issue Sep 22, 2023
Switch pcre to pcre2
#22006

Signed-off-by: Hirokazu MORIKAWA <[email protected]>
(cherry picked from commit 3d11e5c)
@BKPepe
Copy link
Member Author

BKPepe commented Sep 22, 2023

I looked into kismet before.

@neheb The question is do we care about quality over quantity?
Many packages here are not maintained for various reasons. Almost everyone can add a new package to this repository, no matter what. No votes, if it has purpose or if it makes any sense. I know it will sound bad, but I would rather remove those packages, which could be updated by upstream but not here. This should hopefully result in end users or someone else complaining that the package is missing within OpenWrt and that they can help us. I'm not saying that there are not enough maintainers. We (existing ones) are doing it for some purpose. We care about it. We are trying to update it, we want to have the latest versions on our routers, etc.

I might be strict, but I would simply remove those packages. You know, it is very pleasant of you that you will take into kismet, but how many users are using it?

I fail to see such unmaintained packages here: https://downloads.openwrt.org/stats/awstats.downloads.openwrt.org.allextra2.html

Is anyone really using them? If we are doing that for a minority <5-10 users then it is probably not worth all the efforts we are putting into it. They can compile themselves. They can use GitHub Actions (simply by forking this repository), if they are not familiar with the OpenWrt build system and from the CI, download the package and install it or even prepare their own feed.

With the removing these packages, we will as someone from OpenWrt core team is saying: "Less using compute resources, faster build time, happy users"

@BKPepe
Copy link
Member Author

BKPepe commented Sep 22, 2023

@BKPepe is it ok to include patch while we wait for a release? (for pcre2 support)

@Ansuel: You have there two packages, where you are listed as maintainer. We can probably backport uwsgi pending pull request as it seems that for 3 weeks, there has been no activity. Regarding nginx, it can be done immediately because PCRE2 support is there for many weeks.

@Ansuel
Copy link
Member

Ansuel commented Sep 22, 2023 via email

@BKPepe
Copy link
Member Author

BKPepe commented Sep 22, 2023

Having a deadline is great, but I think we need to put these packages to some categories:

  1. OpenWrt packages maintainer is not active
  2. The package is not maintained anymore.
  3. Many people do not use the package, whereas 1st point applies.
  4. PCRE2 support is on its way and it would be too pity to remove it
  5. PCRE2 is already there, but 1st point apply.

So... it is not easy as it seems. :-)

I don't currently have the answer what are you looking for. It's open discussion, so any comment is appreciated. Time will tell us.

@Ansuel
Copy link
Member

Ansuel commented Sep 22, 2023

@BKPepe I like deadlines... force things to move and honestly we should add them all around our project. For me it's ok to apply patch and then drop them on release bump... (assuming they are mature enough and just stalled)

@BKPepe
Copy link
Member Author

BKPepe commented Sep 22, 2023

Yeah, I like deadlines as well that's why I gave it in the first place. Exactly for the reasons what are you saying. It moves things to move.

@neheb
Copy link
Contributor

neheb commented Sep 22, 2023

kismet can go away. I don’t use it.

@padre-lacroix
Copy link
Contributor

I am the maintainer of kismet and I do not use it myself: as I mentioned in a previous message, I took it to prevent at the time (2015-2016) that it will disappear.

So, kismet can disappear as far as I am concerned: I cannot and will not maintain it as I cannot even test it or use it myself.

@oskarirauta
Copy link
Contributor

@msva

Proposal for zsh libpcre2 usage: #22197

@BKPepe
Copy link
Member Author

BKPepe commented Sep 28, 2023

It seems that we do have a lot of progress here! Glad to see it, and thanks anyone, who looked into it.

  • Unfortunately, I am not sure what to do with Aircrack-ng.
    • While looking at the link, which I already put here (https://downloads.openwrt.org/stats/awstats.downloads.openwrt.org.allextra2.html), it seems that Aircrack-ng was downloaded 146 times. It wouldn't be great to remove it. I asked the developers if they could release a new version because it would help us instead of backporting patches, using the master branch, and giving it to users, etc.
      • We still need to seek for a new maintainer here.

@trippleflux
Copy link

@BKPepe

Trying my best about Aircrack-ng, hmm not to be sound rude but the bad news is I don't yet feel the like or knowledgeable enough in aircrack-ng to maintain or use it.

@Ansuel
Copy link
Member

Ansuel commented Sep 28, 2023

@BKPepe micropython/micropython-lib#737 wasted way too much time on this but eheheheh

@Ansuel
Copy link
Member

Ansuel commented Sep 30, 2023

Well tomorrow is the deadline. I would drop pcre library and mark the remaining package as @BROKEN while we wait for the remaining package to be update. For the one where we don't have any info I would move them to package-abbandoned
https://github.com/openwrt/packages-abandoned

@stintel
Copy link
Member

stintel commented Sep 30, 2023

Well tomorrow is the deadline. I would drop pcre library and mark the remaining package as @BROKEN while we wait for the remaining package to be update. For the one where we don't have any info I would move them to package-abbandoned https://github.com/openwrt/packages-abandoned

Please don't. You can't seriously consider dropping net-snmp from a distribution that mainly targets network devices.

@Ansuel
Copy link
Member

Ansuel commented Sep 30, 2023

@stintel if you want I can waste also today on migrating another package to pcre2.

@crza
Copy link
Contributor

crza commented Oct 29, 2023

@Ansuel
Copy link
Member

Ansuel commented Oct 29, 2023

Yep I will check each missing package. I just need the list

@BKPepe
Copy link
Member Author

BKPepe commented Oct 29, 2023 via email

@Ansuel
Copy link
Member

Ansuel commented Oct 29, 2023

@BKPepe taking care of checking each suggested package and moving them... for now only 2 require special care (aka me having to convert the package I think...)

@BKPepe
Copy link
Member Author

BKPepe commented Oct 29, 2023

Can someone backport to openwrt-23.05 after PR is pushed / merged?

Hmm, I think this question is answered here in this thread already. ;) You might want to check also the stable branches. Of course, it will be backported over the time, no need to worry about it.

@Ansuel
Copy link
Member

Ansuel commented Oct 30, 2023

@BKPepe did you find other package that still use pcre?

@systemcrash
Copy link
Contributor

systemcrash commented Oct 30, 2023

freeswitch
kamailio
rtpengine
sipgrep
snort (not v3)

http://lists.openwrt.org/pipermail/openwrt-devel/2023-October/041689.html

@BKPepe
Copy link
Member Author

BKPepe commented Oct 30, 2023 via email

@Ansuel
Copy link
Member

Ansuel commented Nov 3, 2023

@BKPepe @systemcrash Is the list now complete? only 3 package to do... freeswitch is ""easy"" and I will manually convert snort and snort3 is HELL ON EARTH.

@systemcrash
Copy link
Contributor

Those are the ones that pop up when I run make. Nothing further to add.

@Ansuel
Copy link
Member

Ansuel commented Nov 5, 2023

Welp only snort3 is missing... might take a while as I won't be at pc in the next few days :(

@Ansuel
Copy link
Member

Ansuel commented Nov 7, 2023

And with also snort3 manually converted, there isn't any more package that still require pcre.... Now it's really a matter of testing and merge the pending pr...

@systemcrash
Copy link
Contributor

How is this migration coming along? Any objections to merging these?

@Ansuel
Copy link
Member

Ansuel commented Nov 18, 2023

@systemcrash nmap are backport for the other 3 package.. pr is open but no feedback from maintainers

@0xFelix
Copy link
Contributor

0xFelix commented Nov 27, 2023

PR #22533 broke the PCRE support in postfix, PR #22765 fixes it.

@Ansuel
Copy link
Member

Ansuel commented Apr 28, 2024

One left :(

We should really spam or find a good way to make freeswitch guy aware of the deprecation.

@BKPepe
Copy link
Member Author

BKPepe commented Apr 28, 2024

Yeah... only left.

Hmm, maybe we can convience telephony maintainers to merge your pending patch. :)

  • Most of it, most of your work 👏 , was backported to OpenWrt 23.05 and as well OpenWrt 22.03, if it was possible.
    • I am thinking... we can force it by removing libpcre library. :P :D

@Ansuel
Copy link
Member

Ansuel commented Apr 28, 2024

Honestly I totally get why he is a bit hesitant... they looks like big changes but reality is that it's the very basic handling of pcre2 (nothing fancy) I would wait a bit, I don't like forcing stuff especially when we are in the same org :D

BKPepe added a commit to BKPepe/packages that referenced this issue Apr 28, 2024
This package is no longer actively maintained as it reached
End-of-Life. [1] All new projects should use PCRE2.

OpenWrt wants to be minimalistic and we migrated many packages
from PCRE to PCRE2 huge thanks belong to @Ansuel (Christian Marangi),
who worked with several open-source projects to migrate it to PCRE2 [2].
This means that on routers, we don't need to have installed two libraries
(pcre and pcre2) side by side.

[1] https://www.pcre.org/
[2] openwrt#22006

Fixes: openwrt#22006
Signed-off-by: Josef Schlehofer <[email protected]>
@systemcrash
Copy link
Contributor

  * I am thinking... we can force it by removing libpcre library. :P :D

Evil genius 😈

@BKPepe
Copy link
Member Author

BKPepe commented Apr 30, 2024

Naaah, I am not. 😇 We have been sitting on PCRE for a longer period than I thought. It looked like an easy job in the beginning, but several open-source projects were not prepared, and it took some time for developers to look into it, review @Ansuel's work, and then, if possible, release a new version, so we don't need to carry patches, which were quite huge.

Keeping this only for one remaining software... I am kinda convinced to drop it; it's the master branch after all, issues are expected, and I am quite sure that some hidden issues will be revealed once PCRE is removed.

BKPepe added a commit that referenced this issue May 11, 2024
This package is no longer actively maintained as it reached
End-of-Life. [1] All new projects should use PCRE2.

OpenWrt wants to be minimalistic and we migrated many packages
from PCRE to PCRE2 huge thanks belong to @Ansuel (Christian Marangi),
who worked with several open-source projects to migrate it to PCRE2 [2].
This means that on routers, we don't need to have installed two libraries
(pcre and pcre2) side by side.

[1] https://www.pcre.org/
[2] #22006

Fixes: #22006
Signed-off-by: Josef Schlehofer <[email protected]>
@BKPepe BKPepe unpinned this issue May 11, 2024
liudf0716 pushed a commit to liudf0716/packages that referenced this issue May 27, 2024
This package is no longer actively maintained as it reached
End-of-Life. [1] All new projects should use PCRE2.

OpenWrt wants to be minimalistic and we migrated many packages
from PCRE to PCRE2 huge thanks belong to @Ansuel (Christian Marangi),
who worked with several open-source projects to migrate it to PCRE2 [2].
This means that on routers, we don't need to have installed two libraries
(pcre and pcre2) side by side.

[1] https://www.pcre.org/
[2] openwrt#22006

Fixes: openwrt#22006
Signed-off-by: Josef Schlehofer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.