You are not logged in.

#1 2013-04-21 22:08:33

Registered: 2012-04-24
Posts: 15

Makepkg 4.1.0, VCS PKGBUILDs and cmake rebuilding changes only

If a small number of a project's files are edited, and that project uses cmake, then cmake will, by default, only rebuild the changed files and those that depend on them.

Before makepkg/pacman 4.1, it was possible to take advantage of this when rebuilding cvs packages using cmake after updating the source: Many cmake projects require out-of-source builds, so it was possible to keep an up-to-date working copy of the source in $srcdir/$_gitname and perform the build something like this:

[[ -e $srcdir/$_gitname-build ]] || mkdir $srcdir/$_gitname-build
cd $srcdir/$_gitname-build
cmake $srcdir/$_gitname

Unless the build directory is removed manually, only changed files will be rebuilt. For a small update to a large package, this can save hours of unnecessary rebuilding.

As far as I can tell, makepkg's automatic VCS source handling means this no longer works: the repo in $SRCDEST is updated, then a new working copy is made in $srcdir. It seems cmake then regards every file in the working copy as having changed (I believe cmake looks at when the file was last touched to determine whether it needs rebuilding). As a result, everything is rebuilt, no matter how small the actual changes were.

I realise that partial rebuilds are probably something of a niche area/possibly not officially supported, but I believe they have their uses. What is the official line on partially rebuilding cvs packages?

Is there an elegant way to achieve the desired behaviour with makepkg 4.1? The only workaround I can think of would be to ignore makepkg's working copy and maintain my own working copy in $srcdir, updating by pulling changes from the $SRCDEST repo rather than removing and cloning anew each time. In this instance, having makepkg clone its own working copy each time would be a slight waste of time and space.


Board footer

Powered by FluxBB