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 update.sh 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 gencompilerenvfiles.sh

#!/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 testbuilds.sh

#!/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 ./testbuilds.sh graphics/blender graphics/luxrender ports-mgmt/tinderbox

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


10814 comments

stainless steel stud earrings's picture

Thank you for the good writeup. It if truth be told used to be a entertainment account it.
Glance complex to far added agreeable from you! However, how
could we keep in touch?

Antony's picture

I have fun with, cause I discovered exactly what I was
taking a look for. You've ended my 4 day lengthy hunt!

God Bless you man. Have a nice day. Bye

backpack purse's picture

I got this site from my friend who informed me on the
topic of this site and at the moment this time
I am browsing this website and reading very informative posts at this
place.

Transfer WordPress Site To Another Host's picture

We stumbled over here by a different web address and thought I should check things out.
I like what I see so now i am following you.
Look forward to checking out your web page repeatedly.

fish texes's picture

I was recommended this web site by my cousin. I'm not sure whether this
post is written by him as nobody else know such detailed about
my difficulty. You are wonderful! Thanks!

lyric video maker's picture

This post presents clear idea for the new users of blogging,
that truly how to do blogging.

Health Insurance Agency's picture

With havin so much content and articles do you ever run into any problems of plagorism or
copyright infringement? My site has a lot of unique
content I've either written myself or outsourced but it seems a lot of it
is popping it up all over the internet without my agreement.
Do you know any solutions to help reduce content from being ripped off?
I'd genuinely appreciate it.

mohd elfie nieshaem juferi's picture

I got this website from my pal who told me regarding this website and now this time
I am browsing this site and reading very informative posts at this place.

Shimano's picture

If some one desires to be updated with newest technologies then he must
be pay a visit this website and be up to date
every day.

Gastown Condos's picture

Since the admin of this web site is working, no uncertainty very soon it will be renowned, due to its quality contents.

voodoo magic for business's picture

Hello there! I know this is kind of off topic but I was wondering which blog platform are you using for this website?

I'm getting tired of Wordpress because I've had issues with hackers and I'm looking at
options for another platform. I would be great if you could point me
in the direction of a good platform.

la korean restaurant's picture

This paragraph is genuinely a pleasant one it helps new web visitors, who are
wishing in favor of blogging.

seo services Canada's picture

Its such as you read my mind! You seem to know so much approximately this,
like you wrote the e-book in it or something. I feel that
you just could do with a few percent to
power the message house a little bit, but other than that, that
is excellent blog. An excellent read. I'll certainly be back.

kissimmee's picture

That is really attention-grabbing, You are an overly skilled
blogger. I've joined your feed and stay up for in search of extra of your wonderful post.

Additionally, I've shared your site in my social networks

http://bit.ly/'s picture

Hey there just wanted to give you a quick heads up.

The text in your content seem to be running off the screen in Internet explorer.
I'm not sure if this is a format issue or something to do with internet browser compatibility but I thought I'd post to let
you know. The layout look great though! Hope you get the issue resolved soon. Many
thanks

stainless steel rings's picture

This is my first time pay a visit at here and i am truly impressed to read all at one place.

loft conversions south london's picture

Hello there, I discovered your web site by means of Google at the same
time as looking for a related subject, your web site came up, it seems to be good.

I've bookmarked it in my google bookmarks.
Hi there, just became alert to your weblog thru Google, and
located that it is truly informative. I am gonna be careful for
brussels. I'll appreciate in case you proceed this in future.
Numerous other people might be benefited from your writing.
Cheers!

watspy's picture

I couldn't resist commenting. Perfectly written!

management training courses kuala lumpur's picture

always i used to read smaller content which also clear their motive, and that is also happening with this
paragraph which I am reading now.

high quality jackets's picture

I loved as much as you will receive carried out right here.
The sketch is tasteful, your authored material stylish.
nonetheless, you command get got an impatience over that you wish be delivering the following.
unwell unquestionably come further formerly again since exactly the
same nearly very often inside case you shield this hike.

จีคลับ's picture

Hello there, I found your blog by the use of Google at the same time as looking for a comparable matter, your
site got here up, it seems great. I have bookmarked it in my
google bookmarks.
Hi there, just become alert to your weblog via Google, and
found that it's really informative. I'm going to watch out for brussels.

I will be grateful should you proceed this in future.
Lots of other folks can be benefited from your writing. Cheers!

Tennis bags's picture

Very nice post. I just stumbled upon your blog and
wanted to mention that I have really enjoyed browsing your weblog posts.
In any case I'll be subscribing to your feed and I hope you write once more very
soon!

Introduction Of Lean Belly Breakthrough's picture

magnificent publish, very informative. I ponder why the other
experts of this sector do not understand this. You must proceed your writing.
I am confident, you've a huge readers' base already!

vein viewer in india's picture

Hi, i feel that i noticed you visited my website so i came
to return the choose?.I am attempting to in finding things to enhance my website!I guess its ok to make use of a few of your concepts!!

best baby strollers 2017's picture

