NetBSD Problem Report #52624

From www@NetBSD.org  Mon Oct 16 03:01:53 2017
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 11CA87A17F
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 16 Oct 2017 03:01:53 +0000 (UTC)
Message-Id: <20171016030152.302577A2A6@mollari.NetBSD.org>
Date: Mon, 16 Oct 2017 03:01:52 +0000 (UTC)
From: patrick.mackey@vodafone.com
Reply-To: patrick.mackey@vodafone.com
To: gnats-bugs@NetBSD.org
Subject: Can't compile net/nmap from pkgsrc with lua support
X-Send-Pr-Version: www-1.0

>Number:         52624
>Category:       pkg
>Synopsis:       Can't compile net/nmap from pkgsrc with lua support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    leot
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 16 03:05:00 +0000 2017
>Closed-Date:    Thu Oct 19 21:49:02 +0000 2017
>Last-Modified:  Tue Oct 31 16:25:00 +0000 2017
>Originator:     Patrick Mackey
>Release:        7.1
>Organization:
Vodafone NZ
>Environment:
NetBSD vdosrv 7.1 NetBSD 7.1 (GENERIC.201703111743Z) amd64

>Description:
I'm trying to build net/nmap with lua scripting support by setting "PKG_OPTIONS.nmap = inet6 lua" in /etc/mk.conf

I have lua52-5.2.4nb1 installed



I'm getting the following error:
###############################
gmake[1]: Entering directory '/storage/obj/net/nmap/work/nmap-7.60/liblua'
gcc -O2 -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include/lua-5.2 -I/usr/include -I/usr/pkg/include -Wall   -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I/usr/pkg/include -I./liblua -I/usr/pkg/include -I./libdnet-stripped/include -I./libssh2/include -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/lua-5.2 -I/usr/include -I/usr/pkg/include -I/usr/include -I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\" -DNMAP_URL=\"https://nmap.org\" -DNMAP_PLATFORM=\"x86_64--netbsd\" -DNMAPDATADIR=\"/usr/pkg/share/nmap\" -D_FORTIFY_SOURCE=2  -c -o lapi.o lapi.c
In file included from lua.h:16:0,
                 from lapi.c:16:
luaconf.h:566:2: error: #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS'   or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
 #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
  ^
In file included from lapi.c:16:0:
lua.h:93:1: error: unknown type name 'LUA_INTEGER'
 typedef LUA_INTEGER lua_Integer;
 ^
lua.h:96:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'lua_Unsigned'
 typedef LUA_UNSIGNED lua_Unsigned;
                      ^
In file included from lapi.h:11:0,
                 from lapi.c:18:
llimits.h:80:1: error: unknown type name 'LUA_INTEGER'
 typedef LUAI_UACINT l_uacInt;
 ^
gmake[1]: *** [<builtin>: lapi.o] Error 1
gmake[1]: Leaving directory '/storage/obj/net/nmap/work/nmap-7.60/liblua'
gmake: *** [Makefile:165: build-lua] Error 2
*** Error code 2

Stop.
make[2]: stopped in /cvsroot/pkgsrc/net/nmap
*** Error code 1

Stop.
make[1]: stopped in /cvsroot/pkgsrc/net/nmap
*** Error code 1

Stop.
make: stopped in /cvsroot/pkgsrc/net/nmap


###############################



>How-To-Repeat:
from pkgsrc current.

pkgsrc/net/nmap
make PKG_OPTIONS="inet6 lua"


>Fix:
Setting -DLUA_C89_NUMBERS seems to fix the compile issues and nmap scripting works as expected.

>Release-Note:

>Audit-Trail:
From: Aleksey Arens <tarik@sectopod.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52624
Date: Wed, 18 Oct 2017 13:39:03 -0700

 Good day.

 There exists a simple solution to the problem mentioned by the original
 reporter.  Since it appears that a C99 feature is expected, then we
 could change the USE_LANGUAGES option to use "c99" instead of "c".  The
 following patch implements a fix, which builds correctly on a machine
 running pkgsrc-2017Q2 on netbsd-7.1-RELEASE.  The value of options
 variable was set as follows during the build:

 PKG_OPTIONS.nmap=inet6 lua ndiff


 -----8<----------8<----------8<----------8<----------8<----------8<-----

 Index: Makefile
 ===================================================================
 RCS file: /cvsroot/pkgsrc/net/nmap/Makefile,v
 retrieving revision 1.135
 diff -r1.135 Makefile
 17c17
 < USE_LANGUAGES=                c c++
 ---
 > USE_LANGUAGES=		c99 c++

