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.


7944 comments

organic tea's picture

excellent post, very informative. I wonder why the other experts of this sector do not understand this.
You should proceed your writing. I'm sure, you've a huge readers' base already!

How to Sell Your House Fast's picture

I'm curious to find out what blog platform you are working with?
I'm experiencing some small security problems with my latest website and I would like to find something more risk-free.
Do you have any suggestions?

Website Design Yeovil's picture

Incredible story there. What happened after? Take care!

bike chain lock's picture

I'm really loving the theme/design of your site.

Do you ever run into any internet browser compatibility problems?

A small number of my blog visitors have complained about my blog not working correctly in Explorer but looks great in Chrome.
Do you have any tips to help fix this problem?

bacnet mstp to ip router's picture

If some one desires expert view regarding running a
blog afterward i propose him/her to go to see this weblog, Keep up the nice job.

aircraft maintenance's picture

Keep this going please, great job!

tamper evident tape's picture

Excellent way of describing, and nice post to obtain data about my presentation focus, which
i am going to convey in college.

corex's picture

Good post. I learn something new and challenging on websites I stumbleupon on a daily basis.

It will always be useful to read articles from other writers and practice a little something from other sites.

jet ski in miami beach's picture

Awesome! Its really awesome post, I have got much clear idea on the topic of from this paragraph.

huisstijl design's picture

Hi there! This post could not be written much better!
Reading through this post reminds me of my previous roommate!
He constantly kept preaching about this. I will send this post to him.

Fairly certain he's going to have a good read.
Thanks for sharing!

website design's picture

Hi there would you mind sharing which blog platform you're working with?

I'm planning to start my own blog soon but I'm having a hard time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most blogs and I'm
looking for something unique. P.S Apologies for being off-topic
but I had to ask!

Emily Goodman Shortall's picture

This piece of writing provides clear idea in favor of the new visitors of blogging, that truly how to do
blogging and site-building.

Dildo's picture

I loved as much as you'll receive carried out right here.
The sketch is attractive, your authored material stylish.
nonetheless, you command get bought an nervousness over that you wish be delivering the following.
unwell unquestionably come further formerly again as exactly the same nearly a lot often inside case you shield this hike.

Electrician's picture

hi!,I love your writing very a lot! percentage we keep up a correspondence more about
your article on AOL? I require an expert in this space to resolve
my problem. Maybe that's you! Looking ahead to see
you.

Double Glazing Kit's picture

These are actually great ideas in on the topic of blogging.

You have touched some good factors here. Any way keep up wrinting.

Shylesh Kandiah's picture

I've been exploring for a little bit for any high-quality articles or
blog posts on this sort of space . Exploring in Yahoo I finally stumbled upon this web site.
Reading this info So i am glad to show that I have a very just right uncanny feeling
I found out just what I needed. I most for sure will make certain to don?t
disregard this site and give it a look regularly.

Custom church apps'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
at this time.

hair growth products for men's picture

I am really thankful to the owner of this web page who has shared this fantastic paragraph at here.

ivanka mcdonagh Drink driving's picture

Hello, i think that i noticed you visited my web site so i got here to
go back the favor?.I'm attempting to find things to enhance my site!I guess its adequate to
make use of some of your concepts!!

Clinton's picture

hi!,I love your writing very so much! percentage we communicate more
approximately your post on AOL? I need a specialist on this house to unravel my problem.
Maybe that's you! Having a look forward to look you.

iphone adapter splitter's picture

Hi there would you mind sharing which blog platform you're using?

I'm looking to start my own blog in the near future but I'm having a hard time deciding between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design and style seems different then most blogs and I'm
looking for something completely unique. P.S Apologies
for being off-topic but I had to ask!

W88 Thailand's picture

Hi there! Someone in my Myspace group shared this site with us so I came to give it a look.
I'm definitely loving the information. I'm bookmarking
and will be tweeting this to my followers! Exceptional blog and wonderful design.

naturopathic medicine's picture

wonderful publish, very informative. I'm wondering why the opposite specialists of this sector don't realize this.
You should continue your writing. I'm confident, you have a huge readers' base already!

Casino m88's picture

Thanks on your marvelous posting! I certainly enjoyed reading it, you
could be a great author.I will remember to bookmark your blog and definitely will come back very soon. I want to encourage
you to continue your great writing, have a nice morning!

Boutique style's picture

Hmm it seems like your site ate my first comment
(it was extremely long) so I guess I'll just sum it
up what I had written and say, I'm thoroughly enjoying your blog.
I too am an aspiring blog blogger but I'm still new to everything.
Do you have any recommendations for newbie
blog writers? I'd definitely appreciate it.

