working on a better method to build FreeBSD base packages.
-
working on a better method to build FreeBSD base packages. now every package has its own subdirectory, e.g. src/packages/cron, with a normal Makefile using the new bsd.pkg.mk:
WORLDPACKAGE= cron
SUBPACKAGES= dbgUCLSRC= common.ucl
.include <bsd.pkg.mk>
common.ucl (or whatever you call it) replaces the old UCL files in release/packages/ucl/, and if needed, you can do something like "URLSRC.dbg=dbg.ucl" to use a subpackage-specific UCL.
src/packages/Makefile builds all of these using bsd.subdir.mk, so everything is automatically parallelised and works much more like how we build the rest of the system. (if you want to see something fun, have a look at how Makefile.inc1 does this right now using ${_PKGS}...)
all the *.pkg files are created in <objdir>/packages/<package>/ (like you'd expect) and staged to the repo using a 'stagepackage' target. this means we can eventually support something like this:
% make -C packages/cron clean all installpackage
... to install/upgrade a package from source without having to build the repo first.
another advantage of this (and the reason i started on it now) is that it lets the package Makefile do any build-specific customisation required for the UCL, such as changing dependencies based on src.conf options, which will be required for an LLVM change Ed is working on. in future, this should also let us do other things like staging and building sets in a much cleaner way.
i've been meaning to do this for a long time, so hopefully i can actually get it landed...
-
working on a better method to build FreeBSD base packages. now every package has its own subdirectory, e.g. src/packages/cron, with a normal Makefile using the new bsd.pkg.mk:
WORLDPACKAGE= cron
SUBPACKAGES= dbgUCLSRC= common.ucl
.include <bsd.pkg.mk>
common.ucl (or whatever you call it) replaces the old UCL files in release/packages/ucl/, and if needed, you can do something like "URLSRC.dbg=dbg.ucl" to use a subpackage-specific UCL.
src/packages/Makefile builds all of these using bsd.subdir.mk, so everything is automatically parallelised and works much more like how we build the rest of the system. (if you want to see something fun, have a look at how Makefile.inc1 does this right now using ${_PKGS}...)
all the *.pkg files are created in <objdir>/packages/<package>/ (like you'd expect) and staged to the repo using a 'stagepackage' target. this means we can eventually support something like this:
% make -C packages/cron clean all installpackage
... to install/upgrade a package from source without having to build the repo first.
another advantage of this (and the reason i started on it now) is that it lets the package Makefile do any build-specific customisation required for the UCL, such as changing dependencies based on src.conf options, which will be required for an LLVM change Ed is working on. in future, this should also let us do other things like staging and building sets in a much cleaner way.
i've been meaning to do this for a long time, so hopefully i can actually get it landed...
once this is done, i'd like to improve how we do package staging. currently we have to run stageworld every time we build packages, and stageworld is equivalent to installworld, so it's quite slow and makes the rebuild/update/test cycle for packages take longer than it should.
instead, we should not install anything during stageworld, and just add a path= attribute to the METALOG pointing at the built object in objdir. then pkg-create(8) can use that to pick the files from objdir to build the package. that means you'd only have to re-run stageworld if something about the metadata changed or files were added or removed.
so then you could rebuild and reinstall cron using something like:
% make -C usr.sbin/cron all
% make -C packages/cron all installpackage -
undefined stefano@mastodon.bsd.cafe shared this topic on