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.


10706 comments

เรือนไทยแต่งงาน's picture

Hello there! Would you mind if I share your blog with
my zynga group? There's a lot of people that I think would really enjoy your content.
Please let me know. Thank you

escorts in Birmingham's picture

Everyone loves what you guys are up too. This type of clever work
and reporting! Keep up the awesome works guys I've incorporated you guys to my personal blogroll.

pirater un compte facebook gratuitement en ligne's picture

I for all time emailed this web site post page to all
my associates, since if like to read it after that my links will too.

style's picture

Post writing is also a fun, if you be acquainted with then you can write if not it is difficult to write.

innovation's picture

It's very effortless to find out any topic on net as compared to books, as I found this article at this website.

W88 link vao's picture

Hello, always i used to check website posts here early
in the break of day, since i like to find out more and more.

telecommunications training courses's picture

Thanks for sharing your thoughts. I truly appreciate your
efforts and I will be waiting for your next post thank you once again.

best power bank's picture

Nice post. I learn something new and challenging on sites I stumbleupon every day.

It's always useful to read content from other authors and use something from their websites.

aparat ortodontic's picture

Definitely imagine that that you said. Your favourite justification seemed to be on the net the simplest thing to bear
in mind of. I say to you, I certainly get annoyed while other people think about worries that they plainly don't recognize about.
You managed to hit the nail upon the top and outlined out the whole thing without having
side-effects , other folks could take a signal.
Will probably be again to get more. Thanks

15 Minute Manifestation's picture

Wonderful, what a website it is! This webpage gives
helpful information to us, keep it up.

update internet explorer's picture

If you are going for best contents like me, simply visit this website all the time since it
presents quality contents, thanks

http://bit.ly/'s picture

Hello to all, the contents existing at this website are actually
awesome for people experience, well, keep up the good work fellows.

Electricians Crawley's picture

It's a shame you don't have a donate button! I'd most
certainly donate to this brilliant blog! I guess for now i'll settle for book-marking and adding
your RSS feed to my Google account. I look forward to brand new updates and will share this website with my Facebook
group. Chat soon!

best baby strollers 2017's picture

Thanks for sharing your info. I truly appreciate
your efforts and I will be waiting for your further write ups thank you once again.

Boost alexa ranking's picture

Your method of explaining the whole thing in this piece of writing is genuinely nice, all be able to
effortlessly understand it, Thanks a lot.

iptv private server's picture

Hi to every single one, it's in fact a good for
me to pay a visit this website, it consists of important Information.

la lotería del millón's picture

El caso es que tras navegar en la nasa, me he antagonico con un video.

Feel free to visit my page la loteria del millon

warhammer 40000 space wolf hack's picture

In these tracks, many many of them are good winners. So with this type of bet you will
expect a much higher payout compared to other horse betting
types since you have to predict in exact on which horses would comes first or
second. With this game the player learns the importance of
obeying rules.

lustige bilder zum totlachen's picture

Somebody necessarily help to make seriously articles I would state.

This is the first time I frequented your web page and up to now?
I surprised with the research you made to create this particular put up incredible.
Excellent task!

http://www.reddit.com/r/HackzAndCheatz/related/2wo7wn/new_'s picture

In this respect Nook looks to be a winner as
it capabilities a micro - SD slot with which you
can run the hack and eliminate it to return to the unique configuration. I can assure you there will be this year, if I'm allowed to experience that again. If you want some help
with this tricky quest, then look here.

old school new body user reviews's picture

Remarkable! Its really amazing post, I have got much clear idea
regarding from this post.

marvel contest of champions generator's picture

Nice Crush's almost all extraordinary capture is outfitting an excellent gameplay practical knowledge, as well as to produce people think that many people owe
funds with regard to acquiring suc. See, the problem with
this is if you try to learn so much in a short amount of time, you will suffer of
what I call 'Brain info overload'. We finally decided to actually release this cheats hack tool under free license, so just carry out generally
survey as well as, producing take advantage of of the
Candy Crush Saga Hack.

battle camp trainer's picture

The (ESRB) Entertainment Software Rating Board was established in 1994 through the
Entertainment Software Association. The free version of Robo - Form
provides a lot of the same functionality as Robo - Form Pro--prospective
users should try the free version to see if it covers their needs before spending $30 on Robo -
Form Pro. According to the Tech - TV Show "Talkback", Cell
phones show where you are, and.

Clash Of clans hack's picture

Magnificent beat ! I wish to apprentice while you amend your site,
how could i subscribe for a blog site? The account helped me a acceptable deal.

I had been tiny bit acquainted of this your broadcast
provided bright clear idea

My web site - Clash Of clans hack

David Drwencke's picture

I couldn't resist commenting. Very well written!

game of war fire age hack tool's picture

An important feature about this battle camp hack such as hack tools is that they are easy to use, the device link is really fast, no jailbreaks are
needed, compatible with almost all the devices etc. Layout
- Nook Color and Kindle Fireplace each characteristic straightforward design and style with
a excellent holdability factor. father's interview on TV, but it
turns out that you were too late.

landscaping ideas front house's picture

Transition or sequence creates visual motion in landscape design. If you find it's difficult for you to install by yourself, you can hired a professional to install
these Sprinkler systems for you quickly and easily. Consequently, individuals have two choices:
They can bite the bullet and pay whatever it takes to get their front yard up to snuff, or they can see if
they can do some or all of the work themselves.

landscape ideas for front of house's picture

I saw firsthand who was making money and who wasn't, what worked and what didn't, what people wanted that wasn't available and what was to easy to find but wasn't wanted.
If you find it's difficult for you to install by yourself, you can hired a professional
to install these Sprinkler systems for you quickly and
easily. Chances are you rent or lease the property upon which your business is located,
and really have no idea about the types of trees and shrubs that are planted and why they are planted where they are.

comment pirater Un compte facebook de quelqu&#039;un's picture

Good dayy I aam sso happy I found your website, I really found you by error, while
I was looking on Gooogle for somethinjg else, Anyhow I am here
now and ould just like to say thanks a lot for a incredible
post and a all round thrilling blog (I also lovge the theme/design),
I don't hae ttime to read it all at the moment butt
I have saved it and aloso included your RSS feeds, so when I have time I wll be back to read much more, Please do keep upp the
excellent work.

m88's picture

Heolo there! This post could not be writtn any better! Reading this powt reminds me of my good old room mate!
He always kept chatting about this. I will forward
this page too him. Pretty sure he wikl have a giod read.Thanks for sharing!

Feel free to surf to my blog post :: m88

Hire a photographer's picture

I have been browsing online more than 3 hours nowadays, yet I
never discovered any attention-grabbing article like yours.
It's lovely value sufficient for me. In my opinion, if all webmasters and bloggers made good content as you probably did, the net shall be a lot more useful than ever before.

Boom Beach Hack's picture

Hi, yeah this post is in fact nice and I have learned lot
of things from it regarding blogging. thanks.

hpr.is's picture

?hat's sp, ? read your blogs like every week. Your writing style
idz witty, keep up the good w?rk!

blood brothers cheats's picture

Go Personal: have personalized candies made either in the form of individual sweets in printed wrappers or large bars iced with your
names and wedding date. At the time it was America's largest community of German immigrants.
In the Kalash Valley, in the May festival held to welcome spring, the local inhabitants (who are said to be descendants of soldiers from Alexander the Great's soldiers) take offerings of misri and dried fruit to
the fairies which they believe live in the area.

gamerbox.pt'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 bit, but other
than that, this is magnificent blog. A great read.

I'll certainly be back.

local green energy's picture

Hello there, just became aware of your blog through Google,
and found that it's truly informative. I am gonna watch
out for brussels. I will be grateful if you continue this in future.

Lots of people will be benefited from your writing. Cheers!

The Peoples Court 2014's picture

When someone writes an paragraph he/she keeps the image of a user in his/her
brain that how a user can know it. Thus that's why this paragraph is amazing.

Thanks!

Darian Braun New York's picture

So coconut oil is not only good for your skin but also for your hair.
Tender coconut water increases glow and fairness of skin. If you don't know, a
pre-poo is a treatment you put on your hair before you shampoo it.

David Drwencke's picture

Thank you for the auspicious writeup. It if truth be told was a amusement account
it. Look complex to far delivered agreeable from you!
However, how can we keep in touch?

amateur teen sex's picture

Do yos mind if I quote a feew of your posts aas long as I provide credit andd sources back to
your weblog? My blog is in the exact same area
of interest as youjrs and my users woupd genuinely benefit from a lot of the information yos provide here.
Please let me knoo if this alright with you. Thanks a lot!

comment pirater un compte facebook's picture

I'm not that much of a online reader to be honest but your sites realply nice, keep it up!
I'll go ahead and bookmark yohr website to come back later.
Cheers

star wars commander cheats's picture

Dressing up in kilts, playing or listening to bagpipes, tying Celtic knots
and proudly displaying Clan mottos, plants and badges. To go astray in the Leeds castle maze for
which there were planted about 2500 yews. It's an area boasting outstanding beauty and an array of wildlife, with the local marshlands heading towards the coastline being designated as a protected nature reserve.

ace fishing wild catch hack's picture

If the above equipment is correctly fitted and worn religiously while practicing, training and racing injury can be minimised or even prevented in the case of a minor or even serious fall.
Leveraging geoarbitrage as a life hack will certainly improve the quality of
your life. If you do not favor a particular driver, you
can show your spirit with a popular NASCAR car manufacturer's logo.

steam wallet hack's picture

With the static IP address from the VPN for Macau
prevents this from happening thus saving
you from a lot of hassle. We usually use the default values of 30 minutes by clicking
OK. Glyphs are a highly competitive market where you need to undercut your competition and hit a
niche where no one else is making a specific (but needed) glyph.

David Drwencke's picture

Hey there, I think your blog might be having browser compatibility issues.
When I look at your blog in Ie, 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, terrific blog!

landscaping front house's picture

When you decide on an area to plant a plant, make sure it can thrive there.
For the homeowner, recycled plastic paving stones offer several benefits.
Any business you want to start needs to begin with a business plan.

click to investigate Phoenix DUI lawyer's picture

Thank you for some other fantastic article. The place else may
anyone get that kind of info in such a perfect means of writing?
I have a presentation subsequent week, and I am at the search for such info.

vaginal dryness's picture

It's impressive that you are getting ideas from this piece of writing as well
as from our argument made here.

my singing monsters cheats's picture

Do you think there's too much mixing between Star Wars
and Star Trek already. In recent times the games that have come closest to really taking advantage of the source
matter were the Elite Force series of games, and those were both first person shooters, competent games that were fun, but Star Trek has
never been about the action. It would be perfect to take on a
vacation or even a trip to the Disney parks.

steamwallethack2015.wordpress.com's picture

This has been possible due to the efforts of the developers that are operational in different parts of NCR.
-Self-destruct emails, like Spamex, Temp - EMail and Shit
- Mail. It is not enough to simply use one technique; itmust be a mix and meet the minimum number of characters.

Pages

Add new comment