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

1445 comments

Gary Huffman's picture

Hi there! This blog post couldn't be written much better!
Looking at this post reminds me of my previous roommate! He constantly
kept talking about this. I'll send this article to him.
Fairly certain he will have a good read. Thank you for sharing!

Sebastian Hirsch's picture

hi!,I like your writing very a lot! proportion we keep up a correspondence extra about
your post on AOL? I require an expert on this space to resolve my problem.
May be that is you! Having a look ahead to peer you.

Sebastian Hirsch's picture

Hi i am kavin, its my first time to commenting anywhere, when i read this article i thought i could also create comment due to this
brilliant paragraph.

sebastian hirsch's picture

Hi! I'm at work surfing around your blog from my
new iphone 3gs! Just wanted to say I love reading
your blog and look forward to all your posts! Keeep up the great work!

Sebastian Hirsch's picture

My brother recommended I might like this blog.

He was totally right. This post truly made my day.
You cann't imagine just how much time I had spent for this info!
Thanks!

Sebastian Hirsch's picture

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

Shayna's picture

I have to thank you for the efforts you've put in penning this website.
I really hope to view the same high-grade content by you later
on as well. In truth, your creative writing abilities has motivated me to get my very own site now ;
)

Michele Frazier's picture

I'd like to thank you for the efforts you have put in writing this website.
I'm hoping to check out the same high-grade
blog posts by you later on as well. In truth, your creative writing abilities
has motivated me to get my own, personal blog now ;)

cool hoodies for men's picture

I was pretty pleased to uncover this site. I wanted to thank you for
your time for this particularly wonderful read!!
I definitely savored every little bit of it and i also have
you saved as a favorite to see new things on your web site.

Sebastian Hirsch's picture

It's actually a nice and useful piece of information.
I'm happy that you just shared this useful information with us.

Please stay us up to date like this. Thank you for sharing.

Karl Jobst DDS's picture

It's really very difficult in this full of activity life to listen news on TV, thus I only use web for that reason, and obtain the most recent information.

Sebastian Hirsch's picture

Wow, that's what I was seeking for, what a information! present here at this web site, thanks admin of this site.

Michele Frazier's picture

It is the best time to make some plans for the future and it's time to be happy.
I have read this post and if I could I wish to suggest you
ssome interesting things or tips. Maybe you can write next articles referring to this article.
I want to read more things about it!

John Ross Jesensky's picture

What's up every one, here every person is sharing these kinds of familiarity, thus
it's fastidious to read this webpage, and I used to pay a quick visit this website daily.

Brandon Colker's picture

I am extremely impressed with your writing skills as
well as with the layout on your weblog. Is this a paid theme or
did you customize it yourself? Either way keep up the excellent quality writing, it's rare to see a
great blog like this one these days.

Vivalux Reviews's picture

I believe everything published made a ton of sense.
But, think on this, suppose you were to create a killer headline?
I mean, I don't want to tell you how to run your blog, however suppose you added
a headline that makes people want more? I mean Add new comment | Shaneware.biz is kinda vanilla.
You could peek at Yahoo's home page and see how they create post titles
to get viewers to click. You might try adding a video or a related pic
or two to get people interested about everything've written. In my opinion, it could bring your website
a little bit more interesting.

payday loans in california's picture

Keep on working, great job!

Ian Leaf's picture

I read this article completely about the comparison of newest and preceding technologies, it's awesome article.

Brandon Colker's picture

I know this web page presents quality dependent posts and additional stuff,
is there any other website which gives such information in quality?

Sebastian Hirsch's picture

I visit everyday a few web sites and sites to read
articles, except this weblog offers feature
based writing.

Sebastian Hirsch's picture

Hey I know this is off topic but I was wondering if you knew of any widgets
I could add to my blog that automatically tweet my newest twitter updates.
I've been looking for a plug-in like this for quite
some time and was hoping maybe you would have some
experience with something like this. Please let
me know if you run into anything. I truly enjoy reading your
blog and I look forward to your new updates.

Sebastian Hirsch's picture

My brother suggested I may like this blog. He used to be entirely right.
This post truly made my day. You cann't consider simply how
much time I had spent for this information! Thanks!

Kim Bettasso's picture

It is perfect time to make some plans for the future and it is time to be happy.

I have read this post and if I could I wish to suggest you few interesting things or suggestions.
Perhaps you could write next articles referring to this article.
I want to read more things about it!

Ian Leaf's picture

Hi there to every one, the contents existing at this web page are in fact
remarkable for people experience, well, keep up the good
work fellows.

outdoor aerobic exercise's picture

Every weekend i used to pay a quick visit this web page,
because i wish for enjoyment, as this this site conations genuinely good funny
information too.

Gary Huffman's picture

Hi there to every body, it's my first visit of this weblog; this webpage carries amazing and genuinely excellent
material in support of readers.

Gary Huffman's picture

What i don't understood is actually how you are not actually a lot more smartly-favored than you may be
right now. You are so intelligent. You already know thus significantly with
regards to this subject, made me personally consider it from so many
various angles. Its like men and women don't seem to
be fascinated until it is one thing to accomplish with Girl gaga!

Your personal stuffs nice. Always deal with itt up!

Gary Huffman's picture

Hi there!I could have sworn I've been to this site before
but after browsing through some of the post I realized it's new to me.
Anyhow, I'm definitely glad I found it and I'll be book-marking
and checking back frequently!

luxurious motorhome's picture

What's up, all the time i used to check weblog posts here in the early hours in the morning, because i love to gain knowledge of more
and more.

Sequoia Capital India Shailendra Singh's picture

I do not know if it's just me or if perhaps everybody else experiencing problems with your blog.

It appears as if some of the written text within your content are running off the screen. Can someone else please provide
feedback and let me know if this is happening to them as well?
This might be a issue with my browser because I've had this happen previously.
Cheers

production flies's picture

Pretty! This has been an extremely wonderful post.
Thanks for supplying this info.

Mammie's picture

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

Gary Huffman's picture

It's genuinely very complicated in this full of activity life to listen news on Television, so I just use world wide web for that purpose,
and get the most up-to-date information.

Ian Leaf's picture

Its such as you learn my thoughts! You seem to grasp so much
about this, like you wrote the book in it or something.
I believe that you simply can do with some % to power the message home
a little bit, but instead of that, this is fantastic blog. An excellent read.

I will certainly be back.

Gary Huffman's picture

Hello, Neat post. There is a problem along with your site in internet explorer, could check this?
IE still is the marketplace leader and a huge part of people will miss your great writing because of this problem.

Ian Leaf Tax Fraud's picture

I have been browsing on-line greater than three hours lately, but I by
no means discovered any fascinating article like yours.
It's lovely value enough for me. In my view, if all web owners and bloggers made excellent content material as
you probably did, the web will probably be much more useful than ever before.

Andina Acquisition&#039;s Luke Weil's picture

I relish, result in I found just what I was looking for.

You've ended my four day lengthy hunt! God Bless you man. Have a nice day.
Bye

Jody Rookstool's picture

This is really interesting, You're a very skilled blogger.
I have joined your feed and look forward to seeking more of your magnificent post.

Also, I've shared your website in my social networks!

happy diwali sms's picture

What's up to all, the contents existing at this web site are genuinely amazing for people experience, well,
keep up the good work fellows.

Karl Jobst DDS's picture

Hello, yeah this piece of writing is actually nice
and I have learned lot of things from it on the topic of blogging.
thanks.

fire and the flood's picture

Great article.

Brandon Colker's picture

My brother suggested I might like this webb site. He was entirely right.
This post truly made my day. You can not imagine simply how much time I had spent for this information! Thanks!

online computers's picture

Good answer baqck in return of this question with real arguments and telling all on the topic of that.

Here iis myy web blog: online computers

dien dan rao vat viet nam's picture

you're truly a excellent webmaster. The site loading velocity
is amazing. It seems that you're doing any unique trick.

Moreover, The contents are masterpiece. you have done a excellent process in this
subject!

www.Kosmotayho.top's picture

Wow, amazing blog layout! How long have you been blogging for?
you make blogging look easy. The overall look of your web site is
great, as well as the content!
CHUAN BI MO BAN DU AN CHUNG CU KOSMO TAY HO http://www.kosmotayho.top/
Kosmo tay ho, kosmo tay ho, chung cu kosmo tay ho, chung cu
kosmo tay ho, du an kosmo tay ho, du an kosmo tay
ho

pobierz's picture

Hello, yes this article is in fact pleasant and I have learned lot of things from it concerning blogging.
thanks.

ราคาต่อรองบอล's picture

wonderful points altogether, you just gained a new reader.
What may you recommend about your post that you made some days in the past?

Any sure?

yepme t shirts's picture

Hiya! I know this is kinda off topic however I'd figured I'd ask.

Would you be interested in exchanging links or maybe guest authoring a blog
post or vice-versa? My site discusses a lot of the same topics
as yours and I think we could greatly benefit from each other.
If you're interested feel free to shoot me an e-mail.
I look forward to hearing from you! Fantastic blog by the way!

Dana Sibilsky's picture

I know this site provides quality based content and extra material, is there any other website which gives these data in quality?

Dermaliere Anti-aging's picture

Howdy just wanted to give you a brief heads up
and let you know a few of the pictures aren't
loading correctly. 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.

Pages

Add new comment