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.


6713 comments

งานแต่งงาน's picture

magnificent points altogether, you just received a emblem
new reader. What might you recommend in regards to your
put up that you simply made some days in the
past? Any certain?

Watch The Fate of the Furious 2017 In 4KHD's picture

Hello there! 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 valuable information to work on. You have done a outstanding job!

cach vao M88's picture

I've read some good stuff here. Definitely value bookmarking for revisiting.

I surprise how so much attempt you place to make this sort of excellent informative website.

agen judi Bola's picture

At this moment I am going to do my breakfast, once having my breakfast coming again to read more news.

Vauxhall corsa 6 speed m32 gearbox's picture

Very nice blog post. I absolutely love this site.
Thanks!

Junkyards in pennsylvania's picture

Thanks for your marvelous posting! I definitely enjoyed reading it, you may
be a great author.I will be sure to bookmark your blog and will often come back at some point.
I want to encourage yourself to continue your great posts, have a nice evening!

Jason Kulpa San Diego's picture

Hi to every one, because I am in fact keen of reading this blog's post to be updated daily.

It consists of good data.

Junkyards in maine's picture

obviously like your web-site but you need to take a look
at the spelling on several of your posts. Several of them are
rife with spelling issues and I to find it very bothersome to tell the reality however I'll certainly come again again.

Junkyards in rhode island's picture

Wow, wonderful blog structure! How long have you been blogging for?
you made blogging glance easy. The total glance of your web site is excellent, let alone the content!

rabbit ear wine opener's picture

Having read this I believed it was extremely informative.
I appreciate you spending some time and effort to put this informative article
together. I once again find myself spending a
lot of time both reading and commenting. But so what, it was still
worthwhile!

xoc dia bip's picture

Incredible points. Great arguments. Keep up the great effort.

Jose pablo mangeri's picture

L'organisme de reglementation pour la juridiction dans laquelle le web site de poker
opere garantit qu'aucune irregularite n'est en place et que les sites soient soumis de facon reguliere
a des tests par des controleurs independants.

Reagan's picture

It's going to be ending of mine day, but before finish I am reading this fantastic paragraph to improve my know-how.

wind damage to laminate shingles's picture

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

portuguese interpreter san francisco's picture

magnificent publish, very informative. I wonder why the opposite
experts of this sector do not notice this. You
should continue your writing. I am confident, you have a great readers' base already!

seo score's picture

I am actually thankful to the owner of this site who has shared this great post at at this place.

film production company's picture

Just desire to say your article is as astonishing. The clarity
for your submit is just great and that i could assume you're
an expert in this subject. Fine with your permission let me to clutch
your RSS feed to stay up to date with approaching post. Thanks
a million and please continue the rewarding work.

Micki's picture

This website was... how do you say it? Relevant!! Finally I have found something that helped me.
Thank you!

Latest mobile prices in pakistan's picture

Hello! I know this is kinda off topic however , I'd figured I'd ask.
Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa?
My site addresses a lot of the same subjects as yours and I think we could greatly benefit from each other.

If you are interested feel free to shoot me an email.
I look forward to hearing from you! Terrific blog by the way!

men&#039;s clothing's picture

Howdy! This article couldn't be written any better! Looking through this article reminds me of my previous roommate!
He continually kept talking about this. I most certainly will
send this post to him. Pretty sure he'll have a
great read. I appreciate you for sharing!

DM ideas's picture

My brother suggested I would possibly like this web site.

He was totally right. This publish actually made my day. You can not believe simply how so
much time I had spent for this information! Thanks!

Treinamento integrado no passo-fundo's picture

Wow, this paragraph is good, my sister is analyzing such things,
therefore I am going to convey her.

packaging materials's picture

I'm now not sure where you're getting your information, however great topic.
I needs to spend some time studying much more or
working out more. Thanks for magnificent information I
used to be looking for this info for my mission.

togel singapura's picture

When some one searches for his essential thing, thus he/she wishes to be available that in detail, so that thing is maintained
over here.

Ransomware's picture

Hi terrific website! Does running a blog like this take a
lot of work? I have very little expertise in programming but
I had been hoping to start my own blog soon. Anyway,
if you have any recommendations or techniques for new blog owners please share.
I understand this is off topic however I simply had to ask.
Cheers!

all online casino malaysia's picture

Good respond in return of this query with real arguments and telling everything about that.

what is a deep tissue massage's picture

I have learn a few just right stuff here. Definitely value bookmarking for
revisiting. I wonder how a lot attempt you set to make the sort of excellent informative site.

wood doors's picture

I like the helpful information you provide in your articles.
I will bookmark your weblog and check again here regularly.
I'm quite certain I will learn many new stuff right here!

Good luck for the next!

motorcycle lock's picture

It's awesome for me to have a web site, which is helpful
in support of my knowledge. thanks admin

