Adventures in tinderbox 2

If you stumbled into this post first you may want to have a look over this previous post as we are building upon steps covered there.

So far we have got our world binaries built and these are the foundation of the environments we setup for testing our port builds. From here we create a tinderbox build. Within tinderbox a build refers to a combination of world binaries (the tinderbox jails we setup before) and a version of the ports files. It is probably a rare case but it would appear that you could setup a build using say netbsd pkgsrc system or similar, the most likely alternative to the official ports system would be an internal development branch of the ports source.

The first step is to setup the ports files to be used. A cvs checkout is shown in the docs and you could adjust the svn usage from yesterday if you have your own local svn repo (official ports are still in cvs at this point). The examples in the docs show a source checkout that is unique to your tinderbox setup. I think using the system installed ports will be enough for what I want and will bypass the confusion of three copies of the ports files. Personally I use portsnap to update my system ports tree and create or update a port there to test and develop it. Then I have a copy within my home folder that is an svn checkout from my redports account that I transfer changes to that I want to keep, and commit as desired from there. While my personal folder is just the ports I make changes to, I don't want a third copy just for test builds, so what I will use here is a user defined update method that will run portsnap anytime I want to update the ports tree. We have two options here, 1. create a portsTree with no update method leaving us to run portsnap manually as desired. 2. create a portsTree with a user update method. The first option is straight forward and acceptable for most but I want to look at option 2 here.

Reading the docs you may jump straight in and use a command like cd /usr/local/tinderbox/scripts ./tc createPortsTree -p FreeBSD -u USER -m /usr/ports and get errors and no ports tree setup. The docs don't help here so I went digging through the scripts and found the answer. When you create a portstree with a user defined update method it looks for the update script when it is first setup. The solution is simple. If we are creating a portstree called FreeBSD then we create a file in tinderbox/portstrees/FreeBSD and call it and for this example I want it to run portsnap so I use the following contents - #!/bin/sh portsnap fetch update Then run the createPortsTree command with the -u USER option. Simple and a good basis of any custom update you want to setup. You could even use this to run portsnap and then merge files from your personal ports repo automatically. This setup script is run with the command ./tc updatePortsTree

You may also want to share your local distfiles with tinderbox. Pretty easy and the one setup is shared across all portstree configs -

cd /usr/local/tinderbox/scripts ./tc configDistfile -c /usr/ports/distfiles

Now that we have our jails and portsTree setup it is time for the build. Remember a tinderbox build is a combination of a specific jail and portsTree and is straight forward -

cd /usr/local/tinderbox/scripts ./tc createBuild -b 10-CURRENT-clang -j 10-CURRENT -p FreeBSD -d "10-CURRENT building with clang"

The name I used there may raise a few questions but first lets consider what variations of builds we want to use.

The aim of using tinderbox is to test building under a variety of conditions, in this case primarily different system versions. To that end we started by creating 2 jails with different versions of world binaries, you may have extended that number and I encourage you to do so but I use two in these examples. From FreeBSD 9.0 we are moving away from a  dependency on gcc as the main compiler and now include clang within the base system. Being in the early transition of this is a bit awkward as not all ports build with the old gcc v4.2 that is included with base and not all ports build with clang either. Well ports changes need to be tested with each compiler so we may get a full ports build happening on any system install. One option we have is to specify what version of gcc is used to build our port. Easy till we get linking issues with something like boost installed with gcc42 and not linking with a gcc46 built port (that is my early guess and may not be the location of a solution). So anyway I am suggesting that a number of builds are setup to test building with clang as well as gcc. This will only apply to 9.0 and higher, 8.3 has just entered beta1 and doesn't appear to include clang. The other question you may have is that I only put clang in the name, how does it know to build with clang? It doesn't yet - that comes in a minute.

Well using the two jails we built yesterday lets setup the builds -

cd /usr/local/tinderbox/scripts ./tc createBuild -b 10-CURRENT-clang -j 10-CURRENT -p FreeBSD -d "10-CURRENT building with clang" ./tc createBuild -b 10-CURRENT-gcc -j 10-CURRENT -p FreeBSD -d "10-CURRENT building with gcc" ./tc createBuild -b 9-STABLE-clang -j 9-STABLE -p FreeBSD -d "9-STABLE building with clang" ./tc createBuild -b 9-STABLE-gcc -j 9-STABLE -p FreeBSD -d "9-STABLE building with gcc"

Now we have four builds setup to test our ports in. As I suggested before you should also consider having at least an 8-STABLE jail setup and maybe even a 7-STABLE one as well if not more. As clang is not included in 7 or 8 there is no need to setup two builds for each, I would still use gcc in the build name though.

