Successful mozilla calendar build notes to self

.mozconfig

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../obj-@CONFIG_GUESS@
mk_add_options MOZ_CO_PROJECT=calendar # We want to checkout calendar
mk_add_options MOZ_CO_USE_MIRROR=1 # use cvs-mirror
mk_add_options MOZ_CO_LOCALES=de,pl # Can be used to also checkout a language
mk_add_options MOZ_MAKE_FLAGS=”-j1″ # Can be used if you have multiple processors

#mk_add_options JS_READLINE=1

ac_cv_visibility_pragma=no

ac_add_options –enable-application=calendar # We want to build calendar
ac_add_options –disable-tests # You should enable tests to make sure everything works before posting a patch
ac_add_options –enable-extensions=default,lightning,inspector,venkman # Some extensions in the /extensions directory
ac_add_options –disable-installer # Installer not needed for development
ac_add_options –enable-system-cairo # I needed this on linux

#ac_add_options –enable-ui-locale=et
#ac_add_options –with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk # Needed on MAC
#ac_add_options –disable-airbag # I have had problems with airbag in the past
#ac_add_options –disable-crashreporter # (Optional) Disable if you don’t want it
#ac_add_options –enable-debugger-info-modules=yes # More debug info
#ac_add_options –enable-debug # (Optional) Lots of debugging. Maybe more than you actually want!

# The following options can be used to reduce/disable debugging.
# ac_add_options –enable-optimize
# ac_add_options –disable-static –enable-shared
# ac_add_options –disable-debug

mozilla/layout/build/Makefile.in change:

ifdef MOZ_ENABLE_GTK2
EXTRA_DSO_LDOPTS += $(MOZ_GTK2_LIBS)
-lX11 -lXrender
$(NULL)
endif

Commands:

cvs -d :pserver:anonymous@cvs-mirror.mozilla.org:/cvsroot co -r MOZILLA_1_8_BRANCH mozilla/client.mk
cd mozilla
make -f client.mk checkout
LANG=C make -f client.mk build

It’s also good to check tinderboxes of locales!

Green screen of weird (GSOW)

Windows users are somewhat scared about the BSOD. Haven’t experienced it ever so I wouldn’t know. But..
I finally switched from Gutsy to Hardy. The whole desktop effects part has been made a lot easier to setup. Only had to figure out how to have Compiz with the taskbar option “show windows from all desktops” disabled.
Also Hibernate is still picky enough that I had to tell both resume file and boot entry where to find swap, duh. But after doing that it works. Suspend is funny though, it greets with green screen flash on resume and one line of text that vanishes quickly enough that you can’t read. It doesn’t seem to cause any problems though, other that beauty ones :D.
Estonian ID-card with Firefox 2 didn’t want to notice that I have Java installed, had to edit some postinstall script, not too troublesome when Launchpad has detailed instructions for you.
Otherwise X60s and Hardy get along very well, haven’t noticed any other issues so far. This way I might test my luck with fingerprint reader and HDAPS again.

Never trust server’s time for your own sake!

I’ve just had another very useful lesson on what to not do. In one of my school project I have one table in database that represents orders and another that keeps events associated with orders. The latter one simply has an foreign key to order table. Each event has timestamp and a number that references order state after the event. State is stored as a number and it references third table which keeps all numbers with their respective states. To find out which is the current state of an order you simply run a query that selects all events associated with that order and finds out which one is the newest.
Turns out, that’s exactly how not to design a database! While we were showing off our work to our lecturer the strangest thing happened, after he confirmed an order it stayed in the same state as before! Very bad considering that every time an order is confirmed the number of products in warehouse is increased by the amount in the order by application. Confirming the same order more than once is something that should not be possible! And our application did have a check whether the order in a state that allows the next state to be “confirmed”.
My first suspect was the type of event that is inserted would be wrong. We had one such case with the same project earlier. Stupid, but yes, that’s exactly why you need to test everything. That was not the case, quick look on tables showed that this part was correct.
Next was the probability that the database view that displayed each order’s state was incorrect. That was a rather complicated query compared to simple select clause and I didn’t really feel like debugging it. Instead I took another look at the events table. This time I paid attention to the timestamp attribute as well. Imagine my surprise when I saw that the timestamp for the last event was 40 minutes earlier than the event that I know had happened earlier! Apparently while the lecturer was clicking around, confirming orders and such, our lovely server decided to go back in time by 40 minutes!
I wouldn’t have come to that conclusion unless the time wouldn’t be incorrect at the moment.
Simple script echoing time showed 18:05:59 and three seconds later 18:05:02! It was actually about 18:50.
My lesson from this: if you want to keep events like that then keep current state number in the orders’ table as well for each order. Every time when you insert new event update it. This way you get strange result when you print out all events of a certain order but you never find yourself in the position that current state is wrong.