Bug 240297

Summary: dns/opendnssec{2}: Fails to configure after ldns 1.7.1 update (configure: error: Can't find ldns library)
Product: Ports & Packages Reporter: Roman Serbski <mefystofel>
Component: Individual Port(s)Assignee: Danilo G. Baio <dbaio>
Status: Closed FIXED    
Severity: Affects Only Me CC: dbaio, fox, jaap, swills
Priority: --- Keywords: regression
Version: LatestFlags: koobs: maintainer-feedback+
Hardware: Any   
OS: Any   
Attachments:
Description Flags
dns___opendnssec.log
none
dns___opendnssec2.log
none
Patch to add proper prefix path to ldns-config script.
none
Patch to fix problem koobs: maintainer-approval+

Description Roman Serbski 2019-09-03 09:56:00 UTC
Hello,

$ uname -a
FreeBSD SRV-SYNTH 12.0-RELEASE-p7 FreeBSD 12.0-RELEASE-p7 r350211 BSD12201905  amd64

I think after dns/ldns was updated to 1.7.1 both dns/opendnssec and dns/opendnssec2 fail to build.

I'm using Synth 2.08 and the error is:

...
checking for ldns-config... /usr/local/bin/ldns-config
checking what are the ldns includes... -I/include
checking what are the ldns libs...   -fstack-protector-strong    -L/lib   -lcrypto -lldns
checking for ldns_rr_new in -lldns... no
configure: error: Can't find ldns library
===>  Script "configure" failed unexpectedly.

Will be happy to provide any additional information if needed.

Thanks.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-03 09:59:00 UTC
Thank you for the report Roman

Could you please include the following information:

- pkg version -v output (as an attachment)
- full build log (as an attachment)
- WRKSRC/config.log (as an attachment)
Comment 2 Roman Serbski 2019-09-03 10:13:15 UTC
Thank you Kubilay.

As requested:

$ pkg version -v 
adacurses-20180127                 =   up-to-date with port
binutils-2.32_1,1                  =   up-to-date with port
bison-3.4.1,1                      =   up-to-date with port
ccache-3.7.1                       =   up-to-date with port
dialog4ports-0.1.6                 =   up-to-date with port
gcc6-aux-20180516_1,1              =   up-to-date with port
gettext-runtime-0.20.1             =   up-to-date with port
gettext-tools-0.20.1_1             =   up-to-date with port
gmake-4.2.1_3                      =   up-to-date with port
gmp-6.1.2_1                        =   up-to-date with port
help2man-1.47.11                   =   up-to-date with port
indexinfo-0.3.1                    =   up-to-date with port
ini_file_manager-03_3              =   up-to-date with port
libiconv-1.14_11                   =   up-to-date with port
libtextstyle-0.20.1                =   up-to-date with port
m4-1.4.18_1,1                      =   up-to-date with port
mpc-1.1.0_2                        =   up-to-date with port
mpfr-4.0.2                         =   up-to-date with port
ncurses-6.1.20190525               =   up-to-date with port
p5-Locale-gettext-1.07             =   up-to-date with port
p5-Locale-libintl-1.31             =   up-to-date with port
p5-Text-Unidecode-1.30             =   up-to-date with port
p5-Unicode-EastAsianWidth-1.40     =   up-to-date with port
perl5-5.30.0                       =   up-to-date with port
pkg-1.11.1                         =   up-to-date with port
pkgconf-1.6.3,1                    =   up-to-date with port
rsync-3.1.3_1                      =   up-to-date with port
synth-2.08                         =   up-to-date with port
texinfo-6.6_2,1                    =   up-to-date with port
Comment 3 Roman Serbski 2019-09-03 10:14:04 UTC
Created attachment 207138 [details]
dns___opendnssec.log
Comment 4 Roman Serbski 2019-09-03 10:14:20 UTC
Created attachment 207139 [details]
dns___opendnssec2.log
Comment 5 Jaap Akkerhuis 2019-09-03 12:04:06 UTC
Thanks for reporting the bug and I can confirm and reproduce it. Apparently ldns-config changed with the upgrade and now produces the wrong information.

Correct information:

     /usr/local/bin/ldns-config --cflags --version
     -I/usr/local/include
     1.7.0

Wrong information:

    /usr/local/bin/ldns-config --cflags --version
    -I/include
    1.7.1

It is a shell script so a very quick work around is to edit it by hand.

Meanwhile I'll chase root cause of the problem and will provide a decent patch later.
Comment 6 Santhosh Raju freebsd_committer freebsd_triage 2019-09-03 19:53:19 UTC
Created attachment 207165 [details]
Patch to add proper prefix path to ldns-config script.

(In reply to Jaap Akkerhuis from comment #5)

After fiddling around a bit, adding the following additional lines in packaging/ldns-config.in helped it spew out the correct paths.

--- packaging/ldns-config.in.orig       2019-09-03 19:39:55 UTC
+++ packaging/ldns-config.in
@@ -1,5 +1,7 @@
 #!/bin/sh

+prefix="@prefix@"
+exec_prefix="@exec_prefix@"
 VERSION="@PACKAGE_VERSION@"
 LDFLAGS="@LDFLAGS@ @LIBSSL_LDFLAGS@ @PYTHON_LDFLAGS@"
 LIBS="@LIBS@ @LIBSSL_LIBS@"


After the patching and re-installing dns/ldns, ldns-config shows

# /usr/local/bin/ldns-config --cflags --version
-I/usr/local/include
1.7.1

This also helped with building dns/opendnssec package successfully.

Let me know if this is the correct way to apply the fix.
Comment 7 Jaap Akkerhuis 2019-09-03 21:39:28 UTC
(In reply to Santhosh Raju from comment #6)
Yes, this is the root cause of the problem.

Before I saw your reaction, I actually just created PR #240321, which contains a patch to fix this properly.
Comment 8 Santhosh Raju freebsd_committer freebsd_triage 2019-09-03 22:09:02 UTC
(In reply to Jaap Akkerhuis from comment #7)

Alright, thank you for the fix.
Comment 9 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-04 01:24:03 UTC
*** Bug 240321 has been marked as a duplicate of this bug. ***
Comment 10 Jaap Akkerhuis 2019-09-04 09:54:46 UTC
Created attachment 207180 [details]
Patch to fix problem

Patch to dns/ldns to fix the problem
Comment 11 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-05 11:45:24 UTC
Comment on attachment 207180 [details]
Patch to fix problem

Patch author is MAINTAINER, set maintainer-approval attachment flag (to +) to denote maintainer approval so that it can be distinguished from non-maintainer patches
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2019-09-05 11:46:19 UTC
Maintainer acknowledged/responded, set maintainer-feedback flag (to +)
Comment 13 commit-hook freebsd_committer freebsd_triage 2019-09-05 23:55:09 UTC
A commit references this bug:

Author: dbaio
Date: Thu Sep  5 23:54:46 UTC 2019
New revision: 511275
URL: https://svnweb.freebsd.org/changeset/ports/511275

Log:
  dns/ldns: Fix ldns-config

  After the last update ldns-config is producing wrong information and at least
  dns/opendnssec and dns/opendnssec2 are failing to build.

  PR:		240297
  Submitted by:	Jaap Akkerhuis <jaap@NLnetLabs.nl> (maintainer)
  Reported by:	Roman Serbski <mefystofel@gmail.com>

Changes:
  head/dns/ldns/Makefile
  head/dns/ldns/files/
  head/dns/ldns/files/patch-packaging_ldns-config.in
Comment 14 Danilo G. Baio freebsd_committer freebsd_triage 2019-09-05 23:56:47 UTC
Committed, thank you all.