At this point you will find a few directories have been created. The first you will probably see is tinderbox/{BUILDNAME} so if your following along you will have four there corresponding to each build you setup. The next ones are inside tinderbox/builds and have the same names as the four we just looked at. The dirs inside builds contain a Makefile with all the package  dependencies and although you may think make.0 and make.1 are makefiles they are in fact logs containing the log of the last compile done, each port compile is run in two phases, and a more than likely empty duds file. The top level dirs are where all the work is done. For each port you make, tinderbox will extract the tarball found in the corresponding jail build and mount the various points needed for portstrees/distfiles/devfs/procfs. From that you can work out that each build starts up in a unique environment (it uses chroot) completely isolated for your test make. Each environment is cleaned up after each test make and the log files will include files left behind if you get your pkg-plist incorrect.

Now to configuring the compiler to use. When you first test making your port and look at a log file you may notice that the timestamp at the start is all wrong. That will be a wrong timezone setting and gets us close to the compiler settings. First lets set the timezone, so edit the file tinderbox/scripts/etc/env/GLOBAL and add the following line (adjusted to match your timezone of course)

export TZ=Australia/Adelaide

You can see that it uses a bash style environment setting. Within the same folder we want to create a config file for each build we setup using the name build.{BUILDNAME} and have it contain the CC options that we wish to use. Before you go thinking about copying all your /etc/make.conf settings consider the purpose of this - testing against a minimum system config to ensure your port is as compatible as possible. Those with a custom edited make.conf need to handle their own port build conflicts with the options they want to use. So here all we want to do is set the compiler to use. To make this easy let's make a script, I will put this inside tinderbox/scripts and lets call it

#!/bin/sh cd /usr/local/tinderbox/scripts/etc/env for BNAME in `ls ../../../builds | grep clang` do if [ ! -e build.$BNAME ] then cat > build.$BNAME <<CCOPTIONS export CC=clang export CXX=clang++ export CPP=clang-cpp CCOPTIONS fi done for BNAME in `ls ../../../builds | grep gcc` do if [ ! -e build.$BNAME ] then cat > build.$BNAME <<CCOPTIONS export CC=gcc export CXX=g++ export CPP=cpp CCOPTIONS fi done

Pretty straight forward if you know some shell scripting, if it's a bit beyond what you know it simply gets a list of dirs from within builds and outputs three lines to a corresponding config file for each one. The script won't touch files that already exist, so delete them if you want a clean slate or adjust if you want to add to existing files. The first loop uses grep to get clang named builds the second gcc. Is it overkill specifying gcc for the gcc builds - yep - but it keeps things consistent and also gets the CC setting output to the log file to remove any confusion when looking over them later, or more to the point when you get someone else to look over them for some help.

Now your all setup to use tinderbox to test your ports building. While the docs say you can do an adhoc build with just the tinderbuild command I find that not to be the case, the two command you use are

cd /usr/local/tinderbox/scripts ./tc addPort -b 10-CURRENT-clang -d graphics/blender ./tc tinderbuild -nullfs -b 10-CURRENT-clang graphics/blender

The first time you build a port it may take a while - it will build each  dependency needed, basically running make package-recursive for your port. Next time it will just pkg_add each dependancy and build the port you ask it to. The -nullfs option is needed if you setup the nullfs mount for portstree as shown above (or maybe it is for distfiles?). This adds some more dirs for you as well.

tinderbox/packages/{BUILDNAME} will contain all the packages created by that build. You will find a folder for each category containing links to the corresponding package inside the All dir.

tinderbox/logs/{BUILDNAME} will contain log files of each port compiled for that build.

tinderbox/errors/{BUILDNAME} will contain copies of the log files that had errors - this is probably all your really interested in.

That's about all you need to get up and running with tinderbox. I think I will do one more post covering some housekeeping and other notes. To close off I'll show a script I use to automate running any number of ports inside every build you have configured, I save it in tinderbox/scripts and call it

#!/bin/sh ## auto build passed ports for every tinderbox build setup ## works on assumption that /usr/ports is used for tinderbox portstree ## to test that the portname is correct cd /usr/local/tinderbox/scripts if [ ! $# -gt 0 ] then echo "Usage: ${0##*/} [category/portname ...]" echo "Multiple ports can be listed - space separated list" exit 1 fi for TESTPORT in "$@" do if [ ! -e "/usr/ports/$TESTPORT" ] then echo "********************" echo " /usr/ports/$TESTPORT doesn't exist" echo "********************" else for BNAME in `ls ../builds` do echo "***** Building $TESTPORT" ./tc addPort -b $BNAME -d ${TESTPORT} ./tc tinderbuild -nullfs -b $BNAME ${TESTPORT} done fi done

So to make use of the script

cd /usr/local/tinderbox/scripts ./ graphics/blender graphics/luxrender ports-mgmt/tinderbox

and it will go through and compile each port with every tinderbox build you have setup.


