Skip to content

PCRE2 library is not found in all debian supported architectures #2810

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

Closed
fzipi opened this issue Oct 9, 2022 · 2 comments
Closed

PCRE2 library is not found in all debian supported architectures #2810

fzipi opened this issue Oct 9, 2022 · 2 comments

Comments

@fzipi
Copy link
Contributor

fzipi commented Oct 9, 2022

Describe the bug

We are building modsecurity containers for various architectures. While adding support for pcre2 in newer versions, we found that for some architectures the pcre2 config is not found.

Example builds failing here: linux/arm64/v8.

This happens probably because the package in debian is called libpcre2-8 (see package dev files list), and here are the results of installing and querying in the nginx default debian based container:

root@04e33073eeea:/# apt-get install libpcre2-dev
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libpcre2-16-0 libpcre2-32-0 libpcre2-8-0 libpcre2-posix2
The following NEW packages will be installed:
  libpcre2-16-0 libpcre2-32-0 libpcre2-dev libpcre2-posix2
The following packages will be upgraded:
  libpcre2-8-0
1 upgraded, 4 newly installed, 0 to remove and 21 not upgraded.
Need to get 1483 kB of archives.
After this operation, 3997 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://deb.debian.org/debian bullseye/main amd64 libpcre2-8-0 amd64 10.36-2+deb11u1 [248 kB]
Get:2 http://deb.debian.org/debian bullseye/main amd64 libpcre2-16-0 amd64 10.36-2+deb11u1 [232 kB]
Get:3 http://deb.debian.org/debian bullseye/main amd64 libpcre2-32-0 amd64 10.36-2+deb11u1 [220 kB]
Get:4 http://deb.debian.org/debian bullseye/main amd64 libpcre2-posix2 amd64 10.36-2+deb11u1 [49.1 kB]
Get:5 http://deb.debian.org/debian bullseye/main amd64 libpcre2-dev amd64 10.36-2+deb11u1 [733 kB]
Fetched 1483 kB in 0s (8869 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
(Reading database ... 20501 files and directories currently installed.)
Preparing to unpack .../libpcre2-8-0_10.36-2+deb11u1_amd64.deb ...
Unpacking libpcre2-8-0:amd64 (10.36-2+deb11u1) over (10.36-2) ...
Setting up libpcre2-8-0:amd64 (10.36-2+deb11u1) ...
Selecting previously unselected package libpcre2-16-0:amd64.
(Reading database ... 20501 files and directories currently installed.)
Preparing to unpack .../libpcre2-16-0_10.36-2+deb11u1_amd64.deb ...
Unpacking libpcre2-16-0:amd64 (10.36-2+deb11u1) ...
Selecting previously unselected package libpcre2-32-0:amd64.
Preparing to unpack .../libpcre2-32-0_10.36-2+deb11u1_amd64.deb ...
Unpacking libpcre2-32-0:amd64 (10.36-2+deb11u1) ...
Selecting previously unselected package libpcre2-posix2:amd64.
Preparing to unpack .../libpcre2-posix2_10.36-2+deb11u1_amd64.deb ...
Unpacking libpcre2-posix2:amd64 (10.36-2+deb11u1) ...
Selecting previously unselected package libpcre2-dev:amd64.
Preparing to unpack .../libpcre2-dev_10.36-2+deb11u1_amd64.deb ...
Unpacking libpcre2-dev:amd64 (10.36-2+deb11u1) ...
Setting up libpcre2-16-0:amd64 (10.36-2+deb11u1) ...
Setting up libpcre2-32-0:amd64 (10.36-2+deb11u1) ...
Setting up libpcre2-posix2:amd64 (10.36-2+deb11u1) ...
Setting up libpcre2-dev:amd64 (10.36-2+deb11u1) ...
Processing triggers for libc-bin (2.31-13+deb11u3) ...
root@04e33073eeea:/# pkg-config --list-all | grep pcre
libpcre        libpcre - PCRE - Perl compatible regular expressions C library with 8 bit character support
libpcre16      libpcre16 - PCRE - Perl compatible regular expressions C library with 16 bit character support
libpcre2-16    libpcre2-16 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 16 bit character support
libpcre2-32    libpcre2-32 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 32 bit character support
libpcre2-8     libpcre2-8 - PCRE2 - Perl compatible regular expressions C library (2nd API) with 8 bit character support
libpcre2-posix libpcre2-posix - Posix compatible interface to libpcre2-8
libpcre32      libpcre32 - PCRE - Perl compatible regular expressions C library with 32 bit character support
libpcrecpp     libpcrecpp - PCRECPP - C++ wrapper for PCRE
libpcreposix   libpcreposix - PCREPosix - Posix compatible interface to libpcre
root@04e33073eeea:/# pkg-config --exists libpcre2-8
root@04e33073eeea:/# echo $?
0
root@04e33073eeea:/# pkg-config libpcre2-8 --modversion
10.36

So maybe just adding libpcre2-8 to the list here will do.

It's easy to patch, but I can send a PR if interested.

@fzipi
Copy link
Contributor Author

fzipi commented Oct 17, 2022

BTW, I'm facing the same problem with ssdeep (libfuzzy).

@martinhsv
Copy link
Contributor

libpcre2-8 has been added to the pkg-config name list via #2939

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.

2 participants