I’m trying, once more, to get a working development environment for compiling the Second Life viewer. Long-memoried readers will recall that I had set up a local subversion repository about a month ago. Some time after that was set up, I decided to base my modifications off of the First Look viewer. That, plus the fact that I had set up my first repository while I had a mild case of the stupids, inspired me to start the repository over from scratch with the FL sources.
I’ve got everything set up again, and can compile, but… bleck! What a yucky build script!
- It chooses a temporary build directory in a really weird way—if I’m building source in `/home/jacek/my/path/to/the/client‘, it will make a build directory, `/tmp/home/jacek/my/path/to/the/client/i686-linux/client_release/’. Why in the world does it use the current working directory in the temp path? That just means you can never move your source code to another directory (unless you want to rename the temp paths too).
- Ok, this part renders #1 irrelevant… but that just makes things even worse! Here it is: the build system recompiles everything, every time. Even stuff that hasn’t changed. For most software packages, you only have to recompile things when the source changes; you can re-use the other stuff to save time. Particularly for a very large software package like the viewer, where compilation takes several hours, it makes no sense to recompile everything!
Actually, the problem with #2 is probably related to #1. I bet the build script isn’t even looking in the TEMP_BUILD_DIRECTORY to see what has been compiled. It’s looking in the wrong place! Oi. Dumb script.
Grumble, grumble.
It looks like my first patch submissions are going to be for the SConstruct file. I can’t say this is the “building”-related code that I was looking forward to playing with!


February 28th, 2007 at 11:21 pm
Save a keystroke: use SCONSFLAGS!
http://www.scons.org/doc/0.96.1/HTML/scons-user/c1220.html#AEN1225
February 28th, 2007 at 11:25 pm
“Note that when you’re not using an SConscript file in the src subdirectory, you must actually specify that the program must be built from the build/hello.c file that SCons will duplicate in the build subdirectory.”
http://www.scons.org/doc/0.96.1/HTML/scons-user/x1981.html
(I don’t think the build script is doing that.)
February 28th, 2007 at 11:36 pm
I win at life! Fixing #1 fixed #2! (All I did was remove the “os.getcwd()” part from line 109). Now it detects the already-compiled stuff!
I found out that it was looking in the wrong place by using the “–debug=explain” option from this page:
http://www.scons.org/doc/0.96.1/HTML/scons-user/c2746.html#AEN2750
March 1st, 2007 at 10:56 am
Thinking about it now, including the current working directory would make sense in an environment like Linden Lab, where there are many different versions of the client floating around, and you have to keep them separate.
“The SConstruct file isn’t dumb… it’s just misunderstood!”
March 6th, 2007 at 8:45 pm
[...] the patch doesn’t address either of the things that were bugging me in my earlier post about the build script. But, as it turns out, neither of those issues were real problems (just problems in my head), so [...]