MozillaBuild Fun

MozillaBuild is awesome since it saves a ton of time creating a build environment. The older cygwin based system wasn’t exactly an intuitive process. The downside of the change is those stupid tricks you knew, no longer apply in some cases.

For example a cvs checkout over SSH. Once upon a time you could follow the instructions to have it remember your ssh key so you don’t have to enter a password every 30 seconds. I simply had this in a batch file along with a bunch of environmental variables.

for /f "tokens=1,2,3* delims=; " %%a in (‘ssh-agent -c’) do if "%%a"=="setenv" set %%b=%%c
set HOME=/cygdrive/c/cygwin/home/USERNAME
ssh-add ~/.ssh/id_dsa
start /b /wait cmd.exe
ssh-agent -k

That’s no longer useful. I was able to find a new way to do this thanks to Myk. He did it for MSVC7, I’m using MSVC8:

Add %MOZILLABUILD%\msys\bin\SSH-agent into the MYSYS Shell line in the batch script to launch your build environment. For example:

start "MSYS Shell – MSVC8 Environment" %MOZILLABUILD%\msys\bin\ssh-agent "%MOZILLABUILD%\msys\bin\rxvt" -backspacekey -sl 2500 -fg %FGCOLOR% -bg %BGCOLOR% -sr -fn "Lucida Console" -tn msys -geometry 80×25 -e /bin/bash –login -i

Then in your MSYS shell enter:

ssh-add ~/.ssh/id_dsa

Now you can sit back and enjoy a cvs checkout without needing to enter your password all the time. That makes things a lot easier.

I was strongly considering using my Mac Mini to build, but it’s a rev1, and the thought of using a 4200 RPM drive for something like compiling something like this made me change my mind.

6 thoughts on “MozillaBuild Fun

  1. You can also do what I used to do — in your .profile, add in ” . ~/.ssh/agent”, and then make a script that does:

    ssh-agent > ~/.ssh/agent
    . ~/.ssh/agent

    That way you only need to type your password once, the first time you open a shell (more could be done here to automatically do the ssh-agent startup if the agent isn’t actually alive, but I never bothered); all subsequent shells just talk to the same agent.

    Or, even better — install putty, convert your private key to a pageant compatible one, then drop a symlink to that in your startup items folder. Add the putty dir to your $PATH, and set CVS_RSH=plink. Pageant will prompt you for your private key at system startup, and cvs will use plink to talk to the remote server, and you’ll only need to enter your passphrase once at startup, into a win32 dialog.

  2. eval `ssh-agent`
    also works.

    I note that only Myk correctly spelled ssh-agent in lower case; Robert and Vladimir only got away with it due to XP’s case insensitivity; Vladimir will need to change his .profile if he wants it to work on Linux/Mac.

  3. Robert, I see now that there’s some stupid setting on your blog software that’s uppercasing the letters s and h if you should need to use two of the former and one of the latter.

Leave a Reply

Your email address will not be published. Required fields are marked *