Skip to content

Conversation

@NWilson
Copy link
Member

@NWilson NWilson commented Dec 2, 2025

I've noticed that many Linux distributions carry a patch to disable this block of code in pcre2-config.

I believe that few people actually use this script. However, if any downstream distributors are going to the trouble of including a patch, it's probably better to just accept that patch.

@NWilson
Copy link
Member Author

NWilson commented Dec 2, 2025

An alternative to this PR would be to consider removing pcre2-config entirely. Perhaps it's completely unused. I have no way of knowing this however.

@NWilson
Copy link
Member Author

NWilson commented Dec 5, 2025

I did a quick bit of research. There are many hits on GitHub for pcre2-config, including some relatively major packages. Apparently people find it easier to use than pkg-config? In any case, there's evidence there that removing it could cause disruption, which I'm not willing to do at this time (or ever).

Debian has 11000 packages matching the package name *-dev. Of those, 150 provide a file with the name /usr/bin/*-config (and another 150 packages with names not matching *-dev; some of those are presumably config utilities for users, rather than library helpers for developers). These include some relatively well-known projects, like /usr/bin/libpng-config, or /usr/bin/krb5-config, and many more.

In 2025, we probably wouldn't create a new config script, but given that it exists, I think pcre2-config has to stay.

apt-cache search -n -- '-dev$' | grep '^lib.*-dev - ' | sort -u
apt-file -x search '/usr/bin/.*-config$'

@NWilson NWilson merged commit 88a083c into main Dec 8, 2025
21 checks passed
@NWilson NWilson deleted the user/niwilson/pcre2-config-multilib branch December 8, 2025 12:01
libS=-L@libdir@
fi
case "@libdir@" in
/usr/lib|/usr/lib32|/usr/lib64|/usr/lib/*-gnu*|/lib|/lib32|/lib64|/lib/*-gnu*)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very platform/build specific so IMHO having people patching these on their own version is probably for the best.

The solution is very Linux specific and doesn't even cover ALL, because the failed attempt on standardizing these with FHS failed as well.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you aware of distros that have paths not covered by this? It's likely to work nearly everywhere, and save a patch for perhaps all distros in practice

Copy link
Contributor

@carenas carenas Dec 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIX is one that is also very popular, my main concern though is on how this interacts with *NIX (ex: Solaris or AIX have paths that differ from this, although it might be also argued that this is still an improvement).

BTW, Debian (and all its derivatives, including Ubuntu) have TWO possible paths for "non system libraries" depending on the compiler used and if it supports multi architectures, and while they are both likely covered in the list, at least for common architectures, it can be also argued that it was more obvious from the previous version that we just aim for the bare minimum and indeed encouraged them to patch it to what was required for their platform.

BTW, sorry that are making this comment late, but I did post something in this line before and GitHub UI ate it :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem at all, thank you for commenting.

I think for Nix, pcre2-config simply shouldn't be packaged at all.

For AIX & Solaris, we could add support too, I suppose. No-one has asked about it, and I don't know if who is distributing or patching PCRE2 on those platforms.

It appears that for Solaris, we'd need to add patterns matching /usr/lib/64, /usr/lib/amd64, and /usr/lib/sparcv9. Using /usr/lib/*64 and /usr/lib/sparc* should work. Docs: https://docs.oracle.com/cd/E53394_01/html/E61689/dev-env-2.html

For AIX some system-provided 64 bit libs go in /usr/lib/ppc64 apparently?

This assumes though that someone is going to install PCRE2 in those locations, which is doubtful on those platforms, where PCRE2 is not a system-provided component (as it is on Linux). I would expect Solaris or AIX software to bundle a private copy of PCRE2, or put a shared copy in /opt/ or /usr/local or something else instead. Surely no-one needs PCRE2 in /usr/lib on UNIX?

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 this pull request may close these issues.

3 participants