From: Thomas Klausner <wiz@NetBSD.org>
To: NetBSD bugtracking <gnats-bugs@NetBSD.org>
Cc: 
Subject: Re: pkg/52624: Can't compile net/nmap from pkgsrc with lua support
Date: Wed, 18 Oct 2017 22:42:43 +0200

 On Mon, Oct 16, 2017 at 03:05:00AM +0000, patrick.mackey@vodafone.com wrote:
 > >Number:         52624
 > >Category:       pkg
 > >Synopsis:       Can't compile net/nmap from pkgsrc with lua support
 > >Confidential:   no
 > >Severity:       non-critical
 > >Priority:       low
 > >Responsible:    pkg-manager
 > >State:          open
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Mon Oct 16 03:05:00 +0000 2017
 > >Originator:     Patrick Mackey
 > >Release:        7.1
 > >Organization:
 > Vodafone NZ
 > >Environment:
 > NetBSD vdosrv 7.1 NetBSD 7.1 (GENERIC.201703111743Z) amd64
 > 
 > >Description:
 > I'm trying to build net/nmap with lua scripting support by setting "PKG_OPTIONS.nmap = inet6 lua" in /etc/mk.conf
 > 
 > I have lua52-5.2.4nb1 installed
 > 
 > 
 > 
 > I'm getting the following error:
 > ###############################
 > gmake[1]: Entering directory '/storage/obj/net/nmap/work/nmap-7.60/liblua'
 > gcc -O2 -Wall -Wextra -DLUA_COMPAT_5_2  -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include/lua-5.2 -I/usr/include -I/usr/pkg/include -Wall   -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I/usr/pkg/include -I./liblua -I/usr/pkg/include -I./libdnet-stripped/include -I./libssh2/include -I/usr/pkg/include -I/usr/include -I/usr/pkg/include/lua-5.2 -I/usr/include -I/usr/pkg/include -I/usr/include -I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\" -DNMAP_URL=\"https://nmap.org\" -DNMAP_PLATFORM=\"x86_64--netbsd\" -DNMAPDATADIR=\"/usr/pkg/share/nmap\" -D_FORTIFY_SOURCE=2  -c -o lapi.o lapi.c
 > In file included from lua.h:16:0,
 >                  from lapi.c:16:
 > luaconf.h:566:2: error: #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS'   or '-DLUA_C89_NUMBERS' (see file 'luaconf.h' for details)"
 >  #error "Compiler does not support 'long long'. Use option '-DLUA_32BITS' \
 >   ^

 This looks like it's building the included copy of lua. It should use
 the installed one. Can you find out why it doesn't?
  Thomas

Responsible-Changed-From-To: pkg-manager->leot
Responsible-Changed-By: leot@NetBSD.org
Responsible-Changed-When: Thu, 19 Oct 2017 09:49:32 +0000
Responsible-Changed-Why:
I have some hypothesis on what's going wrong here.
Take the PR, an analysis and a candidate patch will be shared soon, hopefully!


