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.


6883 comments

butu projektas's picture

These and all different logos used in this work are the property of their
respective owners.

bli av med finnar's picture

Thanks a bunch! It is definitely an imprwssive աebpage.

steam keys's picture

Hi it's me, I am also visiting this website on a regular basis, this web site is really good and the users are truly sharing good thoughts.

game dev tycoon steam's picture

I just like the helpful info you supply on your articles.

I'll bookmark your weblog and test again right here regularly.
I'm reasonably sure I'll be told plenty of new stuff right
right here! Good luck for the following!

nextwin.co's picture

I would like to point out my gratitude for your kindness supporting those people
who really want help with your matter. Your very own dedication to passing the
message all over appeared to be exceptionally good
and have consistently empowered individuals like me to achieve their targets.
Your personal informative publication implies so much a person like
me and still more to my office colleagues. Warm regards; from everyone of us.

pret rapide's picture

Vous etes autorise a beneficier de financement approprie entre
eighty $ a 1000 $ avec le pret personnel de mauvais credit a
montreal.

http://alexander691rerdblog.soup.io/post/631812400/An-'s picture

It was a Sunday, Cesar came at time set, very personable
and professional. Wouldn't hesitate to call once more.
~ Cheryl S. - McDonough, GA.

Irwin's picture

Signature alleges, however, that the corporate defendant insurer breached the contract of insurance coverage, dedicated ''dangerous-faith,'' breached
its fiduciary duty to its insured, committed unfair trade practices, intentionally inflicted emotional misery and vexatiously refused to pay.

Monte's picture

When instructing LinkedIn workshops, I ... Proceed reading - The put up Accepting LinkedIn Invitations appeared first
on Time2Mrkt.

build your wedding website's picture

Good post. I learn something totally new and challenging on blogs I stumbleupon on a
daily basis. It will always be helpful to read
articles from other authors and practice a little
something from their sites.

wall-papers.info's picture

Howdy! I know this is somewhat off topic but I was wondering which blog platform are
you using for this site? I'm getting tired of Wordpress because I've had problems with hackers and I'm looking at options for another platform.

I would be great if you could point me in the direction of
a good platform.

wurm unlimited free steam key's picture

I'm impressed, I must say. Seldom do I come across a blog that's both equally educative and engaging, and without a doubt,
you've hit the nail on the head. The issue is something not enough men and women are speaking
intelligently about. Now i'm very happy I found this in my search for something relating to this.

Gregorio's picture

Thanks for a marvelous posting! I seriously enjoyed reading it, you
will be a great author.I will make certain to bookmark your blog and may come back at some point.

I want to encourage you to ultimately continue your great writing, have
a nice holiday weekend!

catering toronto's picture

Hi would you mind sharing which blog platform you're using?
I'm looking to start my own blog soon but I'm having a tough time deciding 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 completely unique. P.S My apologies for being off-topic but I had to ask!

Donnie's picture

My programmer is trying to convince 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 Movable-type on a variety of websites for about a year
and am anxious about switching to another platform.
I have heard very good things about blogengine.net.

Is there a way I can transfer all my wordpress content into it?
Any kind of help would be really appreciated!

dungeon defenders steam key's picture

I'm not that much of a online reader to be honest
but your sites really nice, keep it up! I'll go ahead and bookmark
your site to come back down the road. All the best

emergency 2016 steam key's picture

We're a gaggle of volunteers and starting a new scheme in our community.
Your web site provided us with valuable information to work on. You've done
an impressive job and our whole community will likely be grateful to you.

empire total war free steam key's picture

Does your website have a contact page? I'm having
a tough time locating it but, I'd like to send you an e-mail.
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 expand over time.

company of heroes 2 the british forces free steam key's picture

What's up mates, how is the whole thing, and what you want to say on the topic of this piece of writing, in my view its genuinely
awesome in favor of me.

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

Hmm it appears 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
tips and hints for beginner blog writers? I'd really appreciate it.

wolfteam hack 2015's picture

Hi there just wanted to give you a quick heads up.
The words in your article seem to be running off the screen in Firefox.
I'm not sure if this is a format issue or something to
do with internet browser compatibility but I thought I'd post
to let you know. The design and style look great though!

Hope you get the problem fixed soon. Many thanks

bitly's picture

Hello, i think that i noticed you visited my weblog thus i got here to go back the desire?.I'm trying to to find issues to enhance my website!I guess its ok to use some of
your concepts!!

miscreated steam's picture

Hi there! Someone in my Myspace group shared this site with us so I came to
look it over. I'm definitely enjoying the information. I'm bookmarking and will be tweeting this to my followers!
Fantastic blog and excellent design.

Roxana's picture

I not to mention my pals appeared to be checking out the best secrets on your web page and then all of a
sudden developed an awful feeling I never thanked the site owner for those techniques.

