Unified Windows Build Prerequisites

I have put together an initial draft of a unified Mozilla-build package. It is available (temporarily) on my website: mozilla-build.zip (55MB). It contains everything needed to build Mozilla on Windows except the Microsoft Visual C++ compiler and the JDK (only required for XULRunner).

Using MSYS with gmake 3.81 requires one code change, in bug 345482: I’m hoping to get this fix backported to all the active branches soon.

I would like to get some testing of this package, to see if it has missing pieces or causes builders any problems. Please report success or failure in blog comments.

Usage Instructions:

  1. Install MS Visual C++. Do not add paths to the environment when the installer gives you the option.
  2. If you already have MSVC installed, check your environment and remove any references to it from PATH, INCLUDE, and LIB.
  3. Unzip the package to a path with no spaces in it: I recommend C:\ (it will unpack to C:\mozilla-build).
  4. Run start-msvc6.bat, start-msvc71.bat, or start-msvc8.bat. It should detect the installed location of MSVC from the registry, set up paths correctly, and launch an MSYS shell.

Atom Feed for Comments 18 Responses to “Unified Windows Build Prerequisites”

  1. Doug Turner Says:

    Sounds sweet. I always hated trying to find all of the right stuff to make mozilla compile when setting up a new machine.

    Maybe I should have read this somewhere else, but will there by any legal problems redistributing some of these tools? 7-zip and NSIS come to mind.

  2. jmdesp Says:

    Is it possible to make this work with Visual C++ 2005 Express Edition ?

  3. Wladimir Palant Says:

    Nice, now I can finally get rid of CygWin. Two issues so far:

    * I didn’t have a path to my installation of Visual C++ 2005 Express Edition in the registry. Maybe that was only my installation options or maybe Express Edition generally doesn’t put there. Anyway, I had to add a key to my registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VC. Then I added a string value named ProductDir to it with the path to the Visual C++ installation. Searched the registry, I don’t have this path anywhere else.
    * I can’t use the existing tree, for some reason the checkout fails with “no such repository”. Checking out a new tree seems to work, I’ll try that now.

  4. Nickolay Ponomarev Says:

    1. Not reading this entry carefully leads to build failing with

    make[5]: *** [s:/mozilla/obj-fx-debug/dist/lib/softokn3.chk] Error 127

    due to absolute paths being messed up. This can be fixed by applying the patch from the bug (tested on trunk).

    2. During the build I had ‘make’ crash on me (dunno if it’s just my bad luck or what):

    0 [main] make 3588 open_stackdumpfile: Dumping stack trace to make.exe.stackdump

    Restarting build ‘cured’ the problem.

  5. Wladimir Palant Says:

    I am done building, it worked. However, one more issue: the environment setup has to consider Platform SDK, you need it when using Visual C++ 2005 Express Edition. You probably want to call %MSSDK%\SetEnv.Cmd in the environment setup. Still, Gecko wants ATL to be in the include path, something that this script doesn’t provide (you can include but not ), not sure what can be done about it.

  6. Dan Veditz Says:

    What if you like MSVC in your path because you use it for other things as well?

  7. Wladimir Palant Says:

    You also have one of those blogs that eat anythings that looks like tags… I meant to say “you can include <atl/atlbase.h> but not <atlbase.h>” in the previous post.

  8. Wladimir Palant Says:

    Actually, I just noticed that bin\vcvars32.bat in VC++ 2005 EE simply calls “%VS80COMNTOOLS%vsvars32.bat”. I am not sure whether other versions of VC++ set this variable as well but maybe you can use it instead of digging in the registry.

  9. Anders Says:

    I did not have reg.exe on my machine although it is a Win2k pro. Maybe you should add it from here http://www.petri.co.il/download_free_reskit_tools.htm

  10. David Baron Says:

    So I just tried this to do a 1.8.0 branch build with MSVC 6, and it failed reasonably early in the build with the error:

    /bin/perl -I/c/builds/1.8.0/mozilla/config /c/builds/1.8.0/mozilla/config/bdate.pl build_number
    Can’t load ‘/usr/lib/perl5/5.6.1/msys/auto/IO/IO.dll’ for module IO: dlopen: Win32 error 5 at /usr/lib/perl5/5.6.1/msys/XSLoader.pm line 75.
    at /usr/lib/perl5/5.6.1/msys/IO.pm line 9
    Compilation failed in require at /usr/lib/perl5/5.6.1/msys/IO/Handle.pm line 256.
    [ followed by a long list of Compilation failed messages: IO::Handle (above), IO::Seekable, IO::File, mozBDate.pm, bdate.pl]

  11. David Baron Says:

    A few other comments and questions:

    The “no such repository” error on checkout is presumably because you were checking out on top of a cygwin tree pulled with DOS newlines, and this config has MSYS set up with Unix newlines. (Not sure if that’s configurable.) I saw that as well, but I’ve been meaning to switch to Unix newlines for a while, so I’m happy with it.

    What’s the recommended way (if there is one) to add additional packages to MSYS? I’ve already noticed that it doesn’t have wget/curl, nor does it have any man pages.

  12. Steve Trotman Says:

    Hello,
    First off I’d like to applaud you for working towards unifying the mess of requirements to set up Mozilla. I had built firefox once before using the cygwin method and agree that the setup required is prohibitively complicated and time consuming. My results with your package are as follows:
    I tried with Visual C++ 2005 Express and hit the same snag as Wladimir Palant:

    “I didn’t have a path to my installation of Visual C++ 2005 Express Edition in the registry. Maybe that was only my installation options or maybe Express Edition generally doesn’t put there. Anyway, I had to add a key to my registry: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\Setup\VC. Then I added a string value named ProductDir to it with the path to the Visual C++ installation. ”

    The express edition puts a copy of its setup files in a subfolder off the main Visual Studio Directory:
    “C:\Program Files\Microsoft Visual Studio 8\Microsoft Visual C++ 2005 Express Edition – ENU”
    Perhaps a check could be incorporated for the existence of a folder with this name?

    My second issues were with the documentation on the mozilla website involving checking out the sources. This probably isnt your responsibility but I wanted to mention it anyway. The syntax as pasted from the website code samples does not work:

    http://developer.mozilla.org/en/docs/Mozilla_Source_Code_Via_CVS

    “cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co mozilla/client.mk”

    This command fails with authentication errors, I had to break it into parts and login first, then try checking out in a second command, a beginner would not know how to do this.

    “cd mozilla”

    “make -f client.mk checkout MOZ_CO_PROJECT=browser”

    This command fails with the error “The mozilla directory cannot be located in a path with spaces”. The directory I am trying to download to is c:\mozilla, and does not contain spaces. I don’t know if this has to do with quirks of the msys environment.

  13. chris Says:

    Thanks it looks like this might help ease many woes.
    But alas still no joy here! I think it’s time to give up now and stick to simple things like baking bread… who want’s mozilla anyway? forget it… bake some bread… get pissed … lifes too short.
    Stuff the internet. :q

  14. David Baron Says:

    For what it’s worth, my perl problem had something to do with the file permissions created by extracting mozilla-build.zip using cygwin zip. I re-extracted it using msys zip and it worked fine.

    In response to the comments about the VC++2005 Express Edition — is there a different registry key that you do have that Benjamin should be looking for?

  15. Benjamin Smedberg Says:

    Supporting MSVC8 Express is bug 363942: MSVC8 Express is easy; detecting and configuring the SDK is not so easy.

  16. Tom Rowland Says:

    The VC 2005 Express location can be found in:

    HKLM\SOFTWARE\Microsoft\VCExpress\8.0\Setup\VC

    The easy way is to change SET MSVC8KEY=%MSVCROOTKEY%\8.0\Setup\VC in guess-msvc.bat to the above location.

    Creation of MSVC8EXPRESSKEY, VC8EXPRESSDIR in the . bat and a start-msvc8Express.bat would be savvy

  17. BSBlog » Blog Archive » MozillaBuild RC1 Says:

    [...] MozillaBuild RC1 I have a version of MozillaBuild ready for widespread testing, packaged as an installer. I’m calling this RC1 because I don’t know of any bugs and unless we find some it is fine to put into production. It works with MSVC6, 7, 8, and MSVC 8 Express with an SDK. It builds the trunk, 1.8, and 1.8.0 branches. Download MozillaBuildSetup.exe now The installer was built using the patch in bug 366823, which hasn’t been reviewed or landed yet. Please download and test this package (and start using it as your Windows development environment). If you have issues, please file bugs in Core->Build Config. [...]

  18. Windows 7 Release Candidate gets new features Says:

    Windows 7 Release Candidate gets new features…

    I have an Nvidia board and had exactly the same quicktime/ itunes issues, BSOD’ s and stuttering under Vista. My fix was to go into device manager and find“ Nvidia Nforce serial ATA controller” and then right click and select update driver softwa…

Leave a Reply