Crevalor's picture

whoah this blog is great i really like studying your articles.
Keep up the great work! You recognize, lots of persons are hunting around for this information, you can aid
them greatly.

glenn mcgee seaspan stock ticker's picture

A certain fragrance on someone else may smell quite different on us.

I think that whole series was amazing and it was so wonderful to be a part of it.
Once you have done this, you can begin to buy players and place them into your squad.
All it means is that you have to be fun,teasing
and playful and use cheeky humour while you are interacting
with any women which is actually a form of flirting and women find this very attractive as
it is not boring and creates intense chemistry between a man and woman. Did you know: Testosterone
and estrogen levels are inversely proportional. When the eggs
have just formed into fluffy curds, they're finished.
Your pools are the places that do not at all deserve your unconcern rather they deserved your ultra care and attention. However, if arguments take place, make sure that you attempt reconciliation.

rao vặt hiệu quả nhất's picture

Howdy this is kind of of off topic but I was wanting to know if blogs use WYSIWYG editors or if you
have to manually code with HTML. I'm starting a blog soon but have no coding experience so I wanted to get guidance from
someone with experience. Any help would be enormously appreciated!

testostorm's picture

Thanks very interesting blog!

testostorm's picture

Thanks very interesting blog!

Click Here's picture

bookmarked!!, I like your website!'s picture

Esta revolucion comercial 2.0 representa una oportunidad para
generar negocios con valor agregado, crear empleos de calidad, progresar la administracion de las empresas y expandir el potencial de crecimiento de
los emprendimientos a nivel planetario.

cash 1234 system scam's picture

Hi there, I discovered your website by way of Google even as looking for
a related matter, your website got here up, it seems to be great.

I have bookmarked it in my google bookmarks.

Hello there, just became alert to your weblog thru Google, and located that it is
truly informative. I'm gonna be careful for brussels.
I'll be grateful in the event you continue
this in future. Lots of other people will likely be
benefited out of your writing. Cheers!

lisse skincare's picture

Excellent way of telling, and pleasant paragraph to obtain data
about my presentation subject matter, which i am going to present in institution of higher education.

learn how to academy reviews's picture

Hi mates, its great article concerning teachingand entirely defined, keep it up all the time.

black diamond serum skincare's picture

I was able to find good information from your blog posts.

hack facebook password free's picture

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your weblog?
My blog is in the very same niche as yours and my visitors would truly benefit from a lot of the information you provide here.

Please let me know if this ok with you. Many thanks!

Samira's picture

Hmm it looks like your site ate mmy first comment (it waas extremely long) sso I guess I'll just sum
it up what I wrote and say,I'm thoroughly enjoying
your blog. I as well am an aspiring blog writer but I'm
still new to everything. Do you have any helpful
hints for rookie blog writers? I'd certainly appreciate it.

Here is my site :: m88 (Samira)

cara menurunkan berat badan dengan cepat's picture

I am regular reader, how are you everybody?
This article posted at this web site is in fact nice.

Excel Cash flow's picture

My brother suggested I might like this web site. He was entirely right.
This post truly made my day. You can not imagine just how much time
I had spent for this info! Thanks!'s picture

You should be able to spot the bodyguard first, since he goes on patrols.
Batman: Arkham City, the sequel of the 2009 hit game Batman: Arkham Asylum is set to
deliver a vast range of new and enhanced game-play features that are sure to deliver the maximum experience as the Dark
Knight. net account, even if your subscription is expired, please go change your password.

testcore pro muscle's picture

Hi there, after reading this remarkable article i am too cheerful to share my know-how here with colleagues.

Chaussures New Balance's picture

Vous ne portez pas vos talons de 12 cm tous les jours, alors, de la meme facon,
abandonnez de temps en temps vos running

go's picture

Amazing blog! Is your theme custom made or did you download it from somewhere?
A design like yours with a few simple tweeks would really
make my blog shine. Please let me know where you got your design. Cheers

Franklin's picture

Hello, i read your blog from time to time and i own a similar one and i was just curious
if you get a lot of spam comments? If so how do you prevent it, any plugin or
anything you can advise? I get so much lately it's
driving me crazy so any assistance is very much appreciated.

the simpsons donut hack's picture

Mad Dog Morgan (1976)Ruthless bounty hunters scour Australia's
harsh outback for infamous outlaw Mad Dog Morgan in this thriller based on the life
of the Irishman who immigrated during the 1800s gold
rush. Examples associated with get gems in monster city free they are apps that enable buyers
to be able to obtain goods correct using their mobile phone or
programs that offer the location associated with a company branch within the vicinity of the particular user.
At this point, no one knows who the criminals are, how many of them there are, or
where they have since escaped to.

stoel lift's picture

Heeft u tevens wat over de lifttrap.

3 Simple Questiosn Review's picture