From: Leonardo Taccari <leot@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/52624: Can't compile net/nmap from pkgsrc with lua support
Date: Thu, 19 Oct 2017 12:27:45 +0200

 Hello Patrick, Thomas and pkgsrc-bugs@ readers,

 Thomas Klausner writes:
 > This looks like it's building the included copy of lua. It should use
 > the installed one. Can you find out why it doesn't?

 Good observation!

 TLDR: setting LUA_VERSIONS_ACCEPTED to 53 should fix this problem,
 candidate patch here:

  https://NetBSD.org/~leot/pkgsrc-patches/nmap-use-pkgsrc-lua53-fix.patch

 Patrick, can you please apply it and let us known if it fixes the
 problem you're seeing?


 OK, here the long version (if you're interested)!

 If I'm not missing something if `LUA_VERSION_DEFAULT !=3D 53' (by default
 pkgsrc prefers Lua 5.2) nmap silently just use its internal Lua.
 To quickly checks that:

  % nm `which nmap`

 should reveal a `T lua_isyieldable' line (without the candidate patch
 not applied and with pkgsrc's LUA_VERSION_DEFAULT !=3D 53).

 This happened because in nmap configure.ac lua_isyieldable() is
 esplicitly checked:

    826    # If they didn't specify it, we try to find it
    827    if test $have_lua !=3D yes; then
    828      AC_CHECK_HEADERS([lua5.3/lua.h lua/5.3/lua.h lua.h lua/lua.h],
    829        AC_CHECK_LIB(lua5.3, lua_isyieldable, [have_lua=3Dyes; LIBLU=
 A_LIBS=3D"-llua5.3"; CPPFLAGS=3D"-I/usr/include/lua5.3 $CPPFLAGS"; break],=
 , [-lm])
    830        AC_CHECK_LIB(lua53, lua_isyieldable, [have_lua=3Dyes; LIBLUA=
 _LIBS=3D"-llua53"; CPPFLAGS=3D"-I/usr/include/lua53 $CPPFLAGS"; break],, [=
 -lm])
    831        AC_CHECK_LIB(lua, lua_isyieldable, [have_lua=3Dyes; LIBLUA_L=
 IBS=3D"-llua"; CPPFLAGS=3D"-I/usr/include/lua $CPPFLAGS"; break],, [-lm])
    832      )

 ...but if this test fail (for Lua 5.1 and 5.2) `have_lua' variable isn't
 set to `yes' and few lines later - due that - the internal version is
 used.

 Just setting LUA_VERSIONS_ACCEPTED to 53 in net/nmap/options.mk
 should fix this problem (a side-note, configure.ac:835 contains a
 `# We need Lua 5.2 exactly' comment but in reality the LUA_VERSION_NUM
 checked is 503, hence Lua 5.3).

 The following patch should address that:

  https://NetBSD.org/~leot/pkgsrc-patches/nmap-use-pkgsrc-lua53-fix.patch

 or, for completeness at the end of this email a version of it inline
 (without a candidate commit message).

 Patrick, can you please try that patch and let us know if it fixes the
 issue?


 Thank you!


 -------------------8<-------------------8<---------------------
 Index: Makefile
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/pkgsrc/net/nmap/Makefile,v
 retrieving revision 1.136
 diff -u -p -r1.136 Makefile
 --- Makefile	3 Aug 2017 13:52:00 -0000	1.136
 +++ Makefile	19 Oct 2017 09:56:43 -0000
 @@ -1,6 +1,7 @@
  # $NetBSD: Makefile,v 1.136 2017/08/03 13:52:00 adam Exp $
  =

  DISTNAME=3D	nmap-7.60
 +PKGREVISION=3D	1
  CATEGORIES=3D	net security
  MASTER_SITES=3D	http://nmap.org/dist/
  EXTRACT_SUFX=3D	.tar.bz2
 Index: options.mk
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/pkgsrc/net/nmap/options.mk,v
 retrieving revision 1.18
 diff -u -p -r1.18 options.mk
 --- options.mk	1 Jan 2017 14:43:50 -0000	1.18
 +++ options.mk	19 Oct 2017 09:56:43 -0000
 @@ -37,6 +37,7 @@ CONFIGURE_ARGS+=3D	--without-zenmap
  .endif
  =

  .if !empty(PKG_OPTIONS:Mlua)
 +LUA_VERSIONS_ACCEPTED=3D	53	# needs lua_isyieldable, introduced in Lua 5.=
 3
  .include "../../lang/lua/buildlink3.mk"
  CONFIGURE_ARGS+=3D	--with-liblua=3D${BUILDLINK_PREFIX.lua}
  PLIST.lua=3D		yes

State-Changed-From-To: open->feedback
State-Changed-By: leot@NetBSD.org
State-Changed-When: Thu, 19 Oct 2017 10:50:03 +0000
State-Changed-Why:
Problem analyzed, possible patch shared and feedback requested.