Quality Interior and Exterior Painting's picture

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

Fuzzy critters android's picture

I used to be suggested this website by way of my cousin.
I am not certain whether or not this publish is written by means
of him as no one else recognize such detailed about my trouble.
You are amazing! Thank you!

undercover's picture

Please let me know if you're looking for a author for your blog.
You have some really great articles and I think 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 e-mail if interested.
Regards!

dakimakura's picture

Write more, thats all I have to say. Literally, it
seems as though you relied on the video to make your point.
You obviously know what youre talking about, why waste your intelligence on just posting videos to your blog when you could be giving us something informative
to read?

rent 2 bedroom apartment mississauga's picture

I like the valuable information you provide in your
articles. I will bookmark your weblog and check again here frequently.
I'm quite sure I will learn lots of new stuff right here!
Good luck for the next!

miami brickell vacation rentals's picture

Hello very nice site!! Guy .. Excellent .. Superb ..
I'll bookmark your site and take the feeds also? I'm happy
to search out a lot of helpful info right here in the put up, we'd like work out more techniques
on this regard, thanks for sharing. . . . .

.

Harley Quinn Cosplay's picture

This paragraph is actually a nice one it assists new web people, who are wishing
for blogging.

sexy's picture

Thanks for sharing your info. I really appreciate your efforts and I am waiting for
your further post thank you once again.

Fidget slime's picture

Hello to every body, it's my first go to see of this website; this webpage carries amazing and in fact fine information designed
for readers.

Breast pumps's picture

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

dvi to hdmi's picture

Howdy just wanted to give you a quick heads up. The words in your content seem to be running off the screen in Internet explorer.
I'm not sure if this is a formatting issue or something to do with
web browser compatibility but I thought I'd post to let you
know. The style and design look great though! Hope you get the issue fixed soon. Thanks

displayport to hdmi's picture

You made some decent points there. I looked on the web to find out more about
the issue and found most individuals will go along with your views on this
web site.

Seven Colored Earth's picture

I really love your site.. Pleasant colors & theme.

Did you build this amazing site yourself? Please reply back as I'm
trying to create my own site and want to know where you got this from or just what the theme is called.
Appreciate it!

Find carlkruse over on dribble.com's picture

Hey I know this is off topic but I was wondering if you knew of any widgets I could
add to my blog that automatically tweet my newest
twitter updates. I've been looking for a plug-in like this for quite some time and was hoping maybe you would have
some experience with something like this. Please let me
know if you run into anything. I truly enjoy reading your blog and I look
forward to your new updates.

classic's picture

It's going to be end of mine day, but before ending I am reading this wonderful article to
increase my know-how.

cardigan's picture

I think everything published was actually very logical. But, think about
this, suppose you added a little content?

I ain't saying your information isn't solid., but suppose you added something to possibly get a person's attention?
I mean Add new comment | Shaneware.biz is a little vanilla.
You ought to glance at Yahoo's front page and watch how they create news headlines to
get viewers to click. You might add a video or a related picture
or two to get readers interested about everything've got to say.
In my opinion, it might bring your posts a little livelier.

Pharmapex's picture

Fine way of explaining, and fastidious article to obtain data regarding my presentation topic, which i
am going to present in institution of higher education.

fidget spinner tricks's picture

Simply wish to say your article is as amazing. The clearness in your post is simply cool and i can assume you are an expert
on this subject. Well with your permission let me to grab your
feed to keep updated with forthcoming post. Thanks a million and please
keep up the enjoyable work.

Temporary surface protection's picture

Thank you for any other informative blog. Where else may just I am getting that type of information written in such an ideal approach?
I have a venture that I'm simply now operating on, and
I've been at the look out for such info.

Floor protector roll's picture

hello!,I really like your writing very so much!
share we be in contact extra about your post on AOL?
I need a specialist in this house to unravel my problem.
Maybe that's you! Looking ahead to see you.

gold truck rims's picture

Thanks for some other informative website.
The place else may I get that kind of info written in such a perfect method?
I've a project that I'm just now operating on, and I've been at
the look out for such information.

togel sgp's picture

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

w88fa's picture

Link exchange is nothing else but it is only placing
the other person's webpage link on your page at suitable place and other
person will also do similar in favor of you.

technal veranda's picture

It's a shame you don't have a donate button! I'd certainly donate
to this excellent blog! I guess for now i'll settle for book-marking and adding your RSS feed to
my Google account. I look forward to fresh updates and will
talk about this site with my Facebook group.

Chat soon!

rake steam's picture

It's very effortless to find out any matter on net as compared to textbooks, as
I found this piece of writing at this web page.

Pages

Add new comment