Why users still make use of to read news papers when in this technological globe the
whole thing is available on web?

Vital Cleanse's picture

Hmm is anyone else encountering problems with the pictures on this blog loading?
I'm trying to find out if its a problem on my end or if it's
the blog. Any suggestions would be greatly appreciated.

Test force Max Ultra's picture

There's certainly a lot to learn about this issue.

I like all of the points you made.

Middle man success plan's picture

Heya i'm for the first time here. I found this board and I
to find It really useful & it helped me out much. I'm hoping to provide one
thing back and help others such as you helped me.

Garage Legno's picture

Casette per bambini da giardino Casetta legno giardino in Capanno attrezzi
acquista al miglior prezzo.

texting girls tips's picture

Parents are upset about the increase in the amount of
photos young children and teens take of themselves.
Put Him On The Hook – Text messages that can be answered with a simple yes or no simply will not suffice if you are trying to
use text messages to flirt or build a connection. Roseanna Leaton, specialist in hypnosis confidence mp3s
to assist with relationship issues.

Slim Trim PM Review's picture

Hi there, I check your new stuff on a regular basis.
Your story-telling style is witty, keep doing what you're doing!

Dermolyte Serum's picture

Aw, this was an extremely good post. Spending some time and actual effort to create a top notch article... but what can I say... I procrastinate a lot and never seem to get nearly anything done.'s picture

continuously i used to read smaller articles or reviews which also clear their motive,
and that is also happening with this article which I
am reading at this time.

Crevalor Muscle's picture

I visited several websites except the audio feature for audio songs
current at this web page is truly fabulous.

Royal Crown Ecig's picture

Keep on writing, great job!

pure youth skincare's picture

There's definately a great deal to find out about this subject.
I like all of the points you made.

Basic Cleanse's picture

Thanks for your personal marvelous posting! I
quite enjoyed reading it, you could be a great author.

I will ensure that I bookmark your blog and will often come back sometime soon. I want to
encourage you to definitely continue your great job, have a nice

hormone therapy's picture

Every weekend i used to visit this web site, as i want enjoyment, for the reason that this this website conations in fact nice funny
stuff too.

Watch Avengers: Age Of Ultron Online's picture

Captain America is coming for you!

superior muscle x review's picture

Heya i'm for the primary time here. I found this board and I find It really useful & it helped me out a lot.
I am hoping to present something again and aid others such as you helped me.

Garcinia cambogia pure's picture

Hello there! I could have sworn I've visited your blog before but after looking at many of the posts I realized it's new to me.
Anyhow, I'm certainly pleased I stumbled upon it and I'll be book-marking it and checking back frequently!

Advanced Ketone's picture

When some one searches for his necessary thing, thus he/she needs to
be available that in detail, so that thing is maintained over

Age Renew's picture

Unquestionably believe that which you stated. Your favorite reason seemed to be on the net the simplest
thing to be aware of. I say to you, I definitely get annoyed
while people consider worries that they plainly do
not know about. You managed to hit the nail upon the top and defined out the whole thing
without having side-effects , people can take a signal.
Will likely be back to get more. Thanks

The E-Factor Diet program's picture

By design, the weight loss clinic in Dallas Adams
Julie Davison Clinic diet is the Marketing Coordinator.'s picture

Another critical piece to your muscle mass gain diet is water.
And without the right amount of protein, they can't repair, reconstruct and grow.
Simply by adopting a few healthy habits, you can enjoy
lean muscle mass, with a lower body-fat percentage.

mn seo's picture

I used to be suggested this web site through my cousin. I am not sure whether this publish is written by
him as no one else understand such exact about my trouble.
You are wonderful! Thank you!

miracle smoke cannabis's picture

Its not my first time to go to see this web page, i am browsing this
web site dailly and take nice facts from here everyday.

apex t's picture

Do you have a spam problem on this website; I also am a blogger,
and I was curious about your situation; we have developed some nice practices and we
are looking to swap strategies with other folks,
why not shoot me an email if interested.

ขายส่งเครื่องสำอาง's picture

Inspiring quest there. What happened after? Good luck!

minnesota web design's picture

Aw, this was an incredibly good post. Taking the time and actual effort
to generate a good article... but what can I say...
I put things off a whole lot and never manage to get
anything done.

cyalis's picture

Hello there! This post couldn't be written any better!
Looking at this article reminds me of my previous roommate!

He always kept preaching about this. I most certainly
will forward this post to him. Fairly certain he'll have a good read.
Thank you for sharing!

menghilangkan jerawat cara herbal's picture

Hey there would you mind letting me know which webhost you're using?
I've loaded your blog in 3 different browsers and I must say this
blog loads a lot faster then most. Can you suggest a good internet hosting provider at a reasonable price?

Kudos, I appreciate it!


Add new comment