<p dir="ltr">This is really cool. I've had similar issues in the past. Nice job.</p>
<div class="gmail_quote">On Mar 3, 2013 10:31 PM, "Tom Ritter" <<a href="mailto:tom@ritter.vg">tom@ritter.vg</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This weekend I tried building several of the tor projects on Windows (tor, vidalia, tbb, and vanilla firefox).  I kept notes of my adventures, some of the quirks I ran into, and the final set of instructions that seemed to work for me.<br>

<br>
Perhaps most usefully, I've created an Amazon AMI that anyone will be able to boot up and use.  (Yes, this has trust issues, I've addressed them in the top of the README document attached.)  The intention is that people who want to test a patch or develop a patch can use this to bootstrap themselves, without having to fight long and hard to set up a Windows build environment.<br>

<br>
I've attached two documents:<br>
 1) TBB Environment README.txt<br>
 2) Adventures in Compilation.txt<br>
<br>
The first is the README for the environment.<br>
The second is a journal of my trying to figure out what to do.  Specifically I'm going to call out several issues.  If desired, I can submit patches to address them, and they can be reviewed.<br>
<br>
I understand that documentation is usually a lower priority than actually shipping software, please take these comments not as bitchy criticism, but instead a list of things I'd like to improve, if someone can review my suggestions and shepard me a little.<br>

<br>
1) Firefox's official build environment is VS2010 while TBB's is VS2008<br>
<br>
I'm not 100% sure, but it seems like it'd be relatively easy to switch TBB over to 2010.  There may be some issues.  But it seems like it'd be good to track FF's official build env.  I ran across at least 1 Vanilla FF issue that broke in 2008, and there seemed to be a few in the bugtracker.<br>

<br>
2) Vidalia's build environment instructions contradict TBB's<br>
<br>
<a href="https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL" target="_blank">https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL</a><br>
<a href="https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_setups/windows.txt" target="_blank">https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_setups/windows.txt</a><br>
<br>
Vidalia's says you need CMake in your PATH, TBB's says you don't.<br>
I think it can be in your PATH.<br>
<br>
3) There's no explicit instructions on how to build Tor in Windows<br>
<br>
It seems like you just build it in MinGW?  It worked anyway.<br>
It's a (minor) bitch to get the components built and placed in the 'correct way<br>
and place' for the MinGW toolchain.  (Now documented in my README)<br>
<br>
4) The TorBrowser build instructions are really, really bad.<br>
<br>
<a href="https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_setups/windows.txt" target="_blank">https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_setups/windows.txt</a><br>
This is pretty good.  But it just ends abruptly, and doesn't tell you want to do.<br>
<br>
<a href="https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/HACKING" target="_blank">https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/HACKING</a><br>
This document seems to be mostly up to date, although I think the FF Extensions<br>
it lists have been changed since.<br>
<br>
<a href="https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/INSTALL" target="_blank">https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/INSTALL</a><br>
This one is super out of date.<br>
 - You don't need subversion or winrar<br>
 - It talks a lot about getting FirefoxPortable (or built a custom Firefox)<br>
 - I didn't try following the instructions for MinGW, msys, cmake, qt, msysGTK,<br>
   or autoconf - since I had those already.  It seems these sections have been<br>
   subsumed by the windows buildmachine document<br>
 - The OpenSSL instructions do not match the instructions IN OpenSSL<br>
 - Vidalia's links are way out of date and dead<br>
 - Its instructions for Vidalia don't match Vidalia's<br>
 - It talks about PidginPortable?  I think that's been nixed...<br>
 - "Currently the Tor Browser Bundle uses FirefoxPortable binaries."<br>
 - It talks about building with MSVC 7.1 (Visual Studio 2003)<br>
 - It stops short of telling you how to actually build the bundle, probably<br>
   because the makefiles are newer than this document<br>
<br>
<a href="https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/DEPLOYMENT" target="_blank">https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/DEPLOYMENT</a><br>
This doesn't seem applicable at all anymore<br>
<br>
I eventually found (by searching my email spools) the magic incantation to kick it off.  The "TorBrowser" section of Adventures in Compilation.txt shows my hiccups and luck getting it going.<br>
<br>
<br>
<br>
Finally, after all this.... tbb-firefox crashes. I don't know why.  I don't know if it's because I'm using VS2010, or my msvc*.dll swaps.  Specifically it's crashing here:<br>
<br>
c:\build\torbrowser\build-scripts\build-alpha-windows\build\firefox-17.0.3esr\content\xul\templates\src\nsrulenetwork.h<br>
    class Iterator : public ConstIterator {<br>
        public:<br>
            Iterator(ReteNode** aNode) : ConstIterator(aNode) {}<br>
<br>
            Iterator& operator++() {<br>
                ++mCurrent;<br>
                return *this; }<br>
<br>
            Iterator operator++(int) {<br>
                Iterator result(*this);<br>
                ++mCurrent;<br>
                return result; }<br>
<br>
            ReteNode* operator*() const {<br>
                return *mCurrent; }   <=========================================<br>
<br>
            ReteNode* operator->() const {<br>
                return *mCurrent; }<br>
<br>
            bool operator==(const ConstIterator& aConstIterator) const {<br>
                return mCurrent == aConstIterator.mCurrent; }<br>
<br>
            bool operator!=(const ConstIterator& aConstIterator) const {<br>
                return mCurrent != aConstIterator.mCurrent; }<br>
        };<br>
<br>
I'm not quite sure where to start figuring out *why* it's dereferencing a null ptr.  The windbg output is in the bottom of both docs.<br>
<br>
The AMI for the EC2 instance is ami-2e36ab47 - when you start it, open ports 3389 and 8080 in the firewall for <a href="http://0.0.0.0/0" target="_blank">0.0.0.0/0</a> (or just your IP address if you want.)<br>
If you try it, and get skeeved out by them asking for your SSH private key to get the password, check out <a href="https://github.com/tomrittervg/decrypt-windows-ec2-passwd" target="_blank">https://github.com/tomrittervg/decrypt-windows-ec2-passwd</a><br>

<br>
-tom<br>
<br>_______________________________________________<br>
tor-dev mailing list<br>
<a href="mailto:tor-dev@lists.torproject.org">tor-dev@lists.torproject.org</a><br>
<a href="https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev" target="_blank">https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev</a><br>
<br></blockquote></div>