Testing ports with poudriere

To build or test ports on DragonFly or FreeBSD, a fantastic tool named poudriere exists. It provides a clean environment for reproducibly building packages.

Installation is as easy as pkg ins poudriere. Then edit /usr/local/etc/poudriere.conf. In my case I only had to change the DPORTS_URL setting to a local git repository for the ports tree (for example point it to /git/DPorts.git). This is because I want to add or test new ports. If you only want to build existing ports, point it towards a mirror of our ports tree.

Next, we check out the ports. This is done via

# poudriere ports -c

Then, we build a jail named myjail with a specified DragonFly version. I will use the master branch. Inside this jail we will later on build the ports.

# poudriere jail -c -j myjail -v master

This takes a while as it has to do a full buildworld. Now we can start to build a port. Let’s say we want to test the lang/ruby22 port:

# poudriere testport -j myjail -o lang/ruby22

That’s all. For more complex tasks, please consult it’s man page poudriere(8).