From: "Mackey, Patrick, Vodafone NZ" <Patrick.MACKEY@vodafone.com>
To: "gnats-bugs@NetBSD.org" <gnats-bugs@NetBSD.org>, "gnats-admin@netbsd.org"
	<gnats-admin@netbsd.org>, "pkgsrc-bugs@netbsd.org" <pkgsrc-bugs@netbsd.org>
Cc: 
Subject: RE: pkg/52624: Can't compile net/nmap from pkgsrc with lua support
Date: Fri, 20 Oct 2017 08:49:42 +1300

 Hi, Leonardo.

 > The following patch should address that:
 >  https://NetBSD.org/~leot/pkgsrc-patches/nmap-use-pkgsrc-lua53-fix.patch

 > Patrick, can you please try that patch and let us know if it fixes the  i=
 ssue?

 I've applied the patch and it works as advertised.

 Cheers!

From: "Leonardo Taccari" <leot@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52624 CVS commit: pkgsrc/net/nmap
Date: Thu, 19 Oct 2017 21:43:26 +0000

 Module Name:	pkgsrc
 Committed By:	leot
 Date:		Thu Oct 19 21:43:25 UTC 2017

 Modified Files:
 	pkgsrc/net/nmap: Makefile options.mk

 Log Message:
 nmap: set LUA_VERSIONS_ACCEPTED to avoid using internal Lua provided by nmap

 Without that change the nmap configure script checks for `lua_isyield'
 symbol (appeared on Lua 5.3), and for LUA_VERSION_DEFAULT != 53
 (pkgsrc by default set LUA_VERSION_DEFAULT to 52) it will just
 silently use its internal version.

 Set LUA_VERSIONS_ACCEPTED to 53 to avoid that.

 Fix PR pkg/52624 reported by Patrick Mackey.

 Bump PKGREVISION.


 To generate a diff of this commit:
 cvs rdiff -u -r1.136 -r1.137 pkgsrc/net/nmap/Makefile
 cvs rdiff -u -r1.18 -r1.19 pkgsrc/net/nmap/options.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: leot@NetBSD.org
State-Changed-When: Thu, 19 Oct 2017 21:49:02 +0000
State-Changed-Why:
Feedback provided and patch committed.

Thank you Patrick for the PR and for the feedback!


From: "S.P.Zeidler" <spz@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52624 CVS commit: [pkgsrc-2017Q3] pkgsrc/net/nmap
Date: Tue, 31 Oct 2017 16:22:47 +0000

 Module Name:	pkgsrc
 Committed By:	spz
 Date:		Tue Oct 31 16:22:47 UTC 2017

 Modified Files:
 	pkgsrc/net/nmap [pkgsrc-2017Q3]: Makefile options.mk

 Log Message:
 Pullup ticket #5604 - requested by sevan
 net/nmap: build fix for nmap with Lua option

 Revisions pulled up:
 - net/nmap/Makefile                                             1.137
 - net/nmap/options.mk                                           1.19

 -------------------------------------------------------------------
    Module Name:    pkgsrc
    Committed By:   leot
    Date:           Thu Oct 19 21:43:25 UTC 2017

    Modified Files:
            pkgsrc/net/nmap: Makefile options.mk

    Log Message:
    nmap: set LUA_VERSIONS_ACCEPTED to avoid using internal Lua provided by nmap

    Without that change the nmap configure script checks for `lua_isyield'
    symbol (appeared on Lua 5.3), and for LUA_VERSION_DEFAULT != 53
    (pkgsrc by default set LUA_VERSION_DEFAULT to 52) it will just
    silently use its internal version.

    Set LUA_VERSIONS_ACCEPTED to 53 to avoid that.

    Fix PR pkg/52624 reported by Patrick Mackey.

    Bump PKGREVISION.

    To generate a diff of this commit:
    cvs rdiff -u -r1.136 -r1.137 pkgsrc/net/nmap/Makefile
    cvs rdiff -u -r1.18 -r1.19 pkgsrc/net/nmap/options.mk


 To generate a diff of this commit:
 cvs rdiff -u -r1.136 -r1.136.4.1 pkgsrc/net/nmap/Makefile
 cvs rdiff -u -r1.18 -r1.18.8.1 pkgsrc/net/nmap/options.mk

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.