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

cycling glasses's picture

Thank you for the auspicious writeup. It in fact was
a amusement account it. Look advanced to far added agreeable from
you! However, how could we communicate?

Franco Parrella's picture

excellent issues altogether, you just gained a logo new reader.

What might you suggest about your put up that you just made some days ago?
Any sure?

http://hajitaman.com/'s picture

I simply could not go away your website prior to suggesting that I actually loved the usual information a person supply for your visitors?

Is gonna be again continuously to check out new posts

plumbing and heating company's picture

You can certainly see your skills within the article you write.
The sector hopes for even more passionate writers such as you who aren't afraid to mention how they believe.
All the time go after your heart.

Mimosa brunch's picture

It's fantastic that you are getting ideas from this paragraph as well as from our argument
made here.

improved home environment's picture

Hi there, yup this paragraph is genuinely
fastidious and I have learned lot of things from it about blogging.
thanks.

undercover advertising agency's picture

Thank you for sharing your thoughts. I truly appreciate
your efforts and I will be waiting for your next write ups thanks
once again.

touchless car wash equipment's picture

Thanks for sharing your thoughts on touchless car wash equipment.
Regards

plumbing company's picture

Hello there! Quick question that's completely off topic.

Do you know how to make your site mobile friendly? My blog looks weird when viewing from my iphone 4.
I'm trying to find a template or plugin that might be able to resolve this problem.
If you have any suggestions, please share. Thanks!

Cannabis cocktail's picture

Great article! We are linking to this particularly great article on our site.
Keep up the good writing.

Florida property sale's picture

I just like the helpful information you provide in your articles.
I'll bookmark your weblog and test again here frequently.
I'm somewhat certain I'll be told plenty of new stuff right here!
Best of luck for the next!

flat chest love dolls's picture

I am extremely impressed with your writing skills and also with the layout on your weblog.
Is this a paid theme or did you customize it yourself?
Anyway keep up the nice quality writing, it's rare to see
a nice blog like this one these days.

Keeping Interest Resources's picture

What i don't realize is if truth be told
how you are not really much more well-favored than you
might be right now. You're so intelligent. You realize thus significantly on the subject of this topic, made
me in my view believe it from a lot of various angles.

Its like women and men aren't interested unless it's
one thing to accomplish with Lady gaga! Your personal
stuffs nice. All the time care for it up!

m88.com's picture

Way cool! Some extremely valid points! I appreciate you penning this post and the rest of the website is also really good.

www.blueharbourpropertymanagement.com's picture

You've made some really good points there.

I looked on the internet to find out more about the issue
and found most individuals will go along with your views on this web
site.

waist training corset's picture

This is very interesting, You're a very skilled blogger.
I have joined your feed and look forward to seeking more of
your fantastic post. Also, I've shared your web site in my social
networks!

kollegah billionaires club's picture

hey there and thank you for your info - I have definitely picked up anything new
from right here. I did however expertise several technical issues using this site, since
I experienced to reload the site many times previous to I could get it to load properly.
I had been wondering if your web host is OK? Not that I'm complaining, but slow loading instances times will sometimes affect your placement in google and could damage
your high quality score if ads and marketing with Adwords.
Well I'm adding this RSS to my e-mail and can look out for much more of your respective exciting content.
Ensure that you update this again very soon.

business directory Vancouver's picture

I am regular reader, how are you everybody? This post posted at this website is really nice.

台北隔熱紙推薦's picture

each time i used to read smaller articles that also clear their motive, and that is also happening with
this article which I am reading here.

high-quality Car Camera's picture

Do you mind if I quote a few of your posts as long as I provide
credit and sources back to your website? My blog site is in the very same niche
as yours and my users would genuinely benefit from a lot of the information you present
here. Please let me know if this ok with you. Appreciate it!

undercover advertising agency's picture

Howdy! This is kind of off topic but I need some advice from an established blog.
Is it difficult to set up your own blog? I'm not very techincal but I can figure things out
pretty fast. I'm thinking about creating my own but I'm not sure where to begin.
Do you have any ideas or suggestions? Cheers

Franco Parrella UNISA's picture

I have to thank you for the efforts you have put in writing this website.

I am hoping to view the same high-grade blog posts from you in the future as well.
In truth, your creative writing abilities has encouraged me to get my own website now ;)

how to get a thailand retirement visa's picture

Howdy just wanted to give you a quick heads up and let you
know a few of the images aren't loading properly.

I'm not sure why but I think its a linking issue.
I've tried it in two different web browsers and both show the same results.

digital marketing's picture

I don't know whether it's just me or if perhaps everybody else experiencing issues
with your website. It appears as though some of the written text
in 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 may be a problem with my web browser because I've had this
happen previously. Thank you

flat chest sex doll's picture

Very energetic blog, I loved that a lot. Will there be a part 2?

Taxi to Luzern's picture

Thanks in favor of sharing such a good thinking, paragraph is nice, thats why i have
read it completely

Social media Twitter's picture

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

travel raja ampat's picture

Usually I don't learn article on blogs, but I wish
to say that this write-up very pressured me to check out and
do so! Your writing style has been amazed me.

Thanks, very nice article.

callcenterqa.org reviews's picture

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

safari company's picture

Ahaa, its pleasant discussion concerning this post at this place at this weblog,
I have read all that, so now me also commenting here.

Troy Koubek's picture

Do you have a spam problem on this website; I also am a blogger,
and I was wondering your situation; we have developed some nice procedures and we are looking to trade
techniques with other folks, be sure to shoot me
an e-mail if interested.

Pork chop's picture

Right now it looks like Expression Engine is the preferred
blogging platform out there right now. (from what
I've read) Is that what you're using on your blog?

Suffolk County's picture

Woah! I'm really enjoying the template/theme of this blog.
It's simple, yet effective. A lot of times it's very difficult to get that
"perfect balance" between superb usability and visual appeal.

I must say you have done a amazing job with this.

Additionally, the blog loads very quick for me on Safari.
Excellent Blog!

where to go for holiday's picture

Hey There. I found your blog using msn. This is a very well written article.

I'll be sure to bookmark it and come back to read more
of your useful info. Thanks for the post. I will definitely comeback.

animeindo.tv's picture

Hi there, just wanted to mention, I loved this article.

It was practical. Keep on posting!

Celtic Shaman's picture

Hello, its pleasant post about media print, we all be aware of media is a impressive source of
data.

Senaida's picture

What i do not understood is if truth be told how you're now not really a lot more
smartly-preferred than you may be now. You are so intelligent.
You realize therefore considerably relating to this topic, made me in my opinion believe
it from numerous numerous angles. Its like men and women are not interested
except it's one thing to accomplish with Woman gaga! Your personal stuffs
nice. All the time care for it up!

maths online's picture

Good day! Do you know if they make any plugins to protect against hackers?
I'm kinda paranoid about losing everything I've worked hard on. Any
suggestions?

Taxi to Baden's picture

Simply wish to say your article is as astounding.
The clarity on your post is just great and that i could think
you are an expert on this subject. Well together with your permission allow me to snatch your RSS feed to stay up to
date with impending post. Thank you one million and please carry on the enjoyable work.

company registration in china's picture

I think the admin of this website is actually working hard for his web page, since here every information is quality based information.

Hyperlink to carlkruse.com's picture

Thanks designed for sharing such a nice thought, article is
nice, thats why i have read it completely

plumbing and heating company's picture

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

guest house close to's picture

Hmm it appears like your website ate my first comment (it was super long) so I guess I'll just sum it up what I wrote and say, I'm
thoroughly enjoying your blog. I as well am an aspiring blog blogger but I'm still new to everything.
Do you have any points for inexperienced blog writers?
I'd definitely appreciate it.

comparateur mini frigo's picture

Thanks to my father who shared with me concerning this web site, this weblog is in fact
awesome.

information about waste disposal's picture

My coder is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.

But he's tryiong none the less. I've been using WordPress on numerous websites for
about a year and am worried about switching to another platform.
I have heard great things about blogengine.net.

Is there a way I can transfer all my wordpress posts into it?
Any help would be greatly appreciated!

iPhone 7 plus splitter's picture

Remarkable! Its genuinely amazing article, I have got much clear idea concerning from this paragraph.

moba game's picture

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

台北隔熱紙推薦's picture

Hi there, You have done an excellent job. I will definitely digg it and personally recommend to my friends.

I'm sure they will be benefited from this web site.

Player vs player mobile game's picture

Keep on working, great job!

Taxi to Luzern's picture

Excellent post. I was checking continuously this blog and I'm impressed!
Extremely useful information specifically the last part :) I care for such information much.
I was seeking this certain info for a long time. Thank you
and good luck.

Pages

Add new comment