mini sex doll's picture

Can I simply say what a relief to find an individual who genuinely understands what they're discussing online.
You certainly realize how to bring a problem to light
and make it important. A lot more people must read this and understand this
side of the story. It's surprising you are not more
popular given that you most certainly possess the gift.

San Diego Refrigerator Repair's picture

I read this paragraph completely regarding the resemblance of newest and previous
technologies, it's amazing article.

organic's picture

I'm really impressed along with your writing skills as neatly as with the format
in your blog. Is this a paid theme or did you customize it
your self? Anyway stay up the excellent quality writing,
it's rare to see a nice weblog like this one these days..

marketing thailand's picture

My First desk of the 60k Excessive roller was a joke.

zombie pixel's picture

In fact no matter if someone doesn't be aware of afterward its up to other viewers that they will assist,
so here it occurs.

Jaco Beach Adventure Tours's picture

Oh my goodness! Awesome article dude! Thank you so much, However I am having difficulties with your RSS.
I don't understand the reason why I cannot join it. Is there anyone else getting similar RSS problems?
Anybody who knows the answer will you kindly
respond? Thanks!!

Fire Emblem Heroes orbs hack's picture

Since the admin of this website is working, no hesitation very
rapidly it will be renowned, due to its feature contents.

huisstijl design's picture

I think this is one of the most vital information for me.
And i am glad reading your article. But should remark on some
general things, The site style is ideal, the articles is really nice
: D. Good job, cheers

stretch film's picture

Hey there! Do you use Twitter? I'd like to follow you if that would be ok.
I'm definitely enjoying your blog and look forward to new posts.

polythene's picture

Simply wish to say your article is as astonishing.
The clarity in your post is simply spectacular and i
could assume you're an expert on this subject.

Well with your permission allow me to grab your feed to keep up to
date with forthcoming post. Thanks a million and please carry
on the enjoyable work.

chụp hình tiệc cưới giá rẻ tphcm's picture

I think this is among the most important information for
me. And i'm glad reading your article. But should remark on some general things, The site style is wonderful, the
articles is really nice : D. Good job, cheers

lash perfect essex's picture

No matter if some one searches for his necessary thing, therefore
he/she desires to be available that in detail,
so that thing is maintained over here.

dragon city astuce accouplement's picture

Greate post. Keep writing such kind of information on your page.
Im really impressed by your blog.
Hello there, You have performed a fantastic job. I willl definitely digg iit
andd personally suggest to my friends. I'm confident they will be benefited from tuis web site.

m88's picture

Afer I originally left a comment I eem to have clicked the -Notify me
when new comments are added- checkbkx and from
now on each time a cpmment iis added I recieve
4 emails with thee same comment. Perhaps there is a way you aare able to remove me
from that service? Kudos!

my page; m88

roblox robux hack's picture

If you're a fan or a punter of harness racing, then you have no
doubt heard of the venue Balmoral Park. For instance, if you win one
out of three bets, you know that you will need to divide your money into at least three
stakes for the day, but also figure in a losing streak.

If you do not favor a particular driver, you can show your spirit with
a popular NASCAR car manufacturer's logo.

clashoflordshackupdate.wordpress.com's picture

In fact, although just a hacker's prank, it would really be a
bummer for the user, as you couldn't go anywhere if you smelled
like a skunk for instance. They've uploaded the entire thing
to the public torrent tracker thepiratebay. I think they have
overcome the age old problem of good old hack and slash dungeon games here, as most don't cross over well, if at all, mainly due to
the complicated controls.

http://cloudraidershack.wordpress.com's picture

It is hosted by Facebook, which is why you see all the ads and requests.
An interesting visit to the fishing village of Hermanus during September
sees whales as they come near shore to birth in the secluded bays.
Durable: This castle is made of wood and is extremely durable.

www.lamar.edu.mx's picture

Excellent website. A lot of helpful information here.
I am sending it to several pals ans also sharing in delicious.

And certainly, thank you to your sweat!

jacksonville dui attorney911.com home page's picture

Heya! I just wanted to ask if you ever have any issues with hackers?
My last blog (wordpress) was hacked and I ended up losing a
few months of hard work due to no backup. Do you have any solutions to
stop hackers?

m88's picture

Hey! I just wanted to ask if you ever have any issues with hackers?

My last blog (wordpress) was hacked and I ended up losing a
few months of hard work due to no data backup. Do you have any methods to protect
against hackers?

Here is myy web blog - m88

hay day cheats's picture

In fact, I've been tracking all the new neuroscience technologies and it appears that they are getting very
close to being able to map an individual human brain. Sell off things you
don't need, not playing your Xbox anymore. The problem with
most antivirus protection is that they only address viruses and exploits that have been identified and added to a"blacklist" of known viruses.

Pages

Add new comment