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

Consider migrating from pcre to pcre2 #23668

Open
alex65536 opened this issue Jun 1, 2024 · 9 comments · May be fixed by #24405
Open

Consider migrating from pcre to pcre2 #23668

alex65536 opened this issue Jun 1, 2024 · 9 comments · May be fixed by #24405
Assignees

Comments

@alex65536
Copy link
Contributor

alex65536 commented Jun 1, 2024

Description

Nim depends on the obsolete PCRE library, which is no longer supported with last release in 2021, and should migrate to PCRE2 library available since 2015.

I am concerned that Debian wants to remove the deprecated PCRE library (see this bug report), making some of the functionality and some of the Nim packages unusable in the next stable Debian release.

So, please consider porting std/nre and std/re to PCRE2. PCRE and PCRE2 seem to be API incompatible, but it should not be a problem for anyone who doesn't use the C wrappers directly.

Nim Version

Any version at the time of writing (devel branch is affected as of cdfc886f88cc95a8dc05e2211d1030b146a521f5)

Current Output

No response

Expected Output

No response

Possible Solution

No response

Additional Information

No response

@ringabout
Copy link
Member

ringabout commented Jun 2, 2024

side note: ubuntu 24.04 doesn't seem to ship libpcre3 by default, you have to install pcre manually => #23649

@arnetheduck
Copy link
Contributor

arnetheduck commented Jun 19, 2024

This is an excellent opportunity to deprecate the re module and recommend a library instead, such as https://github.com/nitely/nim-regex (this way the library can be updated without waiting months for a release and getting hit by other unrelated changes)

@alex65536
Copy link
Contributor Author

alex65536 commented Jun 20, 2024

This is an excellent opportunity to deprecate the re module and recommend a library instead

Well, part of Nim depends on regexes itself. I took a quick look over the code base and discovered two such places in Nim itself: nimgrep and tests for nimsuggest. The latter one may be easy to remove, but for nimgrep using regexes is the core functionality, and the Nim repo seems to avoid dependencies on Nimble packages for now.

@arnetheduck
Copy link
Contributor

Nim repo seems to avoid dependencies on Nimble packages for now.

actually it does not - some packages are depended upon and downloaded to a special dist folder to create a "full" source distribution - the same can be done for regex, to create stand-alone compiler code releases.

@jmgomez
Copy link
Collaborator

jmgomez commented Jun 20, 2024

+1 to deprecate it and to use an external package. I don't mind to have it in the std. The issue I see is the lib dep

@arnetheduck
Copy link
Contributor

also, nimgrep could easily be a package - there's literally nothing in there that needs to live in nim proper.

@nileshpatra
Copy link

Did you get a chance to work on it? Nim has been out of debian testing for a while by now due to this being a release critical bug for us (pcre3) not being a part of next release.

@Araq
Copy link
Member

Araq commented Aug 19, 2024

FWIW I found no migration guide.

@nitely
Copy link
Contributor

nitely commented Sep 19, 2024

fwiw, there is this PCRE2Project/pcre2#51 (comment) and the linked PRs as migration examples.

@ringabout ringabout self-assigned this Nov 4, 2024
@ringabout ringabout linked a pull request Nov 4, 2024 that will close this issue
4 tasks
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.

7 participants