Heya i'm for the first time here. I found this board and
I in finding It really helpful & it helped me out much.
I'm hoping to present something again and help others
such as you aided me.

toronto fashion photographertoronto fashion photographer's picture

Hola! I've been following your web site for a long time now and finally got the bravery to go
ahead and give you a shout out from Huffman Texas! Just wanted to say keep up the good work!

90 day fiance Ukraine's picture

Cool 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. Kudos

게장's picture

I am sure this article has touched all the internet viewers, its really really pleasant piece of writing on building up new website.

chinchilla as pets's picture

An impressive share! I've just forwarded this onto a friend who has been doing a little homework
on this. And he actually bought me lunch simply because I discovered
it for him... lol. So allow me to reword this....
Thank YOU for the meal!! But yeah, thanx for spending some time to discuss
this subject here on your blog.

Home Refinery's picture

I was curious if you ever considered changing the page layout of
your website? Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect
with it better. Youve got an awful lot of text for only having 1 or 2
images. Maybe you could space it out better?

travel to Ukraine's picture

I blog often and I really appreciate your information. This
great article has really peaked my interest. I'm going to take a note of your blog and keep checking for new details about once per week.
I subscribed to your RSS feed as well.

increase website traffic's picture

Yes! Finally someone writes about get soundcloud likes.

Koby's picture

Its not my first time to pay a quick visit this web site, i am visiting this site dailly and
take pleasant facts from here all the time.

Abentura Cruises's picture

Its not my first time to visit this web page, i am
browsing this web site dailly and get fastidious data from here daily.

Digital Marketing's picture

I was curious if you ever considered changing the page layout
of your site? Its very well written; I love what youve got to say.

But maybe you could a little more in the way of content so people could connect with it better.
Youve got an awful lot of text for only having 1 or 2 images.
Maybe you could space it out better?

date Ukraine women's picture

It's not my first time to go to see this web page, i am browsing this web page
dailly and obtain nice facts from here everyday.

Ukraine women trustworthy? Ukraine women want's picture

I'd like to thank you for the efforts you've put in penning this website.

I really hope to see the same high-grade content
by you later on as well. In truth, your creative writing abilities has inspired me to get my
own, personal website now ;)

Ukraine women trustworthy? Ukraine women want's picture

Hello I am so grateful I found your web site, I really found you by
mistake, while I was searching on Aol for
something else, Nonetheless I am here now and would just like to
say kudos for a marvelous post and a all round exciting blog (I also love the theme/design), I
don't have time to read through it all at the moment but
I have book-marked it and also added in your RSS feeds, so when I
have time I will be back to read more, Please do keep up the excellent b.

portable vein viewer's picture

Oh my goodness! Amazing article dude! Thanks, However I am
experiencing troubles with your RSS. I don't understand
why I am unable to subscribe to it. Is there anybody having identical RSS issues?
Anybody who knows the answer can you kindly respond?
Thanx!!

엘에이 맛집's picture

I have read so many articles regarding the blogger lovers but this article is truly a good paragraph, keep it up.

travel to Ukraine's picture

What a information of un-ambiguity and preserveness of precious experience
regarding unpredicted emotions.

PM me at's picture

Its such as you read my thoughts! You appear to know so much approximately this, like you wrote the ebook in it or something.
I feel that you simply could do with some % to pressure the
message house a little bit, but instead of that, this is excellent blog.
An excellent read. I will definitely be back.

vein viewer in india's picture

Howdy! I could have sworn I've visited this web site before but after
looking at many of the posts I realized it's new to me.
Anyways, I'm definitely pleased I found it and I'll be bookmarking it and
checking back often!

Ukraine women trustworthy? Ukraine women want's picture

Undeniably believe that that you said. Your favourite reason appeared to be on the net the simplest factor to bear in mind of.
I say to you, I certainly get annoyed while folks
think about worries that they plainly don't know about. You controlled to hit the nail upon the
top and also outlined out the entire thing without
having side effect , people can take a signal. Will likely be back to get more.
Thank you

stainless steel mens wedding bands's picture

I don't even know how I ended up here, but I thought
this post was good. I don't know who you are but certainly you're going to
a famous blogger if you aren't already ;) Cheers!

top rated strollers's picture

Hello, i think that i saw you visited my weblog so i
came to "return the favor".I am trying to find things to
enhance my website!I suppose its ok to use a few of your ideas!!

medtrainnovations.com's picture

I am truly thankful to the owner of this site who has shared this
wonderful post at here.

Rachelle's picture

If some one needs expert view concerning blogging then i
suggest him/her to pay a visit this blog,
Keep up the good job.

Tod's picture

I was curious if you ever considered changing the page layout of your blog?

Its very well written; I love what youve got to
say. But maybe you could a little more in the way of content so
people could connect with it better. Youve got an awful lot of
text for only having 1 or 2 pictures. Maybe you could space it
out better?

home refinery website's picture

I have been browsing online more than 3 hours today,
yet I never found any interesting article like yours.
It's pretty worth enough for me. In my view, if all webmasters and
bloggers made good content as you did, the net will be a lot more useful than ever before.

Pages

Add new comment