These people happened to be absolutely joyful to learn all of them and already have unquestionably
been enjoying those things. Thank you for actually being well thoughtful and then for utilizing this form of notable themes most people are really desirous to understand about.
Our sincere regret for not expressing gratitude to
earlier.

supreme commander steam's picture

Pretty nice post. I just stumbled upon your weblog and
wanted to say that I have really enjoyed browsing your blog posts.

After all I'll be subscribing to your feed and I hope you write again soon!

mirrors edge free steam key's picture

Hello, I think your site might be having browser compatibility issues.
When I look at your website in Firefox, it looks fine but when opening in Internet Explorer, it has some overlapping.
I just wanted to give you a quick heads up!
Other then that, fantastic blog!

cleanse colon 100's picture

That is a very good tip particularly to those fresh to the blogosphere.
Brief but very precise information... Appreciate your
sharing this one. A must read article!

sample marketing strategies's picture

I love reading blogs such as this! Causes me to experience an emotion that is
cozy satisfying and in addition educated! Thank you so much!

ielts reading tips and tricks video's picture

Using. (6).

fortresscraft evolved free's picture

Appreciate this post. Let me try it out.

clash of clans cheat's picture

Do by no means ever enter your App Store or Play Store username and password in these program and
sites!

kerbal space program free's picture

Asking questions are truly fastidious thing if you are not understanding something completely,
however this article presents good understanding even.

civilization iv beyond the sword steam's picture

It's going to be end of mine day, however before end I am reading this great article to increase my knowledge.

blackguards steam key's picture

Very nice article. I definitely love this website.
Continue the good work!

ricochet steam'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 site when you could be giving us something informative to read?

project cars free's picture

Hello, i think that i saw you visited my blog thus i came to "return the favor".I'm trying
to find things to improve my site!I suppose its ok
to use some of your ideas!!

star wars jedi knight mysteries of the sith steam key's picture

Great beat ! I would like to apprentice while you amend your
website, how can i subscribe for a blog website?
The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear concept

cupcake.freehostia.com's picture

Its like you read my mind! You seem to know
a lot about this, like you wrote the book in it or something.

I think that you could do with some pics to drive thhe message home a bit, but instead of that, tthis is fantastic blog.
A great read. I'll certaimly be back.

Pensacola Airport Shuttle to Gulf Shores's picture

That is the perfect shuttle service I've ever used!!!!

victoria i complete free steam key's picture

My partner and I absolutely love your blog and find nearly all of your post's to be exactly what
I'm looking for. Does one offer guest writers to write content for you
personally? I wouldn't mind publishing a post or elaborating on a number of the
subjects you write concerning here. Again, awesome website!

dawn of war ii retribution the last standalone free's picture

I've learn some just right stuff here. Certainly price bookmarking for revisiting.
I surprise how a lot effort you place to make the sort of
fantastic informative website.

middle earth shadow of mordor free steam key's picture

WOW just what I was looking for. Came here by searching for warcraft cracks

Woodrow's picture

Although most courts have particular professional hac vice guidelines for such events, the lawyer will nonetheless have
to take care of a special set of professional duty rules, in addition to the opportunity
of other variations in substantive and procedural regulation.

nekopara vol. 1 free steam key's picture

Hi there, I discovered your website by the use of Google whilst searching for a related topic, your website came
up, it appears to be like great. I've bookmarked it in my google bookmarks.

Hi there, just changed into aware of your blog via Google, and located that it is truly informative.
I'm gonna watch out for brussels. I will be grateful in case you continue this
in future. Numerous people shall be benefited from your writing.

Cheers!

the jackbox party pack 2 steam key's picture

Woah! I'm really loving the template/theme of this website.
It's simple, yet effective. A lot of times it's very difficult to get
that "perfect balance" between user friendliness and visual appearance.

I must say you've done a great job with this.

In addition, the blog loads very quick for me on Internet explorer.

Excellent Blog!

la storm alert's picture

Includes limitless streaming of La Foudre by way of the free Bandcamp app, plus high-high quality
download in MP3, FLAC and extra.

farming simulator 15 steam key's picture

Whoa! This blog looks exactly like my old one! It's on a totally different subject but it has pretty much the same layout and design. Great choice of colors!

mass effect steam key's picture

Its like you read my mind! You seem to know a lot about this, like you wrote the
book in it or something. I think that you can do with some pics to
drive the message home a little bit, but other than that, this is magnificent blog.
A great read. I will certainly be back.

sins of a solar empire rebellion steam's picture

It's awesome to visit this site and reading the views of
all friends about this paragraph, while I am
also zealous of getting experience.

game dev tycoon steam's picture

Somebody essentially lend a hand to make significantly articles I might state.
This is the very first time I frequented your web page and so far?
I amazed with the analysis you made to make this particular submit extraordinary.
Wonderful task!

Pages

Add new comment