NetBSD Problem Report #50826

From paul@whooppee.com  Thu Feb 18 07:29:27 2016
Return-Path: <paul@whooppee.com>
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 "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 090587ACB8
	for <gnats-bugs@gnats.NetBSD.org>; Thu, 18 Feb 2016 07:29:27 +0000 (UTC)
Message-Id: <20160218072918.3D91816E98@pokey.whooppee.com>
Date: Thu, 18 Feb 2016 15:29:18 +0800 (PHT)
From: paul@whooppee.com
Reply-To: paul@whooppee.com
To: gnats-bugs@NetBSD.org
Subject: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor /etc/mk.conf
X-Send-Pr-Version: 3.95

>Number:         50826
>Category:       pkg
>Synopsis:       pkgsrc USE_BSD_MAKEFILE doesn't seem to honor /etc/mk.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Feb 18 07:30:00 +0000 2016
>Last-Modified:  Tue Mar 01 02:05:00 +0000 2016
>Originator:     Paul Goyette
>Release:        NetBSD 7.99.26
>Organization:
+------------------+--------------------------+------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
+------------------+--------------------------+------------------------+
>Environment:


System: NetBSD pokey.whooppee.com 7.99.26 NetBSD 7.99.26 (POKEY 2016-02-16 03:01:55) #0: Tue Feb 16 12:33:45 PHT 2016 paul@pokey.whooppee.com:/build/netbsd-local/obj/amd64/sys/arch/amd64/compile/POKEY amd64
Architecture: x86_64
Machine: amd64
>Description:
	Ever since MKCTF and MKDTRACE were made default on amd64, the
	/usr/share/mk/ system assumes that ctf tools are available,
	unless MKCTF is set to "no".  For normal user builds, it is
	sufficient to add MKCTF=no to /etc/mk.conf 

	However, this seems to have no effect when building a pkgsrc
	package that uses USE_BSD_MAKEFILE.  Of the more than 400
	packages that I regularly build, the only one I have that uses
	USE_BSD_MAKEFILE is devel/tradcpp.  Building this package on a
	system that does not have the CTF tools results in an error
	similar to

	--- files.o ---
	ctfconvert -g -L VERSION files.o
	ctfconvert: not found
	*** [files.o] Error code 127

	This same error occurs whether or not MKCTF=no is set in
	/etc/mk.conf

	It _is_ possible to work around this by defining MKCTF=no in
	the environment prior to invoking make.

>How-To-Repeat:
	1. Build, install, and boot a -current system that does NOT
	   include MKDTRACE and MKCTF (alternatively, delete the ctf*
	   tools from an otherwise GENERIC system).
	2. Get pkgsrc
	3. Try to build the devel/tradcpp package - observe error
	4. Add MKCTF=np in /etc/mk.conf and try again - observe same error

>Fix:
	Unknown.  I'm guessing that, for pkgsrc, CTFCONVERT is being set
	early, prior to reading /etc/mk.conf, so there's probably some
	sort of sequencing issue or race condition.


>Audit-Trail:
From: Martin Husemann <martin@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: christos@NetBSD.org
Subject: Re: pkg/50826: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor
 /etc/mk.conf
Date: Fri, 19 Feb 2016 08:31:11 +0000

 FWIW, I consider this a bug in the NetBSD base system mk files.

 Martin

From: christos@zoulas.com (Christos Zoulas)
To: Martin Husemann <martin@NetBSD.org>, gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50826: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor /etc/mk.conf
Date: Fri, 19 Feb 2016 07:00:10 -0500

 On Feb 19,  8:31am, martin@NetBSD.org (Martin Husemann) wrote:
 -- Subject: Re: pkg/50826: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor /etc

 | FWIW, I consider this a bug in the NetBSD base system mk files.

 How so?

 christos

From: Martin Husemann <martin@duskware.de>
To: Christos Zoulas <christos@zoulas.com>
Cc: Martin Husemann <martin@NetBSD.org>, gnats-bugs@NetBSD.org
Subject: Re: pkg/50826: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor /etc/mk.conf
Date: Fri, 19 Feb 2016 14:16:34 +0100

 On Fri, Feb 19, 2016 at 07:00:10AM -0500, Christos Zoulas wrote:
 > On Feb 19,  8:31am, martin@NetBSD.org (Martin Husemann) wrote:
 > -- Subject: Re: pkg/50826: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor /etc
 > 
 > | FWIW, I consider this a bug in the NetBSD base system mk files.
 > 
 > How so?

 Twofold: nothing should have to care about MKCTF outside of our own
 build infrastructure, and also having MKCTF=no on the make command line
 or in the environment behave differently than MKCTF=no in /etc/mk.conf
 sounds bad.

 Now I haven't checked if pkgsrc does something stupid to trigger this,
 so we should probably analyze completely before blameing ;-)

 Martin

From: Paul Goyette <paul@whooppee.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/50826: pkgsrc USE_BSD_MAKEFILE doesn't seem to honor
 /etc/mk.conf
Date: Tue, 1 Mar 2016 10:00:57 +0800 (PHT)

 Another example where /etc/mk.conf is not being honored is mail/dspam

 You can set DSPAM_STORAGE_DRIVER in your environment and it "does the 
 right thing" but if you set the variable in your /etc/mk.conf it gets 
 ignored (and the default "hash" driver is built).


 This bug seems not to be specific to USE_BSD_MAKEFILE but instead is 
 caused by the order in which system *.mk files are included.


 +------------------+--------------------------+------------------------+
 | Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:      |
 | (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com   |
 | Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org |
 +------------------+--------------------------+------------------------+

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.