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.


5016 comments

Traffic Racer hack's picture

Gamers can spend hours searching for free games to play or they can visit a site like Baller -
Arcade, Racingames60, or Racing Games WS. * Too many
meaningless non-family relationships (is there a positive
exchange of service, knowledge, or value taking place.
The last thing you want to do is choose the wrong one or
your casino Traffic Racer hack
may suffer, hence cutting your profits.

Jeff Halevy's picture

This piece of writing will assist the internet visitors for building up new weblog or even a blog from start
to end.

Snjob.Naplay.Net's picture

That is the reason why many web sites have
sign ups for the person to have these funny movie quotes sent directly to their email mail box each
and every day. As good fortune would have it, our hero leaps into action and
begins his battle against the airborne reptiles. Add
some strategic fades and transitions or overlay two sequences on top of each other to create a flashback.

Here is my homepage Snjob.Naplay.Net

neurs's picture

They should be relatively challenging, but you should ensure that you can meet them, with a minimum of pain, every time.

Sweet diet snack: sweet potato You may be watching your
carbohydrate intake, but my experience is that healthy carbohydrates help me stick to a
diet, feel better, think more clearly, and have the energy I need
to exercise. 7 million which was up $ 110 million compared
to the year previous.

www.dummy.com's picture

It is very much also advantageous because all
of the doctor could certainly then place exactly even the sensory problems is
ruined or in pain. Brush " up " on your favorite skills and therefore
become side of another of a elite professionals in the main world.
This some medical software plan can raise with your incredible practice.

Idol White's picture

I know this web site provides quality depending articles and additional material, is there
any other site which presents these kinds of data in quality?

oriflame's picture

For example, mine had the Yahoo, MSN, and Google search bars.
There is also a highly qualified team of executive staff taking this company forward, plus a
corporate staffing of 8 thousand, anyone can be confident that they are joining a company that's going to be around for a while.
Use the fact that this business is new to your advantage and make your way to the
top by employing the right marketing tactics.

prediksi skor bola's picture

Attractive section of content. I just stumbled upon your blog
and in accession capital to assert that I acquire actually
enjoyed account your blog posts. Anyway I'll be subscribing to your augment and even I achievement you access consistently quickly.

herpes cure breakthrough's picture

Although using supplements such as lysine and taking anti-herpes medication can reduce or prevent outbreaks, oral
and genital herpes are contagious.

buyprosolutionplus.net's picture

That is a great tip especially to those fresh to the blogosphere.

Short but very accurate info... Appreciate your sharing this one.
A must read article!

legion of heroes cheats engine's picture

Saturn's run through its exaltation is both
literal and symbolic when applied to the archetypal Cancerian themes of Home and Family:.
Winds south between 10 and 15 mph, gusting up to 25 mph at times.

It's possible to for any minute earlier find any epic volume of explores relating to this redirection despite basically each of them
should be to an incredible level satisfying.

Derma Active Reviews's picture

Everything posted made a bunch of sense. However, think about this, suppose you were
to create a awesome title? I am not suggesting
your information isn't good, however suppose you added something
that grabbed people's attention? I mean Add new comment | Shaneware.biz is a little boring.
You ought to glance at Yahoo's home page and note how they create article titles to get people
to open the links. You might add a related video or a related picture or two to get people excited about
everything've written. In my opinion, it could bring your posts a little livelier.

www.youtube.com's picture

But what makes Vi - Salus so different is the use of what is know as
a capture page branding both the rep and the
company at the same time. As way as their items go, they marketplace numerous science based
mostly nutraceuticals that are created to assist in your total wellness and properly becoming.
Ryan Blair is the CEO and is the embodiment of the Vi - Salus vision.

SEO Phoenix's picture

What's up Dear, are you really visiting this web site on a regular basis, if so afterward you will without doubt take
good experience.

Travel sites's picture

I have learn a few excellent stuff here. Certainly worth bookmarking for revisiting.
I surprise how a lot attempt you put to create the sort
of magnificent informative website.

Alive After The Fall book's picture

The biggest thanks goes to my husband, Rob Baker, who didn't question when I
said I needed to book a flight to NYC and would
be leaving in 2 days.

wcm777's picture

Males, in particular, should not be consuming soy
protein in any significant amount, let alone twice a day every
day as Visalus advises. Food being part of the physiologic needs of people should be taken with some sort of discipline.
The program is based on nutrition that helps
you burn fat and keep lean muscle, boosts your metabolism and helps control hunger.

Jeff Halevy interviews's picture

This paragraph is in fact a fastidious one it helps new internet visitors,
who are wishing for blogging.

business casual men's picture

I am actually glad to glance aat this web site posts which consists of tons
of useful data, thjanks for providing such information.

http://www.amazon.com's picture

I seriously love your website.. Excellent colors & theme. Did you develop
this web site yourself? Please reply back as I'm wanting
to create my own personal site and want to know where
you got this from or just what the theme is named. Many thanks!

lacrim-ripro.Com's picture

Hip hop moves were inspired by complex rhythms and the down-to-earth
movement style of African dancing. A nice fitting dress will always give the wearer a great and comfortable
feeling. This motivation for discarding the law banning sales is ridiculous.

My web-site: lacrim-ripro.Com

Traffic-Racer-Hack.com's picture

The objective of the game is to get three matching faces in a row,
making them disappear from the board. Win first few
levels and the game become more challenging in the latter
levels. Somehow, they only approached me from behind when I was passing a pair of
slower walkers.

Here is my website :: Traffic-Racer-Hack.com

quest bars's picture

Saved as a favorite, I really like your blog!

quest bars's picture

Wow that was odd. I just wrote an incredibly long comment
but after I clicked submit my comment didn't
appear. Grrrr... well I'm not writing all that over again. Regardless, just wanted to say great blog!

send out cards's picture

But what makes Vi - Salus so different is the use of
what is know as a capture page branding both the rep and the company at the same time.
Peter Ragnar's 'How To Build Muscle On A Raw Food Diet'.
The program is based on nutrition that helps you burn fat and keep lean muscle, boosts your metabolism and helps control hunger.

quest bars's picture

Quality content is the important to interest the viewers to pay
a quick visit the website, that's what this site is providing.

legal shield reviews's picture

Most protein shakes are loaded with sugar, fat, and other ingredients that aren't even necessary for the body.
Sweet diet snack: sweet potato You may be watching your carbohydrate intake, but
my experience is that healthy carbohydrates help
me stick to a diet, feel better, think more clearly, and have the energy I need to exercise.

Right after reading this Vi - Salus evaluation you are most likely thinking that Vi - Salus is an excellent opportunity as well as are ready to get started.

Qnet's picture

In every company, there will always be some downsides.
Sweet diet snack: sweet potato You may be watching your carbohydrate intake,
but my experience is that healthy carbohydrates help me stick
to a diet, feel better, think more clearly, and have
the energy I need to exercise. Right after reading this Vi - Salus evaluation you are most likely thinking that Vi - Salus is an excellent opportunity as well as are
ready to get started.

match.com free trial's picture

I've been exploring for a little for any high quality articles or weblog posts
in this sort of area . Exploring in Yahoo I eventually stumbled upon this site.
Studying this information So i'm happy to show that I've a very good uncanny feeling I came
upon just what I needed. I such a lot definitely
will make certain to do not fail to remember this website
and give it a glance on a continuing basis.

testosterone boost reviews's picture

First off I want to say fantastic blog! I had a quick question in which I'd like to ask if you don't mind.
I was interested to know how you center yourself
and clear your head prior to 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 wasted simply just
trying to figure out how to begin. Any recommendations or tips?
Thank you!

Dragon Blaze Hack's picture

Besides Cheat Game gives us a huge range of options on generating a lot of
things.

clenbuterol side effects bodybuilding's picture

For this reason, many bodybuilders hate doing cardio on clen and sweat profusely.

pintaart.org's picture

I'm noot that much of a online reeader to be honest but your sites
really nice, keep it up! I'll go ahead and bookmark your website to come back down the road.
Many thanks

jasa review bisnis online's picture

The mandate for the Fireplace Service Commission and Rural Fire
Authorities responding to non-fire occasions could be clarified.

Zonecore garcinia cambogia's picture

I just couldn't depart your website before suggesting that I
really enjoyed the usual info an individual provide on your guests?
Is going to be again frequently in order to check up on new posts

AtlantisHacks's picture

It's an amazing paragraph in support off all the web viewers;
they wull obtain advantage from it I amm sure.

avon's picture

But each student is excelling at an individual rate.
Two similar surveys for example would yield different results on who is at the top of the MLM
companies' industry. 5 million to 150,000 women who felt they had no chance of promotion and were left in 'dead end,
low-paying jobs' according to the Los Angeles Times.

diet plans for women to lose weight's picture

Hello there! This is kind of off topic but I need some help from an established blog.

Is it very hard to set up your own blog? I'm not very techincal but I can figure
things out pretty fast. I'm thinking about making my own but I'm not sure where to begin.
Do you have any ideas or suggestions? Appreciate it

Progain 350's picture

Does your site have a contact page? I'm
having trouble locating it but, I'd like to send you an email.
I've got some recommendations for your blog you might be interested in hearing.
Either way, great website and I look forward to seeing it improve over time.

match.com free trial's picture

Good way of explaining, and pleasant post to get data about my presentation subject matter, which i am
going to deliver in school.

ego international scam's picture

Internet marketing firms and small business owners saw this as a chance to email blast a marketing
campaign to thousands of prospects within a matter of minutes.
Instead of searching only one or two websites for product reviews, consumers can sign in to their Facebook or Twitter accounts and ask for direct,
up-to-date appraisals of anything from new Macs to new Mazdas.
But, with Dave Delgado's' DIY Bike Repair package you are sure to get your monies worth to the last coin.

Review my blog; ego international scam

zija's picture

Males, in particular, should not be consuming soy protein in any significant amount,
let alone twice a day every day as Visalus advises.

As mentioned earlier, Visalus seriously isn't a gimmick.
It helps increase immunity to aid in fighting colds.

quest bars's picture

I used to be recommended this web site by way of my cousin.
I'm now not certain whether this post is written via him as no one else realize such
specified approximately my problem. You are amazing! Thank you!

www.match.com's picture

I loved as much as you'll receive carried out right here.
The sketch is tasteful, your authored subject matter stylish.

nonetheless, you command get got an shakiness over that you wish be delivering the
following. unwell unquestionably come more formerly again as exactly the same
nearly very often inside case you shield
this hike.

match.com free trial's picture

I all the time used to read piece of writing in news papers but now as I am
a user of net so from now I am using net for
posts, thanks to web.

thailand escorted tours's picture

This article gives clear idea designed for the
new viewers of blogging, that genuinely how to do blogging and site-building.

shark's picture

Way cool! Some very valid points! I appreciate you writing this article and also the rest
of the site is also very good.

http://apjii.org/'s picture

If somje one needs tto be updated with latest technnologies after
that he ust bee pay a quick visit this web page and be up to date all
the time.

Jacinto's picture

They are folks, and in the finish it really is people's behavior we should recognize.

Flynn's picture

When my husband and I moved we had Barrier start treating our
new dwelling and have yet to see a bug.

Pages

Add new comment