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.


10839 comments

events's picture

Revanche, fierte, avidite, colere, peur, sentiment de superiorite, si vous parvenez a faire ressentir
a vos opposants cette palette d'emotions negatives, vous parviendrez certainement a prendre l'ascendant psychologique sur eux.

Utah small business SEO's picture

Unfortunately, Google has stopped delivering a number of the information about what persons are searching for to analytics providers , but you should use SEM Rush (or related instruments, resembling SpyFu ) by yourself site to get a way of
the terms you are ranking for and their estimated search
volume. Google additionally makes a bit extra of this knowledge out there in their free Webmaster
Tools interface (if you haven't arrange an account, this can be a very priceless web optimization software both for unearthing search query
information and for diagnosing varied technical website positioning issues - extra on Webmaster Tools arrange
right here ).

delhi escort service's picture

If you wish for to grow your experience just
keep visiting this web page and be updated with the newest gossip posted here.

calebmpom059blog.tinyblogging.com's picture

We're an incredible little neighborhood middle and properly worth the drive even in case you don't stay close by!

https://garagedoorrepairportlandoregon.wordpress.com's picture

We work with 1st United Garage Doors, Amarr,
CHI Garage Doors, and extra. These great storage door manufactures have many nice
options to choose from to offer you a chunk of thoughts that the garage door you'll select
is the proper alternative to your property.

tree cutting erie pa's picture

Il existe certes des logiciels pirates mais nous vous
deconseillons fortement de vous y essayer sur quelque salle que ce
soit.

USA online casino's picture

Wow, superb blog layout! How long have you been blogging
for? you make blogging look easy. The overall look of your
web site is magnificent, as well as the content!

http://noellhxfm14blog.full-design.com/'s picture

As effectively as serving to you determine what to cook we will also
help you to prepare dinner it. From tips about cookery strategies to facts and details about health and nutrition, we have a wealth of foodie understand how so that
you can explore.

connortusp150blog.alltdesign.com's picture

You don't need to keyword stuff " and cram your core keyword and every potential variation of it into your alt attribute.

sale junk car's picture

I'm amazed, I have to admit. Rarely do I come across a blog that's both equally educative and
interesting, and without a doubt, you've hit the
nail on the head. The problem is something which too few folks are speaking intelligently
about. I'm very happy that I found this during my search for something relating to this.

My site - sale junk car

buy youtube views's picture

This post will help the internet people for creating new
webpage or even a blog from start to end.

Brasil Incesto's picture

C'est le meilleur bonus de poker en ligne, parce que vous n'avez pas besoin de faire un enorme depot initial.

porn's picture

Information related to the area and its owner, the certificate ssl
signifies that a person or company belongs, this data
is amount if you move any inconvenience, we have who claim.

cantinetta da Vino's picture

Hi there! 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 recommendations?

clash royale chest order's picture

ELIXIR - An in-recreation useful resource that can be used
on battles to drop troops, buildings, or spells from your chosen playing cards.

http://bateau-popop.com/'s picture

Hello, Neat post. There's an issue along with your website in web explorer,
may check this? IE nonetheless is the marketplace chief and a good portion of
people will leave out your fantastic writing because of this problem.

poste bmw e90: Video autoradio player top's picture

Mike was very helpful and talked me by way of my choices and absolutely defined the costs of any elective add-ons.

Printable Calendar Templates's picture

Each month is available for viewing by clicking on the tabs on the backside, in addition to
an overview of the year. Each day has ample space to jot down a notice and well-liked holidays are already marked.

Website traffic's picture

Hi, I do think this is an excellent website.
I stumbledupon it ;) I may return once again since i have bookmarked
it. Money and freedom is the greatest way to change, may
you be rich and continue to help other people.

cash for cars melbourne's picture

La succession a Joe McKeehen au palmares du Principal Evant des WSOP de Las Vegas
est ouverte mais la route est longue et qui sait passera peut-etre cette semaine par Winamax qui ce dimanche 8 mai va mettre en jeu trois pack pour Las Vegas comprenant les 10 000 dollars de purchase-in.

plastic surgeons in colombia's picture

Vous n'etes jamais aussi bon que sous la pression ?

the plank exercise's picture

A visual demonstration of the correct exercises and stretches for the
hamstring muscle mass which can be designed to bring relief for decrease again ache.

fuck's picture

Il n'y a absolument aucun frais pour participer a nos jeux d'argent fictif.

JAV Moodyz's picture

Les sites qui proposent a la vente des listes de mains passees auxquelles vous n'avez pas participe.

Rumchiropractic's picture

De cette somme le gagnant de la competition recevra
pres de 500.000EU et le runner-up 328.600EU.

asherlqhy167blog.blogkoo.com's picture

Burn fats fast with these five coronary heart-pumping workout routines Do every
exercise for 30 seconds, resting for 15 seconds between each move.
Do this circuit 3 times.

foods include grains's picture

Hello, yeah this paragraph is actually nice and I have learned lot of
things from it regarding blogging. thanks.

Raymon's picture

Dozens of gun storage gadgets, as well as locking gadgets that connect directly to
the gun, can be found. However, mechanical locking gadgets, just
like the mechanical safeties constructed into guns,
can fail and should not be used as a substitute for protected
gun dealing with and the observance of all gun safety
rules.

http://ryanasro048blog.tblogz.com's picture

For those who predict correctly, you earn a token bonus.

Florencia's picture

To qualify for a license in most states, applicants have to graduate from an accredited dental school and pass written and practical exams.

make money online's picture

I really am that individual, that someone on the market, that cares
enough handy you the money you want or need.

attorney's picture

Avec Party Poker tous les mois vous aurez droit a un tournoi avec Un million de
dollars garantis, vous pourrez vous qualifier a des satellites a partir de 1EU.
Tous les dimanches un tournoi Get together poker de seventy five
000EU garanti.

free javhd's picture

But when I moved down stakes, pots have been much smaller;
I was a lot more comfortable with the stakes.

robotics projects for elementary students's picture

With a Small Enterprise Innovation Analysis grant
from NSF, Bers started KinderLab Robotics and, utilizing insights from
her 15 years of research, reworked the KIWI prototype right into
a widely-accessible cyberlearning toy that could affect a lot of kids.

vacanze vallecamonica's picture

Good write-up. I definitely love this website. Keep it up!

Feel free to surf to my web-site ... vacanze vallecamonica

musically followers free's picture

Nice blog here! Also your web site loads up fast! What host are
you using? Can I get your affiliate link to your host? I wish my website loaded up as quickly as yours lol

Also visit my web blog musically followers free

Mbbs in Philippines's picture

Fantastic items from you, man. I have be aware your stuff prior to and you are simply
too great. I really like what you have got right here,
really like what you are stating and the best way
through which you say it. You make it entertaining and you
continue to care for to keep it wise. I can not wait to
read far more from you. This is actually a wonderful web
site.

Also visit my blog post: Mbbs in Philippines

male breast enlargement's picture

Essayez en premier lieu Texas Calculatem , c'est la reference en matiere de NL Texas Holdem : il
marche sur la plupart des grandes salles de poker en ligne francaise (Winamax, Pokerstars,
Everest, PMU Poker, and so forth.) et sur tout sort de desk.
Il coute moins de 50 euros par an (soit moins d'1 EU par semaine).

中学レベルの英語's picture

Ying Yu niQin simiwoChi teruyouninatutekurutoBen Dang niQiang iyaruQi gaYong kiChu tekurumonodesukedone. Ru Shi Shi Yan Deng dehaYing Yu noDe Dian deHe Fou noJie Guo gaBen Dang niZuo You saremasunode,Ying Yu wositukariXue Xi surebaYou Li tonarukotomoKe Neng desu.

15 Minute Manifestation's picture

of course like your web-site however you need to take a look at the spelling on quite a few of your posts.

Many of them are rife with spelling problems and I find it very bothersome to inform the reality
nevertheless I will certainly come again again.

Also visit my site; 15 Minute Manifestation

profit with a 30 year Mortgage over a 15 year Mortgage's picture

This design is incredible! You most certainly know how to keep profit with a 30 year Mortgage over a 15 year Mortgage reader entertained.
Between your wit and your videos, I was almost moved to start my own blog
(well, almost...HaHa!) Fantastic job. I really enjoyed what you had to say, and more than that, how you
presented it. Too cool!

meeti app's picture

It's an remarkable paragraph in favor of all
the online viewers; they will obtain benefit from it I am sure.

Feel free to visit my blog post; meeti app

marrakech desert tojrs 3 days's picture

Hello! I'm at work browsing your blog from my new iphone 3gs!
Just wanted to say I love reading through your blog and look forward to all your posts!

Carry on the great work!

Feel free to visit my web blog - marrakech desert tojrs 3 days

Narkoba's picture

Hi there friends, its fantastic paragraph on the topic of tutoringand fully defined, keep it up all
the time.

Blah Bedroom Into a Sexy Space's picture

It's great that you are getting ideas from this paragraph as well as
from our dialogue made at this time.

my blog - Blah Bedroom Into a Sexy Space

MacBook Pro 2017's picture

Having read this I believed it was rather informative.
I appreciate you finding the time and energy to put this article together.
I once again find myself spending a lot of time both reading and commenting.
But so what, it was still worth it!

Stop by my blog post; MacBook Pro 2017

kamagra's picture

Alors que dans une salle de jeu en ligne appelee aussi salle de jeu virtuel, le
joueur reste devant son ordinateur et ne peut discuter qu'avec les autres personnes presentes
sur la desk qu'en mode chat.

Kuala Lumpur Pilates's picture

There were one hundred thirty five,336 twin births in the United States in 2014, the newest 12 months for which knowledge is obtainable.
Meaning about 3.4% of all infants born that 12 months had
been twins--a record excessive, in line with the United States Centers for
Disease Control and Prevention.

Frost Vs Frieza Tournament Of Power's picture

I am not sure where you're getting your information, but good topic.
I needs to spend some time learning much more or understanding more.
Thanks for wonderful info I was looking for this info for
my mission.

Feel free to visit my blog post - Frost Vs Frieza Tournament Of Power

vouchercodesblog's picture

Why users still use to read news papers when in this technological
globe everything is accessible on net?

Here is my blog post: vouchercodesblog

Pages

Add new comment