Subject: pkgsrc vs mk.conf
To: None <tech-pkg@netbsd.org>
From: Quentin Garnier <cube@cubidou.net>
List: tech-pkg
Date: 03/24/2005 23:58:10
--BEa57a89OpeoUzGD
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
file.

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.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"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.

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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBQkNGAtgoQloHrPnoAQKcuQf/Qm3/rADpJX3Mrhhpr55OMKzEgUtqjX5A
d/QvqNE8FZaoFiu2wRQMU8VqLkb6yyBqwy3IiVvc+YdI/XS5tHRz3C/9ridTQckb
194ZnXrPJyBl2xz63xHTS/l+KL0v774j/UBTTHkxtZJqJ2j9e5ued6AR9czjrpvv
LV6bNgf2iI21P76WDou+nxjZowusYCjq0cTn7rT8duTi8ZNuWgcRmDIAJ3k/YGXa
T33u+h/AEseGj/i+TG5qMcixjB1pD2xlMoSHfxEhaOoDsZfNrUxz7pgYSh8WDWI3
ieei3Y4HT0KOAnEeoJCWsHdK94IizV9aQ11NWuUYwulZPT8lTUDh4w==
=p25+
-----END PGP SIGNATURE-----

--BEa57a89OpeoUzGD--