• Re: New BIND releases ... 9.16.4: build, 'fatal error: lmdb.h: Nosuch file or directory'

    From PGNet Dev@pgnet.dev@gmail.com to =?UTF-8?B?T25kxZllaiBTdXLDvQ==?= on Wed Jun 17 22:15:05 2020
    From Newsgroup: comp.protocols.dns.bind

    On 6/17/20 9:48 PM, Ondřej Surý wrote:
    Virtually everybody except upstream has modified LMDB to follow a normal directory layout and BIND expect that.
    You should just move the header files and library to /usr/local/include and /usr/local/lib respectively.

    That's just a silly statement.

    1st, /usr/local/lib is NOT a 'normal directory' layout for a number of distros -- /usr/local/lib64 is. That assumption in bind's code is just wrong.

    Software should link against the libs, and include the headers, you TELL it to -- not what it arbitrarily 'expects'.

    Finally, if that's BIND's 'expectation', why does bind even have a =path config option for it?

    What's the basis for arbitrary choice of bind using pkg-config for some pkgs, providing well-functioning _CFLAGS/_LDFLAGS/_LIBS overrides for others -- but in the case of lmdb, neither -- just an 'expectation'?
    --- Synchronet 3.18a-Linux NewsLink 1.113
  • From Matt Pallissard@matt@pallissard.net to PGNet Dev on Thu Jun 18 06:34:12 2020
    From Newsgroup: comp.protocols.dns.bind


    --5xq5rjbvrqmhvhuc
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable

    Response in-line.

    build now fails @ "fatal error: lmdb.h: No such file or directory"

    ...
    libtool: compile: /usr/bin/gcc-10 -include /usr/local/src/bind-9.16.4/c=
    onfig.h -I/usr/local/src/bind-9.16.4 -I../.. -I./include -I./unix/include -=
    I. -I/usr/local/src/bind-9.16.4/lib/ns/include -I../../lib/ns/include -I/us= r/local/src/bind-9.16.4/lib/dns/include -I../../lib/dns/include -I/usr/loca= l/openssl11/include -I/usr/local/src/bind-9.16.4/lib/bind9/include -I../../= lib/bind9/include -I/usr/local/src/bind-9.16.4/lib/isccfg/include -I../../l= ib/isccfg/include -I/usr/local/src/bind-9.16.4/lib/isccc/include -I../../li= b/isccc/include -I/usr/local/src/bind-9.16.4/lib/isc/include -I../../lib/is=
    c -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/isc/pthr= eads/include -I/usr/local/openssl11/include -I/usr/include/json-c -I/usr/in= clude/libxml2 -I/usr/local/include -O3 -Wall -fstack-protector-strong -funw= ind-tables -fasynchronous-unwind-tables -fmessage-length=3D0 -grecord-gcc-s= witches -march=3Dnative -mtune=3Dnative -fPIC -DPIC -D_GNU_SOURCE -fno-stri= ct-aliasing -Wall -pthread -fPIC -W -Wall -Wmissing-prototypes -Wcast-qual = -Wwrite-strings -Wformat -Wpointer-arith -Wno-missing-field-initializers -f= no-strict-aliasing -DPRODUCT=3D\"BIND\" -DVERSION=3D\"9.16.4\" -c ./server.=
    c -fPIC -DPIC -o .libs/server.o
    In file included from ./server.c:131:

    There is no `-I/usr/local/lmdb/include` here

    echo $CPPFLAGS
    -I/usr/local/include -I/usr/local/openssl11/include -I/usr/local/lmdb/i=
    nclude -I/usr/include

    I'd imagine you want CPPFLAGS here. or you can export C_INCLUDE_PATH



    Matt Pallissard

    --5xq5rjbvrqmhvhuc
    Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iHUEABYIAB0WIQTvIUMPApUGn6YFkXl1uof+t048SQUCXuttUQAKCRB1uof+t048 ScBLAP46ePpuxyhQZNAYGIuG23aTAtjxHJJl3mkXiNw5muDs+gD/RpcqxLkTeSyQ 1VDd7DWniochElVG/6PkmMDaLv88GQs=
    =Lsic
    -----END PGP SIGNATURE-----

    --5xq5rjbvrqmhvhuc--
    --- Synchronet 3.18a-Linux NewsLink 1.113
  • From Matt Pallissard@matt@pallissard.net to PGNet Dev on Thu Jun 18 06:35:24 2020
    From Newsgroup: comp.protocols.dns.bind


    --masco6o4ufsdc3r3
    Content-Type: text/plain; charset=us-ascii
    Content-Disposition: inline
    Content-Transfer-Encoding: quoted-printable


    On 2020-06-18T06:34:12 -0700, Matt Pallissard wrote:
    Response in-line.
    =20
    build now fails @ "fatal error: lmdb.h: No such file or directory"

    ...
    libtool: compile: /usr/bin/gcc-10 -include /usr/local/src/bind-9.16.4=
    /config.h -I/usr/local/src/bind-9.16.4 -I../.. -I./include -I./unix/include=
    -I. -I/usr/local/src/bind-9.16.4/lib/ns/include -I../../lib/ns/include -I/= usr/local/src/bind-9.16.4/lib/dns/include -I../../lib/dns/include -I/usr/lo= cal/openssl11/include -I/usr/local/src/bind-9.16.4/lib/bind9/include -I../.= =2E/lib/bind9/include -I/usr/local/src/bind-9.16.4/lib/isccfg/include -I../= =2E./lib/isccfg/include -I/usr/local/src/bind-9.16.4/lib/isccc/include -I..= /../lib/isccc/include -I/usr/local/src/bind-9.16.4/lib/isc/include -I../../= lib/isc -I../../lib/isc/include -I../../lib/isc/unix/include -I../../lib/is= c/pthreads/include -I/usr/local/openssl11/include -I/usr/include/json-c -I/= usr/include/libxml2 -I/usr/local/include -O3 -Wall -fstack-protector-strong=
    -funwind-tables -fasynchronous-unwind-tables -fmessage-length=3D0 -grecord= -gcc-switches -march=3Dnative -mtune=3Dnative -fPIC -DPIC -D_GNU_SOURCE -fn= o-strict-aliasing -Wall -pthread -fPIC -W -Wall -Wmissing-prototypes -Wcast= -qual -Wwrite-strings -Wformat -Wpointer-arith -Wno-missing-field-initializ= ers -fno-strict-aliasing -DPRODUCT=3D\"BIND\" -DVERSION=3D\"9.16.4\" -c ./s= erver.c -fPIC -DPIC -o .libs/server.o
    In file included from ./server.c:131:
    =20
    There is no `-I/usr/local/lmdb/include` here
    =20
    echo $CPPFLAGS
    -I/usr/local/include -I/usr/local/openssl11/include -I/usr/local/lmdb=
    /include -I/usr/include
    =20
    I'd imagine you want CPPFLAGS here. or you can export C_INCLUDE_PATH

    Edit:

    `s/CPPFLAGS/CFLAGS`

    Matt Pallissrd


    --masco6o4ufsdc3r3
    Content-Type: application/pgp-signature; name="signature.asc"

    -----BEGIN PGP SIGNATURE-----

    iHUEABYIAB0WIQTvIUMPApUGn6YFkXl1uof+t048SQUCXuttnAAKCRB1uof+t048 SVWIAP40AY0guT2MpDVjICHN29mn1sgLuNpb7oU8Addj68TQygD+PrE351Acx3/g d6Oh/gddfVmeQTX8DtuWISBM9UlW+Ao=
    =e5Xv
    -----END PGP SIGNATURE-----

    --masco6o4ufsdc3r3--
    --- Synchronet 3.18a-Linux NewsLink 1.113
  • From PGNet Dev@pgnet.dev@gmail.com to Matt Pallissard on Thu Jun 18 10:25:29 2020
    From Newsgroup: comp.protocols.dns.bind

    On 6/18/20 6:34 AM, Matt Pallissard wrote:
    I'd imagine you want CPPFLAGS here. or you can export C_INCLUDE_PATH
    ...
    Edit:
    `s/CPPFLAGS/CFLAGS`


    specifically adding '-I/usr/local/lmdb/include' to $CFLAGS makes the build unhappy, here.

    but, yep! ... there _is_ hoop-jumping that appears to workaround the WONTFIX silliness^^ ...

    with lmdb installed as

    tree /usr/local/lmdb
    /usr/local/lmdb
    ├── bin
    │   ├── mdb_copy
    │   ├── mdb_drop
    │   ├── mdb_dump
    │   ├── mdb_load
    │   └── mdb_stat
    ├── include
    │   └── lmdb.h
    ├── lib
    ├── lib64
    │   ├── liblmdb.a
    │   └── liblmdb.so
    ├── man
    └── share
    └── man
    └── man1
    ├── mdb_copy.1
    ├── mdb_drop.1
    ├── mdb_dump.1
    ├── mdb_load.1
    └── mdb_stat.1

    setting @ bind configure

    --with-lmdb=/usr/local/lmdb

    to avoid

    checking for lmdb library... configure: error: include/lmdb.h not found.

    and to ensure the feature is (at least) _reported_ as enabled

    ...
    ===============================================================================
    Configuration summary:
    -------------------------------------------------------------------------------
    Optional features enabled:
    ...
    LMDB database to store configuration for 'addzone' zones (--with-lmdb)
    ...
    -------------------------------------------------------------------------------
    Features disabled or unavailable on this platform:
    ...

    then just this

    CPPFLAGS= ... -I/usr/local/lmdb/include ...

    LDFLAGS=... -L/usr/local/lmdb/lib64 -llmdb ...

    is sufficient add'n to general flags

    still to make add'l adjustments.
    namely, to just completely circumvent the src code mess that results in,

    LMDB_CFLAGS = -I/usr/local/lmdb/include
    LMDB_LIBS = -L/usr/local/lmdb/lib none required

    and build breakage, applying to clean source,

    patch << 'EOF'
    --- configure.ac.ORIG 2020-06-10 14:01:43.000000000 -0700
    +++ configure.ac 2020-06-18 09:45:42.142523855 -0700
    @@ -1274,6 +1274,8 @@
    else
    AC_MSG_RESULT(no)
    fi
    +LMDB_CFLAGS="-I/usr/local/lmdb/include"
    +LMDB_LIBS="-L/usr/local/lmdb/lib64 -llmdb"
    AC_SUBST([LMDB_CFLAGS])
    AC_SUBST([LMDB_LIBS])
    EOF

    then, of course,

    ./autogen.sh

    now, after config, correctly

    s|^LMDB_CFLAGS =.*|LMDB_CFLAGS = -I/usr/local/lmdb/include|g
    s|^LMDB_LIBS =.*|LMDB_LIBS = -L/usr/local/lmdb/lib64 -llmdb|g

    on subsequent build, there's no longer any 'fatal error',

    In file included from server.c:131:
    /usr/local/src/bind-9.16.4/lib/dns/include/dns/lmdb.h:12:10: fatal error: lmdb.h: No such file or directory
    12 | #include <lmdb.h>
    | ^~~~~~~~
    compilation terminated.

    and, on install, named runs/functions

    named -v
    BIND 9.16.4 (Stable Release) <id:0849b42>

    lmdb lib is linked,

    ldd `which named` | grep lmdb
    liblmdb.so => /usr/local/lmdb/lib64/liblmdb.so (0x00007fedf088b000)

    but whether lmdb inclusion/usage now _functions_ correctly with that^ cleanup, i have yet to verify.
    checking now ...

    --- Synchronet 3.18a-Linux NewsLink 1.113
  • From PGNet Dev@pgnet.dev@gmail.com to =?UTF-8?B?T25kxZllaiBTdXLDvQ==?= on Thu Jun 18 10:25:59 2020
    From Newsgroup: comp.protocols.dns.bind

    this

    configure.ac
    AC_MSG_CHECKING(for lmdb library)
    AC_ARG_WITH(lmdb,
    AS_HELP_STRING([--with-lmdb[=PATH]],
    [build with LMDB library [yes|no|path]]),
    use_lmdb="$withval", use_lmdb="auto")

    have_lmdb=""
    case "$use_lmdb" in
    no)
    LMDB_LIBS=""
    ;;
    auto|yes)
    for d in /usr /usr/local /opt/local
    do
    if test -f "${d}/include/lmdb.h"
    then
    if test ${d} != /usr
    then
    LMDB_CFLAGS="-I ${d}/include"
    !! LMDB_LIBS="-L${d}/lib"
    fi
    have_lmdb="yes"
    fi
    done
    ;;
    *)
    if test -f "${use_lmdb}/include/lmdb.h"
    then
    LMDB_CFLAGS="-I${use_lmdb}/include"
    !! LMDB_LIBS="-L${use_lmdb}/lib"
    have_lmdb="yes"
    else
    AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
    fi
    ;;
    esac


    is naive. it ignores commonplace multiarch support.



    with =path enabled on config, generated Makefile is just wrong

    egrep "^LMDB" Makefile
    LMDB_CFLAGS = -I/usr/local/lmdb/include
    LMDB_LIBS = -L/usr/local/lmdb/lib none required



    bind advertises

    ./configure --help | grep -i LMDB
    --with-lmdb=PATH build with LMDB library [yes|no|path]

    it simply fails to work as advertised.

    you can use and adjust the .pc file from any Linux distribution package

    of course you can.

    it's here

    pkg-config --libs --cflags lmdb
    -I/usr/local/lmdb/include -L/usr/local/lmdb/lib64 -llmdb

    LMDB support in BIND 9 comes with pkg-config support too

    there's NO such option advertised by bind configure, as

    LMDB_CFLAGS
    C compiler flags for LMDB, overriding pkg-config
    LMDB_LIBS
    linker flags for LMDB, overriding pkg-config

    it's simply not used by this bind build

    grep PKG_CHECK `grep -rln PKG_CHECK .` | grep -i lmdb
    (empty)

    & no mention at all of it in source

    grep -i lmdb `grep -rlni lmdb .` | grep -i pkg
    (empty)

    this

    --with-openssl=/usr/local/openssl

    works.
    this,

    --with-lmdb=/usr/local/lmdb

    does not.

    That has _nothing_ to do with 'LMDB upstream'


    Did you came to get help or to argue?

    neither.

    It’s really not our fault the LMDB upstream decided to make it hard to use the library.

    ::facepalm::


    this

    tree /usr/local/lmdb
    /usr/local/lmdb
    ...
    ├── include
    │   └── lmdb.h
    ...
    ├── lib64
    │   ├── liblmdb.a
    │   └── liblmdb.so
    ...

    is about as simple as it gets.

    fix it, remove it, or leave it as is -- your product, your choice.

    good luck.
    --- Synchronet 3.18a-Linux NewsLink 1.113
  • From Mark Andrews@marka@isc.org to pgnet.dev on Fri Jun 19 11:55:11 2020
    From Newsgroup: comp.protocols.dns.bind

    ${LMDB_CFLAGS} is missing from make/includes.in or bin/named/Makefile.in
    diff --git a/make/includes.in b/make/includes.in
    index 9ff1bd8cf1..9eaf1d3dd5 100644
    --- a/make/includes.in
    +++ b/make/includes.in
    @@ -28,7 +28,7 @@ ISCCFG_INCLUDES = @BIND9_ISCCFG_BUILDINCLUDE@ \
    DNS_INCLUDES = @BIND9_DNS_BUILDINCLUDE@ \
    -I${top_srcdir}/lib/dns/include \
    ${FSTRM_CFLAGS} ${PROTOBUF_C_CFLAGS} \
    - ${OPENSSL_CFLAGS}
    + ${OPENSSL_CFLAGS} ${LMDB_CFLAGS}

    NS_INCLUDES = @BIND9_NS_BUILDINCLUDE@ \
    -I${top_srcdir}/lib/ns/include
    As for ‘lib64’ vs ‘lib' the complier should adjust the -L paths to match the architecture as needed usually by appending “/../lib64” to account for given path being a symbolic link.
    The pkg-config output is architecture dependent and it should be architecture independent.
    On 19 Jun 2020, at 03:25, PGNet Dev <pgnet.dev@gmail.com> wrote:

    this

    configure.ac
    AC_MSG_CHECKING(for lmdb library)
    AC_ARG_WITH(lmdb,
    AS_HELP_STRING([--with-lmdb[=PATH]],
    [build with LMDB library [yes|no|path]]),
    use_lmdb="$withval", use_lmdb="auto")

    have_lmdb=""
    case "$use_lmdb" in
    no)
    LMDB_LIBS=""
    ;;
    auto|yes)
    for d in /usr /usr/local /opt/local
    do
    if test -f "${d}/include/lmdb.h"
    then
    if test ${d} != /usr
    then
    LMDB_CFLAGS="-I ${d}/include"
    !! LMDB_LIBS="-L${d}/lib"
    fi
    have_lmdb="yes"
    fi
    done
    ;;
    *)
    if test -f "${use_lmdb}/include/lmdb.h"
    then
    LMDB_CFLAGS="-I${use_lmdb}/include"
    !! LMDB_LIBS="-L${use_lmdb}/lib"
    have_lmdb="yes"
    else
    AC_MSG_ERROR([$use_lmdb/include/lmdb.h not found.])
    fi
    ;;
    esac


    is naive. it ignores commonplace multiarch support.



    with =path enabled on config, generated Makefile is just wrong

    egrep "^LMDB" Makefile
    LMDB_CFLAGS = -I/usr/local/lmdb/include
    LMDB_LIBS = -L/usr/local/lmdb/lib none required



    bind advertises

    ./configure --help | grep -i LMDB
    --with-lmdb=PATH build with LMDB library [yes|no|path]

    it simply fails to work as advertised.

    you can use and adjust the .pc file from any Linux distribution package

    of course you can.

    it's here

    pkg-config --libs --cflags lmdb
    -I/usr/local/lmdb/include -L/usr/local/lmdb/lib64 -llmdb

    LMDB support in BIND 9 comes with pkg-config support too

    there's NO such option advertised by bind configure, as

    LMDB_CFLAGS
    C compiler flags for LMDB, overriding pkg-config
    LMDB_LIBS
    linker flags for LMDB, overriding pkg-config

    it's simply not used by this bind build

    grep PKG_CHECK `grep -rln PKG_CHECK .` | grep -i lmdb
    (empty)

    & no mention at all of it in source

    grep -i lmdb `grep -rlni lmdb .` | grep -i pkg
    (empty)

    this

    --with-openssl=/usr/local/openssl

    works.
    this,

    --with-lmdb=/usr/local/lmdb

    does not.

    That has _nothing_ to do with 'LMDB upstream'


    Did you came to get help or to argue?

    neither.

    It’s really not our fault the LMDB upstream decided to make it hard to use the library.

    ::facepalm::


    this

    tree /usr/local/lmdb
    /usr/local/lmdb
    ...
    ├── include
    │ └── lmdb.h
    ...
    ├── lib64
    │ ├── liblmdb.a
    │ └── liblmdb.so
    ...

    is about as simple as it gets.

    fix it, remove it, or leave it as is -- your product, your choice.

    good luck.
    _______________________________________________
    Please visit https://lists.isc.org/mailman/listinfo/bind-users to unsubscribe from this list

    ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.


    bind-users mailing list
    bind-users@lists.isc.org
    https://lists.isc.org/mailman/listinfo/bind-users
    --
    Mark Andrews, ISC
    1 Seymour St., Dundas Valley, NSW 2117, Australia
    PHONE: +61 2 9871 4742 INTERNET: marka@isc.org
    --- Synchronet 3.18a-Linux NewsLink 1.113
  • From PGNet Dev@pgnet.dev@gmail.com to Matt Pallissard on Thu Jun 18 22:18:19 2020
    From Newsgroup: comp.protocols.dns.bind

    but whether lmdb inclusion/usage now _functions_ correctly with that^ cleanup, i have yet to verify.
    checking now ...

    iiuc @

    https://bind9.readthedocs.io/en/latest/manpages.html
    "The configuration is saved in a file called viewname.nzf (or, if named(8) is compiled with liblmdb, an LMDB database file called viewname.nzd)."


    the 'nzd2nzf'

    system/nzd2nzf/prereq.sh
    if [ -z "$NZD" ]; then
    echo_i "This test requires LMDB support (--with-lmdb)"
    exit 255
    fi

    tests that lmdb function -- 1st to create, then convert, the .nzd. complete? dunno ...

    in any case, with that^ workaround, lmdb test looks ok

    sh run.sh nzd2nzf
    S:nzd2nzf:2020-06-18T22:10:47-0700
    T:nzd2nzf:1:A
    A:nzd2nzf:System test nzd2nzf
    I:nzd2nzf:PORTRANGE:5300 - 5399
    I:nzd2nzf:starting servers
    I:nzd2nzf:querying for non-existing zone data (1)
    I:nzd2nzf:adding a new zone into default NZD using rndc addzone (2)
    I:nzd2nzf:querying for existing zone data (3)
    I:nzd2nzf:stopping ns1
    I:nzd2nzf:dumping _default.nzd to _default.nzf (4)
    I:nzd2nzf:checking that _default.nzf contains the expected content (5)
    I:nzd2nzf:deleting _default.nzd database
    I:nzd2nzf:starting ns1 which should migrate the .nzf to .nzd
    I:nzd2nzf:querying for zone data from migrated zone config (6)
    I:nzd2nzf:exit status: 0
    I:nzd2nzf:stopping servers
    R:nzd2nzf:PASS
    E:nzd2nzf:2020-06-18T22:10:54-0700

    --- Synchronet 3.18a-Linux NewsLink 1.113