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.


10340 comments

photovoltaic solar energy's picture

Because the admin of this website is working, no question very shortly it
will be famous, due to its quality contents.

Gordon Tang's picture

Hi this is kinda of off topic but I was wondering 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 advice from someone with experience. Any help would be greatly
appreciated!

bicicletta elettrica's picture

excellent points altogether, you just won a new reader.
What may you recommend in regards to your post that you simply made some days ago?
Any positive?

Slot là gì's picture

Great goods from you, man. I've understand your stuff previous to and you
are just too great. I really like what you have acquired here, certainly like
what you're saying and the way in which you say it.
You make it entertaining and you still care for to keep it sensible.
I can't wait to read much more from you. This is really a great web site.

foro de detectives privados's picture

That is a good tip particularly to those new to the
blogosphere. Simple but very precise information... Thanks
for sharing this one. A must read article!

Dan Pronti's picture

Hi, Neat post. There is an issue together with your web site in internet explorer, would check this?
IE still is the marketplace chief and a good element
of other folks will miss your wonderful writing because of this problem.

tour en español por moscu's picture

I truly love your blog.. Excellent colors & theme. Did
you make this website yourself? Please reply
back as I'm planning to create my very own website and want to
learn where you got this from or just what the theme is called.

Thanks!

renovation singapore's picture

Great post.

xmovies8's picture

Wonderful post however , I was wanting to know if you could write a
litte more on this subject? I'd be very thankful if you could elaborate a
little bit further. Appreciate it!

FD Iskandar's picture

Good day! This is my first visit to your blog! We are a group
of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us beneficial information to work on. You have done a marvellous job!

agen sbobet terpercaya's picture

I was able to find good advice from your articles.

google adwords singapore's picture

Having read this I thought it was very informative. I appreciate you spending some time and effort to put this information together.
I once again find myself spending way too much time both reading and posting comments.
But so what, it was still worthwhile!

matt gaffa tape's picture

It's an remarkable piece of writing in support of all the internet users; they will obtain benefit from it I am sure.

nigerian music videos's picture

First of all I want to say excellent blog! I had a quick question in which I'd like to ask if you don't mind.
I was curious to find out how you center yourself and
clear your head before writing. I've had a difficult time clearing my thoughts
in getting my ideas out. I do enjoy writing but it just seems
like the first 10 to 15 minutes are usually lost just trying to figure
out how to begin. Any ideas or tips? Many
thanks!

Healthcare RCM in Oklahoma's picture

This article is in fact a pleasant one it helps new net visitors, who are wishing in favor of blogging.

hybrid kilts's picture

I have read so many articles about the blogger lovers except this post is
truly a fastidious paragraph, keep it up.

website design singapore price'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 protect against it, any plugin or anything you
can advise? I get so much lately it's driving me crazy so any support is very much appreciated.

hook and loop fastener's picture

Hi there! I could have sworn I've been to this website before but after reading
through some of the post I realized it's new to me. Nonetheless, I'm definitely happy I found it and I'll be bookmarking and checking back frequently!

office renovation Singapore's picture

Just desire to say your article is as surprising.
The clearness for your submit is simply excellent and i could think you're a professional in this subject.
Fine along with your permission allow me to grasp your feed to keep updated with forthcoming post.
Thanks one million and please keep up the rewarding work.

customer experience in telecoms's picture

Hello to all, the contents present at this web site are truly
awesome for people experience, well, keep up the good work fellows.

flexible magnets's picture

Whats up this is somewhat 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 knowledge so
I wanted to get guidance from someone with experience.
Any help would be greatly appreciated!

yalla-shoot's picture

Superb post however I was wanting to know if you could write
a litte more on this topic? I'd be very grateful if you could elaborate a little bit more.
Thank you!

ΤΣΑΝΤΕΣ ESHOP's picture

Thank you for every other great post. Where else could anybody get that kind of information in such a perfect approach of writing?

I've a presentation next week, and I'm on the look for such information.

new ico ubiatarplay's picture

Please let me know if you're looking for a article writer for your weblog.

You have some really good articles and I feel I would be a good asset.

If you ever want to take some of the load off, I'd absolutely love to write some
material for your blog in exchange for a link back to mine.

Please blast me an email if interested. Thanks!

agen judi sbobet's picture

Hi! I've been following your blog for a while now and finally got the courage to go ahead and give you a shout
out from Porter Tx! Just wanted to mention keep up the good work!

polythene barrier tape's picture

This paragraph will assist the internet visitors for setting up new webpage or even a blog
from start to end.

วิธีเล่นบาคาร่าออนไลน์'s picture

This is a topic that is near to my heart... Take care! Exactly
where are your contact details though?

3 credit scores's picture

Great work! This is the type of information that should be shared around the internet.
Shame on the seek engines for no longer positioning this put up upper!
Come on over and seek advice from my web site . Thanks =)

how to get rid of virus on iphone 7's picture

It's awesome to go to see this web page and reading
the views of all friends concerning this paragraph, while I am
also keen of getting know-how.

Moisturizer's picture

Wow, fantastic weblog format! How long have you
ever been blogging for? you make running a blog glance easy.
The entire glance of your website is great, let alone the content!

anti slip tape's picture

I used to be able to find good information from your blog articles.

free chat rooms's picture

When I initially commented I appear to have clicked on the -Notify me when new comments are added- checkbox
and now each time a comment is added I get four
emails with the same comment. Is there an easy method you can remove
me from that service? Thanks!

PanelView's picture

Outstanding post but I was wanting to know if you could write a litte more on this subject?

I'd be very grateful if you could elaborate a little bit more.

Appreciate it!

creative packaging's picture

I will right away grasp your rss as I can not find
your e-mail subscription hyperlink or e-newsletter service.
Do you've any? Please allow me recognise in order that
I may subscribe. Thanks.

Dental Erosion's picture

I'll immediately grab your rss as I can not find your email subscription link or
newsletter service. Do you've any? Please allow me understand in order that
I could subscribe. Thanks.

Best women clothing store's picture

Your style is so unique in comparison to other folks I've read stuff from.

Thanks for posting when you've got the opportunity, Guess I will
just bookmark this page.

2nd chance credit unions's picture

Excellent items from you, man. I've consider your stuff prior
to and you are just extremely excellent. I really
like what you have bought right here, really like what you're saying and the way in which through
which you say it. You are making it enjoyable and
you continue to take care of to stay it smart. I can not wait to learn far more
from you. That is actually a wonderful website.

123movies's picture

Have you ever thought about adding a little bit more than just your articles?
I mean, what you say is important and all. But just imagine if you added
some great visuals or videos to give your posts more, "pop"!

Your content is excellent but with pics and
clips, this site could undeniably be one of the most beneficial
in its niche. Amazing blog!

Wood handle utensils's picture

hello there and thank you for your info - I've certainly picked up something new from right here.
I did however expertise a few technical points using this web site, since I experienced to reload
the site lots of times previous to I could get it to load correctly.
I had been wondering if your web hosting is OK?

Not that I'm complaining, but slow loading instances
times will very frequently affect your placement in google and can damage your high-quality score
if ads and marketing with Adwords. Well I am adding this
RSS to my e-mail and can look out for a lot more of your
respective interesting content. Make sure you update this again soon.

buy mink lashes's picture

Its like you learn my mind! You appear to know a lot about this, such as you wrote the guide in it or something.
I feel that you simply could do with some percent to drive the
message home a bit, but other than that, this is
fantastic blog. A fantastic read. I'll certainly be back.

business school's picture

I just like the valuable information you supply to your articles.

I'll bookmark your blog and take a look at again right here regularly.

I am quite sure I will learn a lot of new stuff proper right here!

Best of luck for the next!

management studies's picture

Howdy! This is my first visit to your blog! We are a
group of volunteers and starting a new project
in a community in the same niche. Your blog provided us useful information to work on. You have done a wonderful job!

polythene sheeting's picture

I will immediately seize your rss feed as I can't find your email subscription hyperlink or e-newsletter
service. Do you've any? Please permit me understand so that I may just subscribe.
Thanks.

xmovies8's picture

Today, while I was at work, my sister stole my iphone and tested to see if it can survive a forty foot drop,
just so she can be a youtube sensation. My apple ipad is now
destroyed and she has 83 views. I know this is completely off topic but I had to share it with
someone!

ΔΙΑΓΡΑΦΗ ΧΡΕΩΝ ΑΘΗΝΑ's picture

bookmarked!!, I love your web site!

unbleached cloth tape's picture

I don't know if it's just me or if perhaps everybody else experiencing problems with your website.
It appears as though some of the written text within your posts are running off the screen. Can somebody else please comment
and let me know if this is happening to them as well?

This might be a problem with my web browser because I've had
this happen previously. Kudos

buy mink lashes's picture

Thanks for finally writing about >Add new comment |
Shaneware.biz

Casino royal 2.0's picture

hey there and thank you for your info - I've certainly picked up anything new
from right here. I did however expertise a few technical points using this website, since I experienced to reload the site lots of times previous to I could get it to load correctly.
I had been wondering if your web hosting is OK?
Not that I'm complaining, but sluggish loading instances times will very frequently affect
your placement in google and could damage your quality score if advertising and marketing with Adwords.
Well I am adding this RSS to my email and could look out for a lot more of
your respective exciting content. Make sure you update this again very soon.

digitaldripped's picture

Hi, i think that i noticed you visited my web site so i came to return the want?.I am attempting to find issues
to improve my website!I guess its good enough to make use of some of
your ideas!!

Wood handle utensils's picture

I go to see each day some web pages and websites to read articles or
reviews, but this blog provides quality based posts.

Pages

Add new comment