Skip to contentSkip to conversation

package/libmodsecurity: fix build with libmaxminddb

PATCH New Fabrice Fontaine 3 participants 10 messages Jul 16, 2021 – Jul 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

---
 ...Revert-Fix-maxminddb-link-on-FreeBSD.patch | 28 +++++++++++++++++++
 package/libmodsecurity/libmodsecurity.mk      |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file +28 -0
new file mode 100644
index 0000000000..9608e3d935
@@ -0,0 +1,28 @@
+From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 16 Jul 2021 19:12:51 +0200
+Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD"
+
+This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ build/libmaxmind.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4
+index 656fc250..02820b5a 100644
+--- a/build/libmaxmind.m4
++++ b/build/libmaxmind.m4
+@@ -10,7 +10,7 @@ dnl  MAXMIND_VERSION
+ AC_DEFUN([PROG_MAXMIND], [
+ 
+ # Possible names for the maxmind library/package (pkg-config)
+-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind"
++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind"
+ 
+ # Possible extensions for the library
+ MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib"
+-- 
+2.30.2
+
package/libmodsecurity/libmodsecurity.mk +2 -0
index b2637257b6..66e7e522a1 100644
@@ -12,6 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0
 LIBMODSECURITY_LICENSE_FILES = LICENSE
 LIBMODSECURITY_CPE_ID_VENDOR = trustwave
 LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity
+# We're patching build/libmaxmind.m4
+LIBMODSECURITY_AUTORECONF = YES
 
 LIBMODSECURITY_DEPENDENCIES = pcre
 LIBMODSECURITY_CONF_OPTS = \
Signature · 1 line
2.30.2
#1 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Fabrice, All,

On 2021-07-16 19:20 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

I was about to just push this, but the autoreconf spews out a lot of warning for out-of-tree builds:

Quoted 1 line
Quoted 1 line
Quoted 1 line

libmodsecurity 3.0.5 Autoreconfiguring

fatal: not a git repository (or any of the parent directories): .git [...x10...]
fatal: not a git repository (or any of the parent directories): .git
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build'.
libtoolize: copying file 'build/libtool.m4'
libtoolize: copying file 'build/ltoptions.m4'
libtoolize: copying file 'build/ltsugar.m4'
libtoolize: copying file 'build/ltversion.m4'
libtoolize: copying file 'build/lt~obsolete.m4'
fatal: not a git repository (or any of the parent directories): .git [...x18...]
fatal: not a git repository (or any of the parent directories): .git configure.ac:50: installing './compile'
configure.ac:45: installing './missing' examples/multiprocess_c/Makefile.am: installing './depcomp'

Not sure yet what causes that, but this is not clean, and I'd prefer to know that it has no impact on libmodsecurity build.

Could you please look into that?

Regards,
Yann E. MORIN.

Quoted 60 lines
---
 ...Revert-Fix-maxminddb-link-on-FreeBSD.patch | 28 +++++++++++++++++++
 package/libmodsecurity/libmodsecurity.mk      |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file +28 -0
new file mode 100644
index 0000000000..9608e3d935
@@ -0,0 +1,28 @@
+From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 16 Jul 2021 19:12:51 +0200
+Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD"
+
+This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ build/libmaxmind.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4
+index 656fc250..02820b5a 100644
+--- a/build/libmaxmind.m4
++++ b/build/libmaxmind.m4
+@@ -10,7 +10,7 @@ dnl  MAXMIND_VERSION
+ AC_DEFUN([PROG_MAXMIND], [
+ 
+ # Possible names for the maxmind library/package (pkg-config)
+-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind"
++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind"
+ 
+ # Possible extensions for the library
+ MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib"
+-- 
+2.30.2
+
package/libmodsecurity/libmodsecurity.mk +2 -0
index b2637257b6..66e7e522a1 100644
@@ -12,6 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0
 LIBMODSECURITY_LICENSE_FILES = LICENSE
 LIBMODSECURITY_CPE_ID_VENDOR = trustwave
 LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity
+# We're patching build/libmaxmind.m4
+LIBMODSECURITY_AUTORECONF = YES
 
 LIBMODSECURITY_DEPENDENCIES = pcre
 LIBMODSECURITY_CONF_OPTS = \
Signature · 6 lines
2.30.2

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Yann,

Le sam. 17 juil. 2021 ? 11:11, Yann E. MORIN <[email protected]> a ?crit :

Quoted 38 lines

Fabrice, All,

On 2021-07-16 19:20 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

I was about to just push this, but the autoreconf spews out a lot of warning for out-of-tree builds:

Quoted 1 line
Quoted 1 line
Quoted 1 line

libmodsecurity 3.0.5 Autoreconfiguring

fatal: not a git repository (or any of the parent directories): .git [...x10...]
fatal: not a git repository (or any of the parent directories): .git
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build'.
libtoolize: copying file 'build/libtool.m4'
libtoolize: copying file 'build/ltoptions.m4'
libtoolize: copying file 'build/ltsugar.m4'
libtoolize: copying file 'build/ltversion.m4'
libtoolize: copying file 'build/lt~obsolete.m4'
fatal: not a git repository (or any of the parent directories): .git [...x18...]
fatal: not a git repository (or any of the parent directories): .git configure.ac:50: installing './compile'
configure.ac:45: installing './missing' examples/multiprocess_c/Makefile.am: installing './depcomp'

Quoted 4 lines

Not sure yet what causes that, but this is not clean, and I'd prefer to know that it has no impact on libmodsecurity build.

Could you please look into that?

I wasn't able to reproduce this issue with in-tree build:

Quoted 1 line
Quoted 1 line
Quoted 1 line

libmodsecurity 3.0.5 Updating config.sub and config.guess

for file in config.guess config.sub; do for i in $(find /home/fabrice/buildroot/output/build/libmodsecurity-3.0.5 -name $file); do cp support/gnuconfig/$file $i; done; done

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

libmodsecurity 3.0.5 Configuring
libmodsecurity 3.0.5 Autoreconfiguring

libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'build'.
libtoolize: copying file 'build/libtool.m4'
libtoolize: copying file 'build/ltoptions.m4'
libtoolize: copying file 'build/ltsugar.m4'
libtoolize: copying file 'build/ltversion.m4'
libtoolize: copying file 'build/lt~obsolete.m4' configure.ac:50: installing './compile' configure.ac:45: installing './missing' examples/multiprocess_c/Makefile.am: installing './depcomp'

I assume that those warnings because "git log" is used in configure.ac to retrieve MSC_GIT_HASH and SECLANG_TEST_VERSION but this should have no effect on libmodsecurity behavior.

Quoted 67 lines

Regards,
Yann E. MORIN.

Quoted 56 lines
---
 ...Revert-Fix-maxminddb-link-on-FreeBSD.patch | 28 +++++++++++++++++++
 package/libmodsecurity/libmodsecurity.mk      |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file +28 -0
new file mode 100644
index 0000000000..9608e3d935
@@ -0,0 +1,28 @@
+From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 16 Jul 2021 19:12:51 +0200
+Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD"
+
+This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ build/libmaxmind.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4
+index 656fc250..02820b5a 100644
+--- a/build/libmaxmind.m4
++++ b/build/libmaxmind.m4
+@@ -10,7 +10,7 @@ dnl  MAXMIND_VERSION
+ AC_DEFUN([PROG_MAXMIND], [
+
+ # Possible names for the maxmind library/package (pkg-config)
+-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind"
++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind"
+
+ # Possible extensions for the library
+ MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib"
+--
+2.30.2
+
package/libmodsecurity/libmodsecurity.mk +2 -1
index b2637257b6..66e7e522a1 100644
@@ -12,6 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0
 LIBMODSECURITY_LICENSE_FILES = LICENSE
 LIBMODSECURITY_CPE_ID_VENDOR = trustwave
 LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity
+# We're patching build/libmaxmind.m4
+LIBMODSECURITY_AUTORECONF = YES
 
 LIBMODSECURITY_DEPENDENCIES = pcre
 LIBMODSECURITY_CONF_OPTS = \
--

2.30.2

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

Quoted 5 lines
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Best Regards,

Fabrice

#3 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Fabrice, All,

On 2021-07-17 21:33 +0200, Fabrice Fontaine spake thusly:

Quoted 17 lines

Le sam. 17 juil. 2021 ? 11:11, Yann E. MORIN <[email protected]> a ?crit :

Quoted 16 lines

On 2021-07-16 19:20 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

I was about to just push this, but the autoreconf spews out a lot of warning for out-of-tree builds:

Quoted 1 line
Quoted 1 line
Quoted 1 line

libmodsecurity 3.0.5 Autoreconfiguring

fatal: not a git repository (or any of the parent directories): .git

[--SNIP--]

Quoted 1 line

I wasn't able to reproduce this issue with in-tree build:

Not surprising, because it then uses the git tree of Buildroot. And that issue would also happen with a release tarball of Buildroot, as there is no git tree there either...

[--SNIP--]

Quoted 2 lines

I assume that those warnings because "git log" is used in configure.ac to retrieve MSC_GIT_HASH and SECLANG_TEST_VERSION

- MSC_GIT_HASH is used nowhere

- LIBINJECTION_VERSION is onle used to report the version at the end of configure

- SECLANG_TEST_VERSION ditto

- msc_version_git is used once, to set MSC_GIT_VERSION

- MSC_GIT_VERSION is AC_SUBSTituted, but is only ever used to report the version at the end of configure.

Quoted 2 lines

but this should
have no effect on libmodsecurity behavior.

Still, this is very unclean to have those warnings... :-(

    diff --git a/package/libmodsecurity/libmodsecurity.mk b/package/libmodsecurity/libmodsecurity.mk
    index b2637257b6..10338dad7c 100644
    --- a/package/libmodsecurity/libmodsecurity.mk
    +++ b/package/libmodsecurity/libmodsecurity.mk
    @@ -14,6 +14,24 @@ LIBMODSECURITY_CPE_ID_VENDOR = trustwave
     LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity
     
     LIBMODSECURITY_DEPENDENCIES = pcre
    +
    +# configure.ac will call git to get various version strings, from
    +# libmodsecurity itself, but also from bundled dependencies, just
    +# for the sake of siplaying them at the end of configure.
    +# Fake a git that returns the version for libmodescurity, to quiesce
    +# warnings...
    +define LIBMODSECURITY_FAKE_GIT
    +	$(Q)mkdir -p $(@D)/.buildroot
    +	$(Q)printf '#!/usr/bin/env sh\necho "$(LIBMODSECURITY_VERSION)"\n' \
    +		>$(@D)/.buildroot/git
    +	@(Q)chmod 755 $(@D)/.buildroot/git
    +endef
    +LIBMODSECURITY_POST_EXTRACT_HOOKS += LIBMODSECURITY_FAKE_GIT
    +
    +# 0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
    +LIBMODSECURITY_AUTORECONF = YES
    +LIBMODSECURITY_AUTORECONF_ENV = PATH="$(@D)/.buildroot:$(BR_PATH)"
    +
     LIBMODSECURITY_CONF_OPTS = \
     	--with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
     	--disable-examples \

Regards,
Yann E. MORIN.

Quoted 78 lines
Quoted 66 lines

Regards,
Yann E. MORIN.

Quoted 56 lines
---
 ...Revert-Fix-maxminddb-link-on-FreeBSD.patch | 28 +++++++++++++++++++
 package/libmodsecurity/libmodsecurity.mk      |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file +28 -0
new file mode 100644
index 0000000000..9608e3d935
@@ -0,0 +1,28 @@
+From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 16 Jul 2021 19:12:51 +0200
+Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD"
+
+This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ build/libmaxmind.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4
+index 656fc250..02820b5a 100644
+--- a/build/libmaxmind.m4
++++ b/build/libmaxmind.m4
+@@ -10,7 +10,7 @@ dnl  MAXMIND_VERSION
+ AC_DEFUN([PROG_MAXMIND], [
+
+ # Possible names for the maxmind library/package (pkg-config)
+-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind"
++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind"
+
+ # Possible extensions for the library
+ MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib"
+--
+2.30.2
+
package/libmodsecurity/libmodsecurity.mk +2 -1
index b2637257b6..66e7e522a1 100644
@@ -12,6 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0
 LIBMODSECURITY_LICENSE_FILES = LICENSE
 LIBMODSECURITY_CPE_ID_VENDOR = trustwave
 LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity
+# We're patching build/libmaxmind.m4
+LIBMODSECURITY_AUTORECONF = YES
 
 LIBMODSECURITY_DEPENDENCIES = pcre
 LIBMODSECURITY_CONF_OPTS = \
--

2.30.2

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

Quoted 5 lines
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Best Regards,

Fabrice
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Yann,

Le sam. 17 juil. 2021 ? 22:33, Yann E. MORIN <[email protected]> a ?crit :

Quoted 41 lines

Fabrice, All,

On 2021-07-17 21:33 +0200, Fabrice Fontaine spake thusly:

Quoted 17 lines

Le sam. 17 juil. 2021 ? 11:11, Yann E. MORIN <[email protected]> a ?crit :

Quoted 16 lines

On 2021-07-16 19:20 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

I was about to just push this, but the autoreconf spews out a lot of warning for out-of-tree builds:

Quoted 1 line
Quoted 1 line
Quoted 1 line

libmodsecurity 3.0.5 Autoreconfiguring

fatal: not a git repository (or any of the parent directories): .git

[--SNIP--]

Quoted 1 line

I wasn't able to reproduce this issue with in-tree build:

Not surprising, because it then uses the git tree of Buildroot. And that issue would also happen with a release tarball of Buildroot, as there is no git tree there either...

[--SNIP--]

Quoted 2 lines

I assume that those warnings because "git log" is used in configure.ac to retrieve MSC_GIT_HASH and SECLANG_TEST_VERSION

- MSC_GIT_HASH is used nowhere

- LIBINJECTION_VERSION is onle used to report the version at the end of configure

- SECLANG_TEST_VERSION ditto

- msc_version_git is used once, to set MSC_GIT_VERSION

Quoted 7 lines

- MSC_GIT_VERSION is AC_SUBSTituted, but is only ever used to report the version at the end of configure.

Quoted 2 lines

but this should
have no effect on libmodsecurity behavior.

Still, this is very unclean to have those warnings... :-(

Agreed, but then what would be the best option?
- Remove autoreconf and patch directly the configure file?
- Set LIBMODSECURITY_GIT_SUBMODULE to YES and retrieve the full
libmodsecurity git tree?

Quoted 113 lines
    diff --git a/package/libmodsecurity/libmodsecurity.mk b/package/libmodsecurity/libmodsecurity.mk
    index b2637257b6..10338dad7c 100644
    --- a/package/libmodsecurity/libmodsecurity.mk
    +++ b/package/libmodsecurity/libmodsecurity.mk
    @@ -14,6 +14,24 @@ LIBMODSECURITY_CPE_ID_VENDOR = trustwave
     LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity

     LIBMODSECURITY_DEPENDENCIES = pcre
    +
    +# configure.ac will call git to get various version strings, from
    +# libmodsecurity itself, but also from bundled dependencies, just
    +# for the sake of siplaying them at the end of configure.
    +# Fake a git that returns the version for libmodescurity, to quiesce
    +# warnings...
    +define LIBMODSECURITY_FAKE_GIT
    +   $(Q)mkdir -p $(@D)/.buildroot
    +   $(Q)printf '#!/usr/bin/env sh\necho "$(LIBMODSECURITY_VERSION)"\n' \
    +           >$(@D)/.buildroot/git
    +   @(Q)chmod 755 $(@D)/.buildroot/git
    +endef
    +LIBMODSECURITY_POST_EXTRACT_HOOKS += LIBMODSECURITY_FAKE_GIT
    +
    +# 0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
    +LIBMODSECURITY_AUTORECONF = YES
    +LIBMODSECURITY_AUTORECONF_ENV = PATH="$(@D)/.buildroot:$(BR_PATH)"
    +
     LIBMODSECURITY_CONF_OPTS = \
        --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
        --disable-examples \

Regards,
Yann E. MORIN.

Quoted 71 lines
Quoted 66 lines

Regards,
Yann E. MORIN.

Quoted 56 lines
---
 ...Revert-Fix-maxminddb-link-on-FreeBSD.patch | 28 +++++++++++++++++++
 package/libmodsecurity/libmodsecurity.mk      |  2 ++
 2 files changed, 30 insertions(+)
 create mode 100644 package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
package/libmodsecurity/0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch new file +28 -0
new file mode 100644
index 0000000000..9608e3d935
@@ -0,0 +1,28 @@
+From 6737dc133cb4811a000c02b4e0a92b72f0b220ee Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <[email protected]>
+Date: Fri, 16 Jul 2021 19:12:51 +0200
+Subject: [PATCH] Revert "Fix maxminddb link on FreeBSD"
+
+This reverts commit 785958f9b5089b918c7d054cbcc2fe4a3c7b3788.
+
+Signed-off-by: Fabrice Fontaine <[email protected]>
+---
+ build/libmaxmind.m4 | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/build/libmaxmind.m4 b/build/libmaxmind.m4
+index 656fc250..02820b5a 100644
+--- a/build/libmaxmind.m4
++++ b/build/libmaxmind.m4
+@@ -10,7 +10,7 @@ dnl  MAXMIND_VERSION
+ AC_DEFUN([PROG_MAXMIND], [
+
+ # Possible names for the maxmind library/package (pkg-config)
+-MAXMIND_POSSIBLE_LIB_NAMES="maxminddb maxmind"
++MAXMIND_POSSIBLE_LIB_NAMES="libmaxminddb maxminddb maxmind"
+
+ # Possible extensions for the library
+ MAXMIND_POSSIBLE_EXTENSIONS="so la sl dll dylib"
+--
+2.30.2
+
package/libmodsecurity/libmodsecurity.mk +2 -1
index b2637257b6..66e7e522a1 100644
@@ -12,6 +12,8 @@ LIBMODSECURITY_LICENSE = Apache-2.0
 LIBMODSECURITY_LICENSE_FILES = LICENSE
 LIBMODSECURITY_CPE_ID_VENDOR = trustwave
 LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity
+# We're patching build/libmaxmind.m4
+LIBMODSECURITY_AUTORECONF = YES
 
 LIBMODSECURITY_DEPENDENCIES = pcre
 LIBMODSECURITY_CONF_OPTS = \
--

2.30.2

Quoted 4 lines

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

--
.-----------------.--------------------.------------------.--------------------.

Quoted 5 lines
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Quoted 7 lines

Best Regards,

Fabrice
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Quoted 7 lines

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Best Regards,

Fabrice

#5 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Fabrice, All,

On 2021-07-18 09:55 +0200, Fabrice Fontaine spake thusly:

Quoted 17 lines

Le sam. 17 juil. 2021 ? 22:33, Yann E. MORIN <[email protected]> a ?crit :

Quoted 16 lines

On 2021-07-17 21:33 +0200, Fabrice Fontaine spake thusly:

Quoted 15 lines

Le sam. 17 juil. 2021 ? 11:11, Yann E. MORIN <[email protected]> a ?crit :

Quoted 14 lines

On 2021-07-16 19:20 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

I was about to just push this, but the autoreconf spews out a lot of warning for out-of-tree builds:

[--SNIP--]

Quoted 4 lines
Quoted 1 line

Still, this is very unclean to have those warnings... :-(

Agreed, but then what would be the best option?
- Remove autoreconf and patch directly the configure file?
- Set LIBMODSECURITY_GIT_SUBMODULE to YES and retrieve the full

Well, with the little patch I proposed below, this provides a fake 'git' that just prints the libmodsecurity version string, which should be just enough to pass the autoreconf step, no?

Quoted 21 lines
Quoted 21 lines

diff --git a/package/libmodsecurity/libmodsecurity.mk b/package/libmodsecurity/libmodsecurity.mk index b2637257b6..10338dad7c 100644
--- a/package/libmodsecurity/libmodsecurity.mk
+++ b/package/libmodsecurity/libmodsecurity.mk
@@ -14,6 +14,24 @@ LIBMODSECURITY_CPE_ID_VENDOR = trustwave
LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity

LIBMODSECURITY_DEPENDENCIES = pcre
+
+# configure.ac will call git to get various version strings, from +# libmodsecurity itself, but also from bundled dependencies, just +# for the sake of siplaying them at the end of configure. +# Fake a git that returns the version for libmodescurity, to quiesce +# warnings...
+define LIBMODSECURITY_FAKE_GIT
+ $(Q)mkdir -p $(@D)/.buildroot
+ $(Q)printf '#!/usr/bin/env sh\necho "$(LIBMODSECURITY_VERSION)"\n' \
+ >$(@D)/.buildroot/git
+ @(Q)chmod 755 $(@D)/.buildroot/git
+endef
+LIBMODSECURITY_POST_EXTRACT_HOOKS += LIBMODSECURITY_FAKE_GIT

Quoted 8 lines
Quoted 8 lines
    +
    +# 0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
    +LIBMODSECURITY_AUTORECONF = YES
    +LIBMODSECURITY_AUTORECONF_ENV = PATH="$(@D)/.buildroot:$(BR_PATH)"
    +
     LIBMODSECURITY_CONF_OPTS = \
        --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
        --disable-examples \

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Le dim. 18 juil. 2021 ? 10:08, Yann E. MORIN <[email protected]> a ?crit :

Quoted 22 lines

Fabrice, All,

On 2021-07-18 09:55 +0200, Fabrice Fontaine spake thusly:

Quoted 17 lines

Le sam. 17 juil. 2021 ? 22:33, Yann E. MORIN <[email protected]> a ?crit :

Quoted 16 lines

On 2021-07-17 21:33 +0200, Fabrice Fontaine spake thusly:

Quoted 15 lines

Le sam. 17 juil. 2021 ? 11:11, Yann E. MORIN <[email protected]> a ?crit :

Quoted 14 lines

On 2021-07-16 19:20 +0200, Fabrice Fontaine spake thusly:

Quoted 11 lines

Build with libmaxminddb is broken since bump to version 3.0.5 in commit 464d0be380c84ac7c3f1684e49153c3868280d7e because of
https://github.com/SpiderLabs/ModSecurity/commit/785958f9b5089b918c7d054cbcc2fe4a3c7b3788

So revert this commit until upstream answer to comment to
https://github.com/SpiderLabs/ModSecurity/issues/2131

Fixes:
- http://autobuild.buildroot.org/results/4c639fd967faa06f8ae362bacd38f3409c47267c

I was about to just push this, but the autoreconf spews out a lot of warning for out-of-tree builds:

[--SNIP--]

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Still, this is very unclean to have those warnings... :-(

Agreed, but then what would be the best option?
- Remove autoreconf and patch directly the configure file?
- Set LIBMODSECURITY_GIT_SUBMODULE to YES and retrieve the full

Well, with the little patch I proposed below, this provides a fake 'git' that just prints the libmodsecurity version string, which should be just enough to pass the autoreconf step, no?

Sure, I missed it, sorry, I'll take a second coffee ;-).

Quoted 34 lines
Quoted 22 lines
Quoted 22 lines

diff --git a/package/libmodsecurity/libmodsecurity.mk b/package/libmodsecurity/libmodsecurity.mk index b2637257b6..10338dad7c 100644
--- a/package/libmodsecurity/libmodsecurity.mk
+++ b/package/libmodsecurity/libmodsecurity.mk
@@ -14,6 +14,24 @@ LIBMODSECURITY_CPE_ID_VENDOR = trustwave
LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity

LIBMODSECURITY_DEPENDENCIES = pcre
+
+# configure.ac will call git to get various version strings, from +# libmodsecurity itself, but also from bundled dependencies, just +# for the sake of siplaying them at the end of configure. +# Fake a git that returns the version for libmodescurity, to quiesce +# warnings...
+define LIBMODSECURITY_FAKE_GIT
+ $(Q)mkdir -p $(@D)/.buildroot
+ $(Q)printf '#!/usr/bin/env sh\necho "$(LIBMODSECURITY_VERSION)"\n' \
+ >$(@D)/.buildroot/git
+ @(Q)chmod 755 $(@D)/.buildroot/git
+endef
+LIBMODSECURITY_POST_EXTRACT_HOOKS += LIBMODSECURITY_FAKE_GIT

Quoted 8 lines
Quoted 8 lines
    +
    +# 0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
    +LIBMODSECURITY_AUTORECONF = YES
    +LIBMODSECURITY_AUTORECONF_ENV = PATH="$(@D)/.buildroot:$(BR_PATH)"
    +
     LIBMODSECURITY_CONF_OPTS = \
        --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
        --disable-examples \

Regards,
Yann E. MORIN.

Quoted 7 lines

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Best Regards,

Fabrice

#7 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Fabrice, All,

On 2021-07-18 10:33 +0200, Fabrice Fontaine spake thusly:

Quoted 1 line

Le dim. 18 juil. 2021 ? 10:08, Yann E. MORIN <[email protected]> a ?crit :

[--SNIP--]

Quoted 17 lines
Quoted 17 lines
Quoted 17 lines
Quoted 17 lines

diff --git a/package/libmodsecurity/libmodsecurity.mk b/package/libmodsecurity/libmodsecurity.mk index b2637257b6..10338dad7c 100644
--- a/package/libmodsecurity/libmodsecurity.mk
+++ b/package/libmodsecurity/libmodsecurity.mk
@@ -14,6 +14,24 @@ LIBMODSECURITY_CPE_ID_VENDOR = trustwave
LIBMODSECURITY_CPE_ID_PRODUCT = modsecurity

LIBMODSECURITY_DEPENDENCIES = pcre
+
+# configure.ac will call git to get various version strings, from +# libmodsecurity itself, but also from bundled dependencies, just +# for the sake of siplaying them at the end of configure. +# Fake a git that returns the version for libmodescurity, to quiesce +# warnings...
+define LIBMODSECURITY_FAKE_GIT
+ $(Q)mkdir -p $(@D)/.buildroot
+ $(Q)printf '#!/usr/bin/env sh\necho "$(LIBMODSECURITY_VERSION)"\n' \

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
    +           >$(@D)/.buildroot/git
    +   @(Q)chmod 755 $(@D)/.buildroot/git
    +endef
    +LIBMODSECURITY_POST_EXTRACT_HOOKS += LIBMODSECURITY_FAKE_GIT
    +
    +# 0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
    +LIBMODSECURITY_AUTORECONF = YES
    +LIBMODSECURITY_AUTORECONF_ENV = PATH="$(@D)/.buildroot:$(BR_PATH)"

Becarefull here: BR_PATH is already quoted:

    Makefile:478:BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)"

How do other packages do? Hmm... It sems they usually do not quote anything, e.g.:

    package/nodejs/nodejs.mk:91:            PATH=$(@D)/bin:$(BR_PATH)
    package/qt5/qt5webkit/qt5webkit.mk:33:QT5WEBKIT_CONF_ENV = PATH=$(@D)/host-bin:$(BR_PATH)

So, no quoting...

However, wireshark got it wrong:

    package/wireshark/wireshark.mk:24:      PATH="$(@D)/bin:$(BR_PATH)"

Regards,
Yann E. MORIN.

Quoted 18 lines
Quoted 8 lines
Quoted 4 lines
Quoted 4 lines
    +
     LIBMODSECURITY_CONF_OPTS = \
        --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
        --disable-examples \

Regards,
Yann E. MORIN.

Quoted 7 lines

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |

'------------------------------^-------^------------------^--------------------'

Best Regards,

Fabrice

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#8 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

In reply to Yann E. MORIN

Hello,

Quoted 13 lines · On Sat, 17 Jul 2021 22:33:43 +0200 "Yann E. MORIN" <[email protected]>…
    +
    +# configure.ac will call git to get various version strings, from
    +# libmodsecurity itself, but also from bundled dependencies, just
    +# for the sake of siplaying them at the end of configure.
    +# Fake a git that returns the version for libmodescurity, to quiesce
    +# warnings...
    +define LIBMODSECURITY_FAKE_GIT
    +	$(Q)mkdir -p $(@D)/.buildroot
    +	$(Q)printf '#!/usr/bin/env sh\necho "$(LIBMODSECURITY_VERSION)"\n' \
    +		>$(@D)/.buildroot/git
    +	@(Q)chmod 755 $(@D)/.buildroot/git
    +endef
    +LIBMODSECURITY_POST_EXTRACT_HOOKS += LIBMODSECURITY_FAKE_GIT
Quoted 8 lines
    +
    +# 0001-Revert-Fix-maxminddb-link-on-FreeBSD.patch
    +LIBMODSECURITY_AUTORECONF = YES
    +LIBMODSECURITY_AUTORECONF_ENV = PATH="$(@D)/.buildroot:$(BR_PATH)"
    +
     LIBMODSECURITY_CONF_OPTS = \
     	--with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
     	--disable-examples \

Shouldn't we "simply" teach to libmodsecurity configure.ac that it may be autoreconf'ed outside of a Git repository ?

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#9 lore raw

PATCH 1/1 package/libmodsecurity: fix build with libmaxminddb

Thomas, All,

On 2021-07-18 14:06 +0200, Thomas Petazzoni spake thusly:

Quoted 7 lines
Quoted 5 lines · On Sat, 17 Jul 2021 22:33:43 +0200 "Yann E. MORIN" <[email protected]>…

+# configure.ac will call git to get various version strings, from +# libmodsecurity itself, but also from bundled dependencies, just +# for the sake of siplaying them at the end of configure. +# Fake a git that returns the version for libmodescurity, to quiesce +# warnings...

[--SNIP--]

Quoted 2 lines

Shouldn't we "simply" teach to libmodsecurity configure.ac that it may be autoreconf'ed outside of a Git repository ?

Easier said than done... That was my initial thought, but given how configure.ac is written, this will have to be quite some intrusive changes. The most problematic being test/test-cases/secrules-language-tests and others/libinjection, which are both managed via git submodules.

And no, switching over to downloading via git, will not help: we still do not have a .git/ directory in the archives we generate, and from which we do the build.

But really, sice these version strings are only ever used as informative text at the end of configure, I don't think we should care much what they get set to:

    configure.ac:
    414 # Print a fancy summary
    415 echo " "
    416 echo " "
    417 echo "ModSecurity - ${MSC_GIT_VERSION} for $PLATFORM"
    418 echo " "
    419 echo " Mandatory dependencies"
    420 echo -n "   + libInjection                                  ...."
    421 echo LIBINJECTION_VERSION
    422 echo -n "   + SecLang tests                                 ...."
    423 echo SECLANG_TEST_VERSION
    424
    425 echo " "
    426 echo " Optional dependencies"

    configure:
    24978 # Print a fancy summary
    24979 echo " "
    24980 echo " "
    24981 echo "ModSecurity - ${MSC_GIT_VERSION} for $PLATFORM"
    24982 echo " "
    24983 echo " Mandatory dependencies"
    24984 echo -n "   + libInjection                                  ...."
    24985 echo v3.9.2-46-gbfba51f
    24986 echo -n "   + SecLang tests                                 ...."
    24987 echo a3d4405
    24988
    24989 echo " "
    24990 echo " Optional dependencies"

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'