Tinderbox extra scripts


Continuing on from my previous two ramblings let's have a look at two scripts I use with my tinderbox setup. It may not be the best place but I decided to keep these within the tinderbox/scripts folder.

The first script is gencompilerenvfiles which I have expanded a little since my previous post.

#!/bin/sh cd /usr/local/tinderbox/scripts/etc/env rm build.* ## set CC options ############################################### for BNAME in `../../tc listBuilds | grep clang` do cat > build.$BNAME <<CCOPTIONS export CC=clang export CXX=clang++ export CPP=clang-cpp export NO_WERROR= export WERROR= CCOPTIONS done for BNAME in `../../tc listBuilds | grep gcc` do cat > build.$BNAME <<CCOPTIONS export CC=gcc export CXX=g++ export CPP=cpp export NO_WERROR= export WERROR= CCOPTIONS done ## set the ARCH ############################################### for BNAME in `../../tc listBuilds | grep i386` do cat >> build.$BNAME <<CCOPTIONS export ARCH=i386 CCOPTIONS done for BNAME in `../../tc listBuilds | grep amd64` do cat >> build.$BNAME <<CCOPTIONS export ARCH=amd64 CCOPTIONS done ## optionally set the CPUTYPE - fixes some build issues ############################################### if [ "$1" = "cpu" ] then for BNAME in `../../tc listBuilds | grep i386` do cat >> build.$BNAME <<CCOPTIONS export CPUTYPE=pentium2 CCOPTIONS done for BNAME in `../../tc listBuilds | grep amd64` do cat >> build.$BNAME <<CCOPTIONS export CPUTYPE=nocona CCOPTIONS done fi

So the changes since my previous post are fairly small and obvious - first I added NO_WERROR and WERROR which allows some ports to finish building that only generate warnings. Some ports are setup to treat warnings as errors causing the build to stop. While it can make sense with some ports, others it isn't of concern and only gets annoying that the builds stop and you take 10 minutes to figure out that it's all because of a simple warning.

The next change is the addition of ARCH - when building for the same arch as the base system this is of no concern but some ports have a problem building on an amd64 system when the compiler is generating x86 code. The ARCH definition overcomes that issue.

The other change is the conditional addition of CPUTYPE. This is added by calling the script with an argument of cpu. I found a couple of ports that have trouble compiling when targeting the minimum cpu features. While the cpu types used can be adjusted I chose pentium2 as the minimum 32bit as i686 is a common base but sometimes the lack of mmx causes problems, pentium2 is the next one up that has mmx support, pentium4 or prescott are other good choices if you know the minimum cpu your builds need to run on or if you need sse. For amd64 I chose nocona as the first Intel 64bit cpu, not sure that core2 would be any advantage but this can be changed to corei7 to include sse4.2 support. Other options for amd cpu's can be used if you want to test against amd specific features.

The other script I showed previously I called testbuilds.sh. I have expanded this script quite a bit and now call it compileport - while it is now a lot longer than the previous example it's not really more complex. The extra length is from many case and if statements than any real complexity. You can download it below if you want to use it or just read through it.

For the most part you should be able to figure it out based on the comments and help (-h) included within the script. To compile a port we want to know 4 things - sysversion arch compiler and port, sysversion arch and compiler default to current i386/amd64 and gcc/clang and can be left out if you wish to use that combination. That leaves us with specifying the port, giving a minimum of compileport -P <category/portname> to compile against 10-CURRENT.

A few bonus options for sysversion are for preset searches - all current stable and release should be obvious, with releng being a moving target based on system releases. Currently this is set to 9.0 8.3 and 7.4 - being the highest minor release of each major version. Over time this should be updated to include newer releases and drop the less than current releases. So when 9.1 goes beta or RC1 it would be added to the list and after release we can remove 9.0.

If you want to setup default values you can do that through environment variables, which can also be setup in your shell rc files like any other variable. So if you always compile for 9-STABLE you can set OPTBASEVERS to 9-STABLE and it will be used without you having to specify -B 9-STABLE every time. This is where the upper/lower case options come into play. If you have the OPTBASEVERS set to 9-STABLE then compileport -b 8-STABLE will build the port for both 9-STABLE and 8-STABLE but if you use compileport -B 8-STABLE then it will ignore the environment settings and just compile for 8-STABLE. The real advantage to environment settings comes when you want to compile a list of ports. This may be a preset list of all the ports you maintain or you can do something like -

setenv OPTPORTLIST `pkg_info -aoq` compileport -B all

will compile every port you have installed on your system with every tinderbox build you have setup - or -

setenv OPTPORTLIST `pkg_version -vL= | awk '{print $1}' | xargs pkg_info -oq` compileport -B 9-STABLE

will compile every port that needs updating against the 9-STABLE builds you have setup. This leads into what I plan to talk about in my next post - using tinderbox to build your own packages.


AttachmentSize
gencompilerenvfiles.bz2451 bytes
compileport.bz22.53 KB

1480 comments

schlong's picture

I really like your blog.. very nice colors & theme.
Did you design this website yourself or did you hire someone
to do it for you? Plz answer back as I'm looking to create my
own blog and would like to know where u got this from.
kudos

Michele Frazier's picture

Heya just wanted to give you a quick heads up and let you
know a few of the images aren't loading correctly.
I'm not sure why but I think its a linking issue.
I've tried it in two different browsers and both show the same outcome.

Michele Frazier's picture

I believe this is among the most important information for me.
And i'm satisfied studying your article. But wanna remark on few general issues, The web site taste is ideal, the articles is actually nice
: D. Excellent job, cheers

Sebastian Hirsch's picture

Hi there! I'm at work surfing around your blog from my new iphone!
Just wanted to say I love reading through your blog and look forward to all your posts!
Keep up the superb work!

Michele Frazier's picture

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

Lee Trotman's picture

I loved as much as you'll receive carried out right here.
The sketch is attractive, your authored material stylish.

nonetheless, you command get got an impatience over that
you wish be delivering the following. unwell unquestionably come more formerly again since exactly the same nearly very often inside case
you shield this increase.

Michele Frazier's picture

At this moment I am going to do my breakfast, afterward having my breakfast coming over
again to read more news.

Ian Leaf Fraudster's picture

you are in point of fact a good webmaster. The website loading pace is incredible.
It kind of feels that you're doing any distinctive trick.
Furthermore, The contents are masterwork.
you've done a fantastic activity on this matter!

Sebastian Hirsch's picture

This is really interesting, You are a very skilled blogger.

I've joined your rss feed and look forward to seeking more of
your magnificent post. Also, I've shared your website in my scial networks!

Lee Trotman's picture

Good answer back in return of this question with genuine arguments and explaining the whole thing regarding that.

Amir Mojiri London'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 later.
Cheers

Michele Frazier's picture

Thanks for finally writing about > Add new comment | Shaneware.biz
< Loved it!

Michele Frazier's picture

It's truly very complicated in thios active life to listen news
on Television, so I just use the web for that purpose, and take the
most up-to-date information.

Karl Jobst DDS's picture

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

But he's tryiong none the less. I've been using
Movable-type on several websites for about a year and am concerned about switching
to another platform. I have heard great things about blogengine.net.
Is there a waay I can import all my wordpress content into it?
Any kind of help would be really appreciated!

Richard Harborne's picture

What a data of un-ambiguity and preserveness of precious
know-how concerning unpredicted emotions.

food for freedom program's picture

Monster Hunter Freedom Unite is the mix between the two categories of action and role-playing.

Michele Frazier's picture

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

Gary Huffman's picture

Excellent weblog here! Also your site so much up fast!
What host are you using? Can I get your associate link to your host?
I wish my site loaded up as fast as yours lol

5 figure day program's picture

Putting a big keyword into your book title makes it more likely people will find your book on Google and Amazon.

michele frazier's picture

Thank you for sharing your info. I truly appreciate your efforts and I
am waiting for your further write ups thanks once again.

Lee Trotman's picture

I drop a leave a response whenever I especially enjoy a article on a site or I
have something to valuable to contribute to the conversation. It is triggered by the fire displayed in the article I read.
And after this post Add new comment | Shaneware.biz. I
was actually excited enough to drop a comment :-P I actually
do have some questions for you if it's allright.

Is it simply me or does it look as if like some of
the responses come across like they are comning from brain dead folks?
:-P And, if you are posting on other social sites, I would like to follow you.

Would you make a list the complete urls of your public sites
like your twitter feed, Facebook page or linkedin profile?

michele frazier's picture

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

michele frazier's picture

I pay a visit every day a few web pages and websites too read content, but this web site gives quality based
articles.

Agnes's picture

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

Maple's picture

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

Catherine's picture

Woah! I'm really loving the template/theme of this site.
It's simple, yet effective. A lot of times it's difficult to
get that "perfect balance" between usability
and visual appeal. I must say that you've done a excellent job
with this. Additionally, the blog loads super quick for me on Safari.
Excellent Blog!

Amir Mojiri London's picture

Wow, this article is pleasant, my younger sister is analyzing
these kinds of things, thus I am going to inform her.

Michele Frazier's picture

Hi, i read your blog from time to time and i own a similar one and i was just
curious if you gget a lot of spam feedback? If so how do you reduce it, any
plugin or anything you can recommend? I get so much lately it's driving me crazy so any help is
very much appreciated.

Gwen's picture

Just desire to say your article is as astonishing. The clearness in your post is just excellent and i can assume
you are an expert on this subject. Fine with your permission let me to grab your RSS
feed to keep updated with forthcoming post.
Thanks a million and please carry on the gratifying work.

Grady's picture

Simply desire to say your article is as astounding. The clarity in your post
is simply spectacular and i could assume you're an expert on this subject.
Fine with your permission allow me to grab your feed to keep updated with forthcoming post.
Thanks a million and please carry on the gratifying work.

sebastian hirsch's picture

I think the admin of this site is in fact working hard for his
web page, as here every data is quality based stuff.

.laozb14sm's picture

Hi, all is going well here and ofcourse every one is sharing information, that's genuinely fine, keep up writing.

the cinnamon hollow's picture

Good day! This post could not be written any better! Reading through
this post reminds me of my good old room mate! He
always kept chatting about this. I will forward this page to him.
Fairly certain he will have a good read. Thank you for sharing!

Fast Wealth Club's picture

What a information of un-ambiguity and preserveness of precious familiarity concerning unexpected feelings.

ig's picture

I used to be able to find good info from your articles.

Michele Frazier's picture

The other day, while I was at work, my cousin stole my iPad and tested to see if it can survive a 25 foot
drop, just so she can be a youtube sensation. My iPad is now broken and she has 83 views.

I know this is completely off topic but I had to share it
with someone!

Kali's picture

You are a very intelligent person!

accident cases's picture

You are so interesting! I don't think I've read through a single thing like that before.
So good to discover another person with some genuine thoughts on this
subject matter. Seriously.. thanks for starting this up.
This site is something that is required on the web, someone with a bit of originality!

intellux's picture

When I initially commented I clicked the "Notify me when new comments are added" checkbox
and now each time a comment is added I get three e-mails with the same comment.
Is there any way you can remove me from that service?

Thank you!

tickle's picture

Hmm it seems like your website ate my first comment (it was extremely long) so I guess
I'll just sum it up what I wrote 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 helpful hints for newbie blog writers?
I'd really appreciate it.

aspirant driving instructor's picture

Generally I don't learn article on blogs, but I
wish to say that this write-up very compelled me to try and do so!
Your writing style has been surprised me. Thank you, very nice post.

Sebastian Hirsch's picture

When I initially commented I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on each time
a comment is added I get 4 emails with the exact same comment.
Perhaps there is a means you are able to remove me from that service?
Cheers!

free online auto insurance quotes's picture

Hi there! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche.
Your blog provided us useful information to work on. You
have done a extraordinary job!

Hudson's picture

each time i used to read smaller articles or reviews that also clear their
motive, and that is also happening with this
post which I am reading at this place.

Jody Rookstool's picture

I'm really impressed along with your writing abilities as neatly as with the format on your blog.
Is that this a paid theme or did you modify it yourself?
Anyway stay up the excellent high quality writing, it's rare to look
a nice weblog like this one today..

Belen's picture

Please let me know if you're looking for a article
writer for your site. You have some really great posts and I believe I would be a good
asset. If you ever want to take some of the load off,
I'd love to write some material for your blog in exchange for a link back to mine.
Please send me an e-mail if interested.
Thanks!

Ian Leaf Fraudster's picture

Thanks for the marvelous posting! I quite enjoyed reading it, you can be a great author.I
will be sure to bookmark your blog and definitely will come back later in life.
I want to encourage one to continue your great job, have
a nice holiday weekend!

Sebastian Hirsch's picture

Wonderful post however I was wondering if you could write a
litte more on this subject? I'd be very thankful if you could elaborate a little bit more.
Kudos!

Richard Harborne's picture

Hello there, I discovered your site by the use of Google whilst
searching for a comparable matter,your web site came up, it appears
to be like good. I have bookmarked it in my google bookmarks.

Hi there, simply changed into aware of your blog through Google, andd
found that it's really informative. I'm going to watch out
for brussels. I will appreciate for those who proceed this in future.
Many folks will likely be benefited out of your writing.
Cheers!

Julienne's picture

Post writing is also a excitement, if you be acquainted with then you can write or else it is difficult to write.

Pages

Add new comment