================================================================================ A Word On Trust ================================================================================ If you're properly paranoid you should get the heeby jeebies working in someone else's computer. You don't want to trust anythig on here. You shouldn't. But if you use it properly, you shouldn't *have* to. I don't *intend* for you to. Write your patches, test them, and then submit the *patch* for review. Don't do something silly like building a release from this AMI, or producing a test version for someone. See also, the section "Running the Webserver" ================================================================================ Filesystem ================================================================================ C:\ build\ libevent-2.0.21-stable\ See section "Building libevent" openssl-1.0.0k\ See section "Building openssl" zlib-1.2.7\ See section "Building zlib" tor A git checkout of https://git.torproject.org/tor.git See section "Building Tor" vidalia A git checkout of https://git.torproject.org/vidalia.git See section "Building Vidalia" torbrowser A git checkout of https://git.torproject.org/torbrowser.git See section "Building TorBrowser" mozilla-build An extraction of https://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/MozillaBuildSetup-Latest.exe From 03/02/2012, Version 1.6.1 mozilla-central A checkout of https://hg.mozilla.org/mozilla-central See section "Building Firefox" webserver See section "Running the Webserver" ================================================================================ Environment ================================================================================ - MinGW mingw-get-inst-20120426 - CMake 2.8.10.2 - MsysGit 1.8.0 - QT 4.8.1 - Windows SDK for Windows 7 and .Net Framework 4 - DirectX Jun10 SDK - nasm 2.10.07 - Visual Studio C++ Express 2010 < NOT 2008! - ActiveState ActivePerl - Process Monitor - Process Explorer - Notepad++ - Chrome - 7-Zip - mongoose webserver PATH: C:\Perl\site\bin; C:\Perl\bin; %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem; %systemroot%\System32\WindowsPowerShell\v1.0\; C:\Program Files (x86)\Git\cmd; C:\Program Files\Microsoft Windows Performance Toolkit\; C:\Program Files (x86)\CMake 2.8\bin; C:\Qt\4.8.1\bin; C:\Program Files (x86)\nasm; C:\MinGW\bin ================================================================================ Environment Non-Standardness ================================================================================ 1) MinGW dll Issue Trying to build vidalia, I got an error with MinGW that's explained here: http://mingw-users.1079350.n2.nabble.com/Question-libgmp-10-dll-not-found-td7443661.html I solve it by following their advice, and copying the 6 affected dlls into the affected directory: libgmp-10.dll libmpc-2.dll libmpfr-1.dll libgcc_s_dw2-1.dll libiconv-2.dll libintl-8.dll to C:\MinGW\libexec\gcc\mingw32\4.6.2 2) TBB Build Script Changes for VS2010 See section "Building TorBrowser" ================================================================================ Running the Webserver ================================================================================ Having a computer like this that you don't trust presents a conundrum: if you want to copy a file off, how do you do it without typing in a password or copying over an SSH key? I've tried to address this issue. mongoose is the dumbest, dead-simplest webserver I could find for Windows. 1) Go to C:\webserver - there is a single exe 2) Run it, and it will stick an icon in your task tray. 3) It's now serving that directory (C:\webserver) on port 8080 4) If you need to download anything off the machine, put it in this directory, hit its IP, and download it. ================================================================================ Building libevent ================================================================================ Using a MinGW shell, ./configure and make worked without errors ================================================================================ Building zlib ================================================================================ Using a MinGW shell, the below worked without errors Administrator@AMAZONA-DCN4MGA /c/build/zlib-1.2.7 $ make -f win32/Makefile.gcc ================================================================================ Building openssl ================================================================================ There are two ways to build OpenSSL: - As a Windows DLL - As a MinGW toolchain library (needed for Tor) -------------------------------------------------------------------------------- Windows DLL: -------------------------------------------------------------------------------- OpenSSL uses batch scripts that call perl, so you must have perl in your PATH. Follow C:\build\openssl-1.0.0k\INSTALL.W32 This consisted of, for me, from a command prompt: 1) perl Configure VC-WIN32 --prefix=C:\build\openssl-1.0.0k 2) To keep it simple and omit the assembly language instructions: perl Configure VC-WIN32 no-asm --prefix=C:\build\openssl-1.0.0k ms\do_ms 2) To include assembly: ms\do_nasm 3) Open up the Visual Studio Command Prompt nmake -f ms\ntdll.mak I've successfully build both the ASM and non-ASM versions. You may need to issue 'nmake -f ms\ntdll.mak clean' -------------------------------------------------------------------------------- MinGW Toolchain: -------------------------------------------------------------------------------- Open a MinGW Prompt 0) cd /c/build/openssl-1.0.0k 1) make clean 2) perl Configure mingw no-shared no-asm --prefix=/c/build/openssl-1.0.0k 3) make depend 4) make It failed for me inside the test/ directory 5) Rename test to tmp-test 6) make 7) Rename tmp-test to test Ifyou don't do this, sometimes the perl configure command will fail ================================================================================ Building Vidalia ================================================================================ Following https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL Open a command prompt 0) cd C:\build\vidalia 1) mkdir build 2) cd build 3) cmake -G "MinGW Makefiles" .. 4) mingw32-make Now you'll have a vidalia.exe in C:\build\vidalia\build\src\vidalia but it won't run yet, because all its dependencies need to be collected 5) mkdir output cd output 6) copy ..\src\vidalia\vidalia.exe copy "C:\MinGW\bin\libstdc++-6.dll" At this point it will pick up the rest of the files from your PATH, but to be complete 7) copy C:\Qt\4.8.1\bin\QTXML.dll copy C:\Qt\4.8.1\bin\QTNetwork4.dll copy C:\Qt\4.8.1\bin\QTGUI4.dll copy C:\Qt\4.8.1\bin\QTCore4.dll copy C:\Qt\4.8.1\bin\mingwm10.dll ================================================================================ Building Tor ================================================================================ Tor is a bit tricky, since from what I was able to find, it only builds using MinGW. This means it's dependencies need the MinGW-type libaries. >From a MinGW Shell 0) Build libevent 1) In /c/build/libevent do a 'make install' 2) Build zlib 3) Copy zlib files to places Tor expects: cp -iv zlib1.dll /mingw/bin cp -iv zconf.h zlib.h /mingw/include cp -iv libz.a libz.dll.a /mingw/lib 4) Build OpenSSL 5) In /c/build/openssl do a 'make install' Now we're ready for Tor: 6) ./autogen.sh 7) ./configure --with-openssl-dir=/c/build/openssl-1.0.0k/ --disable-asciidoc Disabling asciidoc will tell it not to complain because we don't have it installed. 8) make ================================================================================ Building Firefox ================================================================================ Following, https://developer.mozilla.org/en-US/docs/Simple_Firefox_build 0) Open up start-msvc10.bat 1) cd /c/mozilla-central 2) ./mach build 3) Wait at least 45 minutes (On a m3.2xlarge it takes at least 45 minutes) ================================================================================ Building TorBrowser ================================================================================ So TorBrowser is pretty self-contained with its dependencies, but at the same time, it expects MSVC 2008, and we've got 2010. >From a MinGW prompt, 0) cd /c/build/torbrowser/build-scripts 1) Open C:\build\torbrowser\build-scripts\windows.mk 2) Edit - Change MSVC_VER to 10 - Adjust NUM_CORES to your liking - Find the line cp "/c/Program Files (x86)/Microsoft Visual Studio 9.0/VC/redist/x86/Microsoft.VC90.CRT/"msvc*90.dll $(FIREFOX)/App/Firefox Comment it, and add a replacement underneath it: cp "/c/Windows/SysWOW64/"msvc*100.dll $(FIREFOX)/App/Firefox - Below it there is a line: cp -r $(FIREFOX_DIR)/obj-*/dist/firefox/* $(FIREFOX)/App/Firefox Comment it, and add a replacement underneath it: cp -r $(FIREFOX_DIR)/dist/bin/* $(FIREFOX)/App/Firefox 3) make -f windows.mk build-all-binaries bundle TBB will now crash. Running tbb-firefox.exe in windbg shows Microsoft (R) Windows Debugger Version 6.12.0002.633 AMD64 Copyright (c) Microsoft Corporation. All rights reserved. CommandLine: "C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\tbb-firefox.exe" Symbol search path is: *** Invalid *** **************************************************************************** * Symbol loading may be unreliable without a symbol search path. * * Use .symfix to have the debugger choose a symbol path. * * After setting your symbol path, use .reload to refresh symbol locations. * **************************************************************************** Executable search path is: ModLoad: 00000000`00370000 00000000`003ab000 firefox.exe ModLoad: 00000000`773c0000 00000000`77569000 ntdll.dll ModLoad: 00000000`775a0000 00000000`77720000 ntdll32.dll ModLoad: 00000000`743b0000 00000000`743ef000 C:\Windows\SYSTEM32\wow64.dll ModLoad: 00000000`74350000 00000000`743ac000 C:\Windows\SYSTEM32\wow64win.dll ModLoad: 00000000`74420000 00000000`74428000 C:\Windows\SYSTEM32\wow64cpu.dll (7a4.cb4): Break instruction exception - code 80000003 (first chance) *** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll.dll - ntdll!CsrSetPriorityClass+0x40: 00000000`7746cb60 cc int 3 0:000> g ModLoad: 00000000`77140000 00000000`7725f000 WOW64_IMAGE_SECTION ModLoad: 00000000`74ce0000 00000000`74df0000 WOW64_IMAGE_SECTION ModLoad: 00000000`77140000 00000000`7725f000 NOT_AN_IMAGE ModLoad: 00000000`76e30000 00000000`76f2a000 NOT_AN_IMAGE ModLoad: 00000000`74ce0000 00000000`74df0000 C:\Windows\syswow64\kernel32.dll ModLoad: 00000000`751f0000 00000000`75237000 C:\Windows\syswow64\KERNELBASE.dll ModLoad: 00000000`76200000 00000000`76300000 C:\Windows\syswow64\USER32.dll ModLoad: 00000000`76350000 00000000`763e0000 C:\Windows\syswow64\GDI32.dll ModLoad: 00000000`76a50000 00000000`76a5a000 C:\Windows\syswow64\LPK.dll ModLoad: 00000000`74df0000 00000000`74e8d000 C:\Windows\syswow64\USP10.dll ModLoad: 00000000`764d0000 00000000`7657c000 C:\Windows\syswow64\msvcrt.dll ModLoad: 00000000`753a0000 00000000`75440000 C:\Windows\syswow64\ADVAPI32.dll ModLoad: 00000000`76860000 00000000`76879000 C:\Windows\SysWOW64\sechost.dll ModLoad: 00000000`76960000 00000000`76a50000 C:\Windows\syswow64\RPCRT4.dll ModLoad: 00000000`74c80000 00000000`74ce0000 C:\Windows\syswow64\SspiCli.dll ModLoad: 00000000`74c70000 00000000`74c7c000 C:\Windows\syswow64\CRYPTBASE.dll ModLoad: 00000000`737d0000 00000000`7388e000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\MSVCR100.dll (7a4.cb4): WOW64 breakpoint - code 4000001f (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** ERROR: Symbol file could not be found. Defaulted to export symbols for ntdll32.dll - ntdll32!LdrVerifyImageMatchesChecksum+0x96c: 77640fab cc int 3 0:000:x86> g ModLoad: 76a60000 76ac0000 C:\Windows\SysWOW64\IMM32.DLL ModLoad: 76bb0000 76c7c000 C:\Windows\syswow64\MSCTF.dll ModLoad: 730d0000 73116000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\nspr4.dll ModLoad: 73ca0000 73ca7000 C:\Windows\SysWOW64\WSOCK32.dll ModLoad: 75450000 75485000 C:\Windows\syswow64\WS2_32.dll ModLoad: 76850000 76856000 C:\Windows\syswow64\NSI.dll ModLoad: 73090000 730c2000 C:\Windows\SysWOW64\WINMM.dll ModLoad: 73950000 73971000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\mozglue.dll ModLoad: 724a0000 72775000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\mozjs.dll ModLoad: 76af0000 76af5000 C:\Windows\syswow64\PSAPI.DLL ModLoad: 73020000 73089000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\MSVCP100.dll ModLoad: 73ce0000 73ceb000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\plc4.dll ModLoad: 73c80000 73c8b000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\plds4.dll ModLoad: 73000000 73018000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\nssutil3.dll ModLoad: 72f60000 72ffe000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\nss3.dll ModLoad: 72f40000 72f58000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\smime3.dll ModLoad: 72f10000 72f35000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\ssl3.dll ModLoad: 72e70000 72f08000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\mozsqlite3.dll ModLoad: 73c70000 73c76000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\mozalloc.dll ModLoad: 700a0000 7046e000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\gkmedias.dll ModLoad: 74410000 74415000 C:\Windows\SysWOW64\MSIMG32.dll ModLoad: 6ea80000 7009f000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\xul.dll ModLoad: 75490000 760da000 C:\Windows\syswow64\SHELL32.dll ModLoad: 76470000 764c7000 C:\Windows\syswow64\SHLWAPI.dll ModLoad: 75240000 7539c000 C:\Windows\syswow64\ole32.dll ModLoad: 74400000 74409000 C:\Windows\SysWOW64\VERSION.dll ModLoad: 72e50000 72e6c000 C:\Windows\SysWOW64\IPHLPAPI.DLL ModLoad: 73b90000 73b97000 C:\Windows\SysWOW64\WINNSI.DLL ModLoad: 74030000 740b0000 C:\Windows\SysWOW64\UxTheme.dll ModLoad: 75050000 751ed000 C:\Windows\syswow64\SETUPAPI.dll ModLoad: 76ac0000 76ae7000 C:\Windows\syswow64\CFGMGR32.dll ModLoad: 763e0000 7646f000 C:\Windows\syswow64\OLEAUT32.dll ModLoad: 76910000 76922000 C:\Windows\syswow64\DEVOBJ.dll ModLoad: 72e30000 72e47000 C:\Windows\SysWOW64\USERENV.dll ModLoad: 73b00000 73b0b000 C:\Windows\SysWOW64\profapi.dll ModLoad: 72e10000 72e23000 C:\Windows\SysWOW64\dwmapi.dll ModLoad: 737c0000 737c8000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\xpcom.dll ModLoad: 00000000`72200000 00000000`7230b000 C:\Windows\SysWOW64\dwrite.dll ModLoad: 00000000`741b0000 00000000`7434e000 C:\Windows\WinSxS\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.7601.17514_none_41e6975e2bd6f2b2\comctl32.dll ModLoad: 00000000`76880000 00000000`76903000 C:\Windows\syswow64\CLBCatQ.DLL ModLoad: 00000000`740b0000 00000000`741a5000 C:\Windows\SysWOW64\propsys.dll Could not read chrome manifest 'jar:file:///C:/build/torbrowser/build-scripts/Tor%20Browser_en-US/Tor%20Browser/FirefoxPortable/App/Firefox/omni.ja!/chrome.manifest'. Could not read chrome manifest 'file:///C:/build/torbrowser/build-scripts/Tor%20Browser_en-US/Tor%20Browser/FirefoxPortable/App/Firefox/chrome/en-US.manifest'. Could not read chrome manifest 'file:///C:/build/torbrowser/build-scripts/Tor%20Browser_en-US/Tor%20Browser/FirefoxPortable/App/Firefox/chrome/toolkit.manifest'. Could not read chrome manifest 'file:///C:/build/torbrowser/build-scripts/Tor%20Browser_en-US/Tor%20Browser/FirefoxPortable/App/Firefox/chrome/pippki.manifest'. Could not read chrome manifest 'file:///C:/build/torbrowser/build-scripts/Tor%20Browser_en-US/Tor%20Browser/FirefoxPortable/App/Firefox/chrome/browser.manifest'. ModLoad: 73bb0000 73bec000 C:\Windows\SysWOW64\mswsock.dll ModLoad: 72e00000 72e05000 C:\Windows\SysWOW64\wshtcpip.dll ModLoad: 72450000 7249b000 C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\components\browsercomps.dll Could not read chrome manifest 'file:///C:/build/torbrowser/build-scripts/Tor%20Browser_en-US/Tor%20Browser/FirefoxPortable/App/Firefox/chrome/pdfjs.manifest'. (7a4.cb4): Access violation - code c0000005 (first chance) First chance exceptions are reported before any exception handling. This exception may be expected and handled. *** WARNING: Unable to verify checksum for C:\build\torbrowser\build-scripts\Tor Browser_en-US\Tor Browser\FirefoxPortable\App\Firefox\xul.dll xul!ReteNodeSet::Iterator::operator*+0xa: 6f3d73ca 8b08 mov ecx,dword ptr [eax] ds:002b:00000000=???????? And it crashing here: c:\build\torbrowser\build-scripts\build-alpha-windows\build\firefox-17.0.3esr\content\xul\templates\src\nsrulenetwork.h class Iterator : public ConstIterator { public: Iterator(ReteNode** aNode) : ConstIterator(aNode) {} Iterator& operator++() { ++mCurrent; return *this; } Iterator operator++(int) { Iterator result(*this); ++mCurrent; return result; } ReteNode* operator*() const { return *mCurrent; } <========================================= ReteNode* operator->() const { return *mCurrent; } bool operator==(const ConstIterator& aConstIterator) const { return mCurrent == aConstIterator.mCurrent; } bool operator!=(const ConstIterator& aConstIterator) const { return mCurrent != aConstIterator.mCurrent; } };