Subject: pkgsrc vs mk.conf
To: None <>
From: Quentin Garnier <>
List: tech-pkg
Date: 03/24/2005 23:58:10
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi folks,

Until a few weeks ago when I was notified of an issue building
net/netbsd-tap, I had never realised we were invoking builds with
MAKECONF=3D/dev/null in the environment.

The idea behind this is to prevent /etc/mk.conf from tampering with a
compilation supposedly completely under the control of pkgsrc.  I agree
it is something we're very likely to want.

However, the fix is not right, as it brings issue in the case of a
completely legitimate (and very system-dependent!) build of a LKM.

For a second, let's imagine we are working on some other system, let's
call it OtherBSD.  That system will be almost like NetBSD (let's say it
is a very old and obsolete version), using a make(1) which is close, and
having a very similar concept of LKMs.

However, OtherBSD is not the native plative platform of pkgsrc,
therefore we get the usual bootstrapping on it:  the pkgsrc make(1) is
bmake(1), which gets its configuration from ${PKG_SYSCONFDIR}/mk.conf,
which (let's keep the defaults) is /usr/pkg/etc/mk.conf.

Then we have this package, which is a LKM specific to OtherBSD.  As it's
a very system-dependent package, it will use OtherBSD's make(1), and
OtherBSD's make(1) configuration, possibly /etc/mk.conf.

In that example, passing MAKECONF=3D/dev/null is _very_ wrong, as pkgsrc's
settings and OtherBSD's settings simply cannot clash, the make programs
are not the same and pull in different files.

And, indeed, in NetBSD, what makes things go wrong is the fact that both
pkgsrc and the system, which are distinct, use a common configuration

Wouldn't it make much more sense for pkgsrc to have its own
configuration file, say pkgsrc.conf (or ${PKG_SYSCONFDIR}/pkgsrc.conf in
the bootstrapped case)?

Of course, there should also be a way to make sure the native make(1) is
used, because as of now, unless the package plays with definining
MAKEPROGRAM directly, bmake(1) is called, and on OtherBSD, to build a
LKM, it is likely to fail.

So, what do you guys think of making the system's make and pkgsrc's
configuration separate?  And please remember that it is _not_ a matter of
enclosing stuff in .ifdef BSD_PKG_MK.

Quentin Garnier - -
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.6 (NetBSD)