NetBSD Problem Report #44916

From www@NetBSD.org  Thu Apr 28 14:23:22 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 475FC63C434
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 28 Apr 2011 14:23:22 +0000 (UTC)
Message-Id: <20110428142321.AAFE463C433@www.NetBSD.org>
Date: Thu, 28 Apr 2011 14:23:21 +0000 (UTC)
From: matthias.rampke@googlemail.com
Reply-To: matthias.rampke@googlemail.com
To: gnats-bugs@NetBSD.org
Subject: graphics/gnuplot build failure due to missing .include ../../lang/lua/buildlink3.mk
X-Send-Pr-Version: www-1.0

>Number:         44916
>Category:       pkg
>Synopsis:       graphics/gnuplot build failure due to missing .include ../../lang/lua/buildlink3.mk
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Apr 28 14:25:00 +0000 2011
>Closed-Date:    Thu May 12 08:53:13 +0000 2011
>Last-Modified:  Thu May 12 08:53:13 +0000 2011
>Originator:     Matthias Rampke
>Release:        DragonFlyBSD HEAD
>Organization:
>Environment:
DragonFly zz.2pktfkt.net 2.11-DEVELOPMENT DragonFly v2.11.0.48.g10329-DEVELOPMENT #10: Thu Apr 28 00:52:20 CEST 2011     matthias@zz.2pktfkt.net:/usr/obj/usr/src/sys/X86_64_GENERIC_SMP  x86_64
>Description:
gnuplot fails to build because lua.h can not be found.
>How-To-Repeat:
build graphics/gnuplot
>Fix:
diff --git a/graphics/gnuplot/Makefile b/graphics/gnuplot/Makefile
index f070473..c286e3d 100644
--- a/graphics/gnuplot/Makefile
+++ b/graphics/gnuplot/Makefile
@@ -48,5 +48,6 @@ SUBST_SED.fontpath=   -e 's,@PKGSRC_PREFIX@,"${PREFIX}",'

 .include "../../devel/pango/buildlink3.mk"
 .include "../../graphics/cairo/buildlink3.mk"
+.include "../../lang/lua/buildlink3.mk"
 .include "../../graphics/plotutils/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"

>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing .include
 ../../lang/lua/buildlink3.mk
Date: Fri, 29 Apr 2011 12:33:02 +0900

 On Thu, 28 Apr 2011 23:25:00 +0900, <matthias.rampke@googlemail.com> wrote:

 >> Description:
 > gnuplot fails to build because lua.h can not be found.
 >> How-To-Repeat:
 > build graphics/gnuplot

 I cannot reproduce this issue.
 Do you already have lua from pkgsrc? or DragonFly-2.11 have builtin lua?

 Could you find why lua is detected on your environment?
 (config.log, below "checking for LUA").
 With pkg-config and -llua detection, both should be failed.

 Frankly, adding
 CONFIGURE_ARGS+= --without-lua
 will avoid the issue though.

 -- 
 OBATA Akio / obache@NetBSD.org

From: Matthias Rampke <matthias.rampke@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Fri, 29 Apr 2011 10:37:07 +0200

 --4dba78b3_41a7c4c9_15af6
 Content-Type: text/plain; charset="utf-8"
 Content-Transfer-Encoding: 8bit
 Content-Disposition: inline

 Do you already have lua from pkgsrc?
 Yes, it was installed as a dependency of something else. 
 >  or DragonFly-2.11 have builtin lua?
 No. 
 > 
 >  Could you find why lua is detected on your environment?
 >  (config.log, below "checking for LUA").
 >  With pkg-config and -llua detection, both should be failed.
 pkg-config fails, but -llua is detected (because it's there, obviously). This apparently triggers the lua/TikZ terminal being built.

 On the other hand, lua.h is not found (I don't really understand why, it's at /usr/pkg/include/lua.h and /usr/pkg/include is in the -I paths.)

 see the full config.log here:
 http://pastebin.com/UDWHzwzH

 config.h has:

 /* Define if you want the lua/TikZ terminal. */
 #define HAVE_LUA 1

 /* Define to 1 if you have the <lua.h> header file. */
 /* #undef HAVE_LUA_H */


 so it tries to build the lua/TikZ terminal and fails.
 > 
 >  Frankly, adding
 >  CONFIGURE_ARGS+= --without-lua
 >  will avoid the issue though.
 I can confirm that this fixes the problem. How about a lua option? This way the lua/TikZ terminal is either in or out and we don't depend on whatever the configure script may or may not find on the system. I have attached a patch.

 Regards,
 M.



 --4dba78b3_41a7c4c9_15af6
 Content-Type: application/octet-stream
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment; filename="gnuplot-lua.patch"

 ZGlmZiAtLWdpdCBhL2dyYXBoaWNzL2dudXBsb3Qvb3B0aW9ucy5tayBiL2dyYXBoaWNzL2dudXBs
 b3Qvb3B0aW9ucy5tawppbmRleCBmYzYwYTcyLi43Njk3ZGUyIDEwMDY0NAotLS0gYS9ncmFwaGlj
 cy9nbnVwbG90L29wdGlvbnMubWsKKysrIGIvZ3JhcGhpY3MvZ251cGxvdC9vcHRpb25zLm1rCkBA
 IC0xLDcgKzEsNyBAQAogIyAkTmV0QlNEOiBvcHRpb25zLm1rLHYgMS4yIDIwMTEvMDIvMDggMTM6
 MTM6NDEgYWRhbSBFeHAgJAogCiBQS0dfT1BUSU9OU19WQVI9CVBLR19PUFRJT05TLmdudXBsb3QK
 LVBLR19TVVBQT1JURURfT1BUSU9OUz0JZ2QgcGRmIHgxMQorUEtHX1NVUFBPUlRFRF9PUFRJT05T
 PQlnZCBsdWEgcGRmIHgxMQogUEtHX1NVR0dFU1RFRF9PUFRJT05TPQlnZCB4MTEKIAogLmluY2x1
 ZGUgIi4uLy4uL21rL2JzZC5vcHRpb25zLm1rIgpAQCAtMTIsNiArMTIsMTIgQEAgUExJU1RfVkFS
 Uys9CXgxMQogLmluY2x1ZGUgIi4uLy4uL2dyYXBoaWNzL2dkL2J1aWxkbGluazMubWsiCiAuZW5k
 aWYKIAorLmlmICFlbXB0eShQS0dfT1BUSU9OUzpNbHVhKQorLmluY2x1ZGUgIi4uLy4uL2xhbmcv
 bHVhL2J1aWxkbGluazMubWsiCisuZWxzZQorQ09ORklHVVJFX0FSR1MrPQktLXdpdGhvdXQtbHVh
 CisuZW5kaWYKKwogIyBQREYgb3V0cHV0IGlzIGFsc28gcHJvdmlkZWQgYnkgY2Fpcm8KIC5pZiAh
 ZW1wdHkoUEtHX09QVElPTlM6TXBkZikKIENPTkZJR1VSRV9BUkdTKz0JLS13aXRoLXBkZgo=

 --4dba78b3_41a7c4c9_15af6--

From: Matthias Rampke <matthias.rampke@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Fri, 29 Apr 2011 10:48:59 +0200

 Oh gnats, why can't you handle attachments? Here's the patch again: 

 diff --git a/graphics/gnuplot/options.mk b/graphics/gnuplot/options.mk
 index fc60a72..7697de2 100644
 --- a/graphics/gnuplot/options.mk
 +++ b/graphics/gnuplot/options.mk
 @@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.2 2011/02/08 13:13:41 adam Exp $

 PKG_OPTIONS_VAR= PKG_OPTIONS.gnuplot
 -PKG_SUPPORTED_OPTIONS= gd pdf x11
 +PKG_SUPPORTED_OPTIONS= gd lua pdf x11
 PKG_SUGGESTED_OPTIONS= gd x11

 .include "../../mk/bsd.options.mk"
 @@ -12,6 +12,12 @@ PLIST_VARS+= x11
 .include "../../graphics/gd/buildlink3.mk"
 .endif

 +.if !empty(PKG_OPTIONS:Mlua)
 +.include "../../lang/lua/buildlink3.mk"
 +.else
 +CONFIGURE_ARGS+= --without-lua
 +.endif
 +
 # PDF output is also provided by cairo
 .if !empty(PKG_OPTIONS:Mpdf)
 CONFIGURE_ARGS+= --with-pdf



From: Matthias Rampke <matthias.rampke@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Fri, 29 Apr 2011 11:04:23 +0200

 Oh gnats, why can't you handle attachments? Here's the patch again: 

 diff --git a/graphics/gnuplot/options.mk b/graphics/gnuplot/options.mk
 index fc60a72..7697de2 100644
 --- a/graphics/gnuplot/options.mk
 +++ b/graphics/gnuplot/options.mk
 @@ -1,7 +1,7 @@
 # $NetBSD: options.mk,v 1.2 2011/02/08 13:13:41 adam Exp $

 PKG_OPTIONS_VAR= PKG_OPTIONS.gnuplot
 -PKG_SUPPORTED_OPTIONS= gd pdf x11
 +PKG_SUPPORTED_OPTIONS= gd lua pdf x11
 PKG_SUGGESTED_OPTIONS= gd x11

 .include "../../mk/bsd.options.mk"
 @@ -12,6 +12,12 @@ PLIST_VARS+= x11
 .include "../../graphics/gd/buildlink3.mk"
 .endif

 +.if !empty(PKG_OPTIONS:Mlua)
 +.include "../../lang/lua/buildlink3.mk"
 +.else
 +CONFIGURE_ARGS+= --without-lua
 +.endif
 +
 # PDF output is also provided by cairo
 .if !empty(PKG_OPTIONS:Mpdf)
 CONFIGURE_ARGS+= --with-pdf


From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing .include
 ../../lang/lua/buildlink3.mk
Date: Fri, 29 Apr 2011 20:05:12 +0900

 On Fri, 29 Apr 2011 17:40:10 +0900, Matthias Rampke <matthias.rampke@googlemail.com> wrote:

 >  pkg-config fails, but -llua is detected (because it's there, obviously). This apparently triggers the lua/TikZ terminal being built.
 > On the other hand, lua.h is not found (I don't really understand why, it's at /usr/pkg/include/lua.h and /usr/pkg/include is in the -I paths.)

 It is because pkgsrc wrapper hide those headers unless it is buildlinked.
 -llua also should be hidden.

 Could you provide ${WRKDIR}/.work.log after `make configure'?

 -- 
 OBATA Akio / obache@NetBSD.org

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44916 CVS commit: pkgsrc/graphics/gnuplot
Date: Fri, 29 Apr 2011 11:41:08 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Fri Apr 29 11:41:08 UTC 2011

 Modified Files:
 	pkgsrc/graphics/gnuplot: options.mk

 Log Message:
 Let lua support optionify, and exactly control it (disabled by default).
 PR#44916.


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 pkgsrc/graphics/gnuplot/options.mk

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

From: Matthias Rampke <matthias.rampke@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Fri, 29 Apr 2011 16:42:21 +0200

 Could you provide ${WRKDIR}/.work.log after `make configure'?
 Here it is: http://pastebin.com/asAeUcvk

 m. 

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing .include
 ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 11:50:23 +0900

 On Fri, 29 Apr 2011 23:45:02 +0900, Matthias Rampke <matthias.rampke@googlemail.com> wrote:

 >  Here it is: http://pastebin.com/asAeUcvk

 line 374 is the command trying to link with -llua with wrapper.

 <.> /usr/pkgobj/bootstrap/work/pkgsrc/graphics/gnuplot/work/.gcc/bin/gcc -o conftest -I/usr/pkgobj/bootstrap/work/pkgsrc/graphics/gnuplot/work/.buildlink/include -I/usr/pkgobj/bootstrap/work/pkgsrc/graphics/gnuplot/work/.buildlink/include/freetype2 -L/usr/pkgobj/bootstrap/work/pkgsrc/graphics/gnuplot/work/.buildlink/lib -Wl,-R/usr/pkg/lib -pthread conftest.c  -llua -lm

 Any of -L does not point to /usr/pkg/lib.
 It succeed for you, but should be failed unless liblua is in system default library path.

 -- 
 OBATA Akio / obache@NetBSD.org

From: Matthias Rampke <matthias.rampke@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 13:19:54 +0200

 It succeed for you, but should be failed unless liblua is in system default library path.
 On DragonFly, /usr/pkg/lib is part of the default library path: 

 /etc/defaults/rc.conf: ldconfig_paths="/usr/lib /usr/lib/gcc* /usr/lib/compat /usr/pkg/lib /usr/local/lib"


 That explains it then.

 Regards, M. 

From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing .include
 ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 21:05:54 +0900

 On Sat, 30 Apr 2011 20:20:04 +0900, Matthias Rampke <matthias.rampke@googlemail.com> wrote:

 >  On DragonFly, /usr/pkg/lib is part of the default library path:
 > /etc/defaults/rc.conf: ldconfig_paths="/usr/lib /usr/lib/gcc* /usr/lib/compat /usr/pkg/lib /usr/local/lib"
 > That explains it then.

 I feel that ldconfig should only affect to run-time shard library search.

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 17:50:28 +0000

 On Sat, Apr 30, 2011 at 12:10:07PM +0000, OBATA Akio wrote:
  >  >  On DragonFly, /usr/pkg/lib is part of the default library path:
  >  > /etc/defaults/rc.conf: ldconfig_paths="/usr/lib /usr/lib/gcc* /usr/lib/compat /usr/pkg/lib /usr/local/lib"
  >  > That explains it then.
  >  
  >  I feel that ldconfig should only affect to run-time shard library search.

 However, the run-time and link-time linker search paths are probably
 the same (and should be, as having it otherwise makes things horribly
 confusing...)

 Should pkgsrc take additional wrapper precautions on dragonfly because
 of this? Or should we ask dragonfly to change it?

 -- 
 David A. Holland
 dholland@netbsd.org

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 18:19:17 +0000

 On Sat, Apr 30, 2011 at 05:55:02PM +0000, David Holland wrote:
  >  However, the run-time and link-time linker search paths are probably
  >  the same (and should be, as having it otherwise makes things horribly
  >  confusing...)
  >  
  >  Should pkgsrc take additional wrapper precautions on dragonfly because
  >  of this? Or should we ask dragonfly to change it?

 oh and also, did the commit fix the original problem?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 23:20:32 +0200

 On Sat, Apr 30, 2011 at 05:55:02PM +0000, David Holland wrote:
 >  Should pkgsrc take additional wrapper precautions on dragonfly because
 >  of this? Or should we ask dragonfly to change it?

 There isn't really anything we can do. Give someone enough rope...
 IIRC someone (TM) decided to be smart and make it easier to build stuff
 by hand without having to properly use RPATH. Misguided, but resulting
 in the obvious fallout.

 Joerg

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: pkg-manager@netbsd.org, gnats-admin@netbsd.org, pkgsrc-bugs@netbsd.org,
	matthias.rampke@googlemail.com
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing
 .include ../../lang/lua/buildlink3.mk
Date: Sat, 30 Apr 2011 21:50:03 +0000

 On Sat, Apr 30, 2011 at 09:25:01PM +0000, Joerg Sonnenberger wrote:
  >>  Should pkgsrc take additional wrapper precautions on dragonfly because
  >>  of this? Or should we ask dragonfly to change it?
  >  
  >  There isn't really anything we can do.

 Sure, we could have the wrappers add the link equivalent of -I-,
 assuming there is one, then -L/usr/lib. Or teach DF's linker to
 understand -L-/usr/pkg/lib or something

  >  Give someone enough rope...
  >  IIRC someone (TM) decided to be smart and make it easier to build stuff
  >  by hand without having to properly use RPATH. Misguided, but resulting
  >  in the obvious fallout.

 It's far from clear that it's misguided or that rpaths are anything
 but a design bug in ELF; however, because pkgsrc is organized to do
 things a certain way, we don't want /usr/pkg/lib on the default link
 path when building from inside pkgsrc, so that question is entirely
 moot.

 The issue at hand is really whether pkgsrc should/can be adapted to
 the platform or not.

 -- 
 David A. Holland
 dholland@netbsd.org

From: Matthias Rampke <matthias.rampke@googlemail.com>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/44916: graphics/gnuplot build failure due to missing .include ../../lang/lua/buildlink3.mk
Date: Wed, 11 May 2011 11:12:55 +0200

 Sorry for the late reply, I'm having trouble mailing to @netbsd.org
 (so I hope this gets through ...)

 The commit fixed the problem for gnuplot, but I've ran across it again
 (PR pkg/44945, solved similarly) and assume more people will do so in
 the future.

 I've opened a new PR to discuss this issue in general, because it
 doesn't just concern gnuplot and the optimal solution is not clear,
 see PR pkg/44953 [1].


 [1] http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44953

State-Changed-From-To: open->closed
State-Changed-By: wiz@NetBSD.org
State-Changed-When: Thu, 12 May 2011 08:53:13 +0000
State-Changed-Why:
This problem is fixed, general problem in different PR.


>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.