Bug 3598 - Build issue with unbound-1.7.0rc1 (and rc2) on rhel6 based system
Build issue with unbound-1.7.0rc1 (and rc2) on rhel6 based system
Product: unbound
Classification: Unclassified
Component: server
x86_64 Linux
: P5 blocker
Assigned To: unbound team
Depends on:
  Show dependency treegraph
Reported: 2018-03-08 22:20 CET by Tuomo Soini
Modified: 2018-03-09 10:09 CET (History)
2 users (show)

See Also:

Gzipped build.log showing the syntax error in configure after autoreconf (5.09 KB, application/gzip)
2018-03-08 22:20 CET, Tuomo Soini
rhel6 patch to remove swig version requirement (584 bytes, patch)
2018-03-09 08:45 CET, Tuomo Soini
Details | Diff
diff from generated configure (174.55 KB, application/gzip)
2018-03-09 09:16 CET, Tuomo Soini

Note You need to log in before you can comment on or make changes to this bug.
Description Tuomo Soini 2018-03-08 22:20:53 CET
Created attachment 496 [details]
Gzipped build.log showing the syntax error in configure after autoreconf

Because rhel6 has too old swig, I need to patch version check away from configure.ac to build the package.

That forces me to run autotools again. Resulted configure is not a valid shell script and won't work.
Comment 1 Wouter Wijngaards 2018-03-09 08:06:50 CET
Hi Tuomo,

Could you send me that patch or the patched script?  I cannot from your log see where the error happens in the script.  There is a lot of configure generated shell script there and the line number won't match with mine (now that you have patched it).

Or maybe better, if you really have a good reason to disable swig version number checks, can you tell me what swig version is allowed, and then I could change the swig version number check to allow that swig that you have.  Because it works, right?  If it works, then we can build the package right?  Perhaps we need to check for the specific version of swig that you have?

Best regards, Wouter
Comment 2 Tuomo Soini 2018-03-09 08:45:59 CET
Created attachment 497 [details]
rhel6 patch to remove swig version requirement
Comment 3 Tuomo Soini 2018-03-09 08:48:48 CET
I'd really like configure option to skip that version check instead.

--ignore-swig-version-check or something. It's known that python module is not 100% reliable with older swig but dropping python module would break system so it must be build.
Comment 4 Wouter Wijngaards 2018-03-09 08:50:57 CET
Hi Tuomi,

If I apply this patch, the result autoconf's fine and also runs fine without error.  So I don't know how to fix this.

What is your swig version that apparently works?  I can make it omit the version check when that version is present?

Best regards, Wouter
Comment 5 Tuomo Soini 2018-03-09 08:55:13 CET
only autoreconf --install --verbose --force on rhel6 (centos6) has that problem with generating non-working confiure. On rhel7/centos7 that works.
Comment 6 Tuomo Soini 2018-03-09 08:56:47 CET
With 1.6.8 generated configure still worked.
Comment 7 Wouter Wijngaards 2018-03-09 09:01:16 CET
Hi Tuomi,

Okay, I cannot guess why it does not work for you any more.

Here is the patch I am going to commit ( and then you could pick up the new configure script from the software repository instead of running autoconf).  Does the new patch work with your autoconf?  Then I don't need to do rc3...

This is the patch.  You need to give --disable-swig-version-check.

Best regards, Wouter

Index: configure.ac
--- configure.ac	(revision 4572)
+++ configure.ac	(working copy)
@@ -587,7 +587,12 @@
       # Check for SWIG
-      AC_PROG_SWIG(2.0.1)
+      AC_ARG_ENABLE(swig-version-check, AC_HELP_STRING([--disable-swig-version-check], [Disable swig version check to build python modules with older swig even though that is unreliable]))
+      if test "$enable_swig_version_check" = "yes"; then
+      	AC_PROG_SWIG(2.0.1)
+      else
+      	AC_PROG_SWIG
+      fi
       if test ! -x "$SWIG"; then
          AC_ERROR([failed to find swig tool, install it, or do not build Python module and PyUnbound])
Comment 8 Tuomo Soini 2018-03-09 09:16:40 CET
Created attachment 498 [details]
diff from generated configure

There is some change which requires newer toolset.

Attached diff from original configure to rhel6 generated configure if you can guess which change causes invalid configure.

The issue is not the patch - just running autoreconf breaks configure.
Comment 9 Tuomo Soini 2018-03-09 09:18:04 CET
And yes, option to disable swig versin check removes need to run autoreconf, so that is one work-around for this issue.
Comment 10 Wouter Wijngaards 2018-03-09 09:33:14 CET
Hi Tuomo,

Thanks for the configure diff.  I cannot see what it is.  Perhaps the 'then :' replaced by 'then' for a lot of if statements when you ran autoconf-2.63.

And then I see that USE_NSS if statement, where the AC_ERROR is expanded by 2.63 in to a complex {{ ..}..} code, and 2.69 creates a simple function call.  So perhaps this diff solves the 2.63 autoconf problem?

Best regards, Wouter

This is from your configure.diff file:
        if test $USE_NSS = "yes"; then
-               as_fn_error $? "--with-nss can only be used in combination with --with-libunbound-only." "$LINENO" 5
+               { { $as_echo "$as_me:$LINENO: error: --with-nss can only be used in combination with --with-libunbound-only." >&5
+$as_echo "$as_me: error: --with-nss can only be used in combination with --with-libunbound-only." >&2;}
+   { (exit 1); exit 1; }; }

This patch, does it work?

Index: configure.ac
--- configure.ac	(revision 4573)
+++ configure.ac	(working copy)
@@ -1505,10 +1505,10 @@
 if test $ALLTARGET = "alltargets"; then
-	if test $USE_NSS = "yes"; then 
+	if test $USE_NSS = "yes"; then :
 		AC_ERROR([--with-nss can only be used in combination with --with-libunbound-only.])	
-	if test $USE_NETTLE = "yes"; then
+	if test $USE_NETTLE = "yes"; then :
 		AC_ERROR([--with-nettle can only be used in combination with --with-libunbound-only.])	
Comment 11 Tuomo Soini 2018-03-09 09:48:11 CET
Unfortunately not. Exactly same error as before.

Note. last log line before error is:

checking for strsep... yes
Comment 12 Wouter Wijngaards 2018-03-09 09:51:02 CET
Hi Tuomi,

Okay, not this one then.  strsep and then after it is a lot of code that doesn't have printouts.  Perhaps if you add set -v (echo script lines) to the start of the configure script somewhere (before strsep for example), then it'll echo the lines as it executes them.  And we can narrow it down.  But from the diffs between configure.ac from 1.6.8 to 1.7.0, this if statement (around $USE_NSS) is the change after strsep.

Best regards, Wouter
Comment 13 Tuomo Soini 2018-03-09 10:01:36 CET
If you add that --without-swig-version-check option there is no need to run autoreconf and that's good enough for me.

Thank you.
Comment 14 Wouter Wijngaards 2018-03-09 10:09:09 CET
Hi Tuomi,

Sure, I'll add that option, I already added it to the code repository earlier, if you want to use it you could download it there.  Thanks for the bugreport.

Best regards, Wouter