Incremental package build

Hi, So my situation is as follows:

I have a crash bug when running firefox.
I have built and installed firefox from the ports tree.
I have modified a C file inside of the work folder - and wish to rebuild (ie incrementally) with my change + test
Running make after changing a file in the work folder does nothing

I assume I am missing something? Is this even the right approach? If not, how should I be doing this? (Links to articles/other posts appreciated)
 
Try this: After each modification of the C file, from /usr/ports/www/firefox
rm work/.stage_done.firefox._usr_local
rm -r work/stage
make

The "incremental" build will be faster when devel/ccache is installed.
 
Last edited:
Thanks. I tried that and it seemed to do something (re-packaging I guess) but it didn't rebuild source file I had changed.

I will try ccache and see if that helps.

I guess one question to ask would be: Is it the right thing to do? Work on a port inside of usr/ports? Or should I copy it to somewhere under my own home folder while I work on it?
 
OK, I have read that page but it seems related to preparing a patch/port for publication:

`In the preparation of the port, files that have been added or changed can be recorded with diff(1)`

Whereas I am looking for a development workflow. Ie how do I edit, compile + test quickly.
 
Build flow

Code:
make extract
make patch
(edit files)
make makepatch (to create proper patch files in files/) or do this step by hand
make clean
while true; do
  make
  make clean
done
 
Thanks! That makes a lot more sense, I assume I can also edit files in the while loop? (Updated below)

Code:
make extract
make patch
(edit files)
make makepatch (to create proper patch files in files/) or do this step by hand
make clean
while true; do
  (edit files here as well?)
  make
  make clean
done
 
A generic make typically runs all these in succession (it does a bit more but these are probably the most important ones):
Code:
make extract # extracts the sources
make patch   # runs any patches, either from the Makefile directly and/or the patches in files/
make configure # runs ./configure
make # Actually builds the thing.

You're usually better off working with the ports system and using the features it provides than trying to fight it. Keep in mind that a make clean basically removes the work/ directory and thus all your changes and previous (incomplete) builds are gone too. To keep your changes it's imperative to have them in files/, so they are applied every time you run a build.
 
Definitely read through the Porter's handbook. While it's intended to create (and submit) ports for FreeBSD, it contains a lot of information on how a port works, how to build something, dependency chains, etc. There's also the ports(7) man page but that's more a reference to all the various targets you can use as a user of a port.
 
Back
Top