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.
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.
I've attached two documents: 1) TBB Environment README.txt 2) Adventures in Compilation.txt
The first is the README for the environment. 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.
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.
1) Firefox's official build environment is VS2010 while TBB's is VS2008
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.
2) Vidalia's build environment instructions contradict TBB's
https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_se...
Vidalia's says you need CMake in your PATH, TBB's says you don't. I think it can be in your PATH.
3) There's no explicit instructions on how to build Tor in Windows
It seems like you just build it in MinGW? It worked anyway. It's a (minor) bitch to get the components built and placed in the 'correct way and place' for the MinGW toolchain. (Now documented in my README)
4) The TorBrowser build instructions are really, really bad.
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_se... This is pretty good. But it just ends abruptly, and doesn't tell you want to do.
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/HACKING This document seems to be mostly up to date, although I think the FF Extensions it lists have been changed since.
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/INSTAL... This one is super out of date. - You don't need subversion or winrar - It talks a lot about getting FirefoxPortable (or built a custom Firefox) - I didn't try following the instructions for MinGW, msys, cmake, qt, msysGTK, or autoconf - since I had those already. It seems these sections have been subsumed by the windows buildmachine document - The OpenSSL instructions do not match the instructions IN OpenSSL - Vidalia's links are way out of date and dead - Its instructions for Vidalia don't match Vidalia's - It talks about PidginPortable? I think that's been nixed... - "Currently the Tor Browser Bundle uses FirefoxPortable binaries." - It talks about building with MSVC 7.1 (Visual Studio 2003) - It stops short of telling you how to actually build the bundle, probably because the makefiles are newer than this document
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/DEPLOY... This doesn't seem applicable at all anymore
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.
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:
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; } };
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.
The AMI for the EC2 instance is ami-2e36ab47 - when you start it, open ports 3389 and 8080 in the firewall for 0.0.0.0/0 (or just your IP address if you want.) If you try it, and get skeeved out by them asking for your SSH private key to get the password, check out https://github.com/tomrittervg/decrypt-windows-ec2-passwd
-tom
This is really cool. I've had similar issues in the past. Nice job. On Mar 3, 2013 10:31 PM, "Tom Ritter" tom@ritter.vg wrote:
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.
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.
I've attached two documents:
- TBB Environment README.txt
- Adventures in Compilation.txt
The first is the README for the environment. 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.
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.
- Firefox's official build environment is VS2010 while TBB's is VS2008
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.
- Vidalia's build environment instructions contradict TBB's
https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_se...
Vidalia's says you need CMake in your PATH, TBB's says you don't. I think it can be in your PATH.
- There's no explicit instructions on how to build Tor in Windows
It seems like you just build it in MinGW? It worked anyway. It's a (minor) bitch to get the components built and placed in the 'correct way and place' for the MinGW toolchain. (Now documented in my README)
- The TorBrowser build instructions are really, really bad.
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_se... This is pretty good. But it just ends abruptly, and doesn't tell you want to do.
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/HACKING This document seems to be mostly up to date, although I think the FF Extensions it lists have been changed since.
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/INSTAL... This one is super out of date.
- You don't need subversion or winrar
- It talks a lot about getting FirefoxPortable (or built a custom Firefox)
- I didn't try following the instructions for MinGW, msys, cmake, qt,
msysGTK, or autoconf - since I had those already. It seems these sections have been subsumed by the windows buildmachine document
- The OpenSSL instructions do not match the instructions IN OpenSSL
- Vidalia's links are way out of date and dead
- Its instructions for Vidalia don't match Vidalia's
- It talks about PidginPortable? I think that's been nixed...
- "Currently the Tor Browser Bundle uses FirefoxPortable binaries."
- It talks about building with MSVC 7.1 (Visual Studio 2003)
- It stops short of telling you how to actually build the bundle, probably because the makefiles are newer than this document
https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/build-scripts/DEPLOY... This doesn't seem applicable at all anymore
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.
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:
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; } };
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.
The AMI for the EC2 instance is ami-2e36ab47 - when you start it, open ports 3389 and 8080 in the firewall for 0.0.0.0/0 (or just your IP address if you want.) If you try it, and get skeeved out by them asking for your SSH private key to get the password, check out https://github.com/tomrittervg/decrypt-windows-ec2-passwd
-tom
tor-dev mailing list tor-dev@lists.torproject.org https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-dev
Tom Ritter:
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.
Huh - as a funny coincidince last week I was working on things relating to building TBB on OS X with homebrew:
https://trac.torproject.org/projects/tor/ticket/8246
This bug is likely a reasonable thing for all platforms:
https://trac.torproject.org/projects/tor/ticket/8288
Thanks for your notes - I'll read over them in the next week.
All the best, Jake
On Mon, Mar 4, 2013 at 5:26 AM, Jacob Appelbaum jacob@appelbaum.net wrote:
Tom Ritter:
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.
Huh - as a funny coincidince last week I was working on things relating to building TBB on OS X with homebrew:
https://trac.torproject.org/projects/tor/ticket/7964 might help. You should be able to build TBB, but you might run into a bug with the browser crashing on certain Flash sites.
Thus spake Tom Ritter (tom@ritter.vg):
I've attached two documents: 1) TBB Environment README.txt 2) Adventures in Compilation.txt
First of all, thanks a lot for your efforts here!
The first is the README for the environment. 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.
Yes, please. One of the things I've been wanting to do is script the instructions in https://gitweb.torproject.org/torbrowser.git/tree/master:/docs/buildmachine_... with some very dumb scripts that just pull down toolchain binaries from people.torproject.org instead of trying to futz with finding the exact version we use that may or may not exist online anymore. Also, a disturbing amount of the Windows toolchain is provided over HTTP only.
If do you end up getting a working build out of your AMI VM, please post the exact toolchain binaries you used so we can verify them and archive them as the first step to making build machine setup more automated.
Jake is working on a similar project with the actual build dependencies themselves.
- Firefox's official build environment is VS2010 while TBB's is
VS2008
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.
I think this is a good idea too. I'm trying to track bugs that are toolchain-related under https://trac.torproject.org/projects/tor/ticket/8401. I've found at least 3 so far, and they are all very subtle and irritatingly time consuming to diagnose. We should just standardize on whatever Mozilla builds with.
- Vidalia's build environment instructions contradict TBB's
https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_se...
Vidalia's says you need CMake in your PATH, TBB's says you don't. I think it can be in your PATH.
This is interesting. My attempt to build on windows failed due to CMake not finding CMAKE_ROOT.
- There's no explicit instructions on how to build Tor in Windows
It seems like you just build it in MinGW? It worked anyway. It's a (minor) bitch to get the components built and placed in the 'correct way and place' for the MinGW toolchain. (Now documented in my README)
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.
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.
We've got a null pointer dereference in https://trac.torproject.org/projects/tor/ticket/8324. Could be what you're seeing, if you're somehow triggering drag+drop? I pushed a fix to torbrowser.git, but it also requires a Torbutton update to allow Drag+Drop again. I think the patch update should at least stop that crash, though.
On 3/4/2013 7:08 PM, Mike Perry wrote:
- Firefox's official build environment is VS2010 while TBB's is
VS2008
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.
I think this is a good idea too. I'm trying to track bugs that are toolchain-related under https://trac.torproject.org/projects/tor/ticket/8401. I've found at least 3 so far, and they are all very subtle and irritatingly time consuming to diagnose. We should just standardize on whatever Mozilla builds with.
I will work on matching to Mozilla's and track individual items in subtickets.
- Vidalia's build environment instructions contradict TBB's
https://gitweb.torproject.org/vidalia.git/blob/HEAD:/INSTALL https://gitweb.torproject.org/torbrowser.git/blob/HEAD:/docs/buildmachine_se...
Vidalia's says you need CMake in your PATH, TBB's says you don't. I think it can be in your PATH.
This is interesting. My attempt to build on windows failed due to CMake not finding CMAKE_ROOT.
It complained when you had CMake in your path, or when you didn't? Something I got tripped up by was building in a MinGW prompt vs a normal command prompt. In my "simplest reproduction" phase, I found I could build straight from a windows command prompt if CMake was in my path.
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.
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.
We've got a null pointer dereference in https://trac.torproject.org/projects/tor/ticket/8324. Could be what you're seeing, if you're somehow triggering drag+drop? I pushed a fix to torbrowser.git, but it also requires a Torbutton update to allow Drag+Drop again. I think the patch update should at least stop that crash, though.
Hm. I'll see if I can find time to test more tomorrow: that crash is in xul.dll!JSD_GetValueForObject whereas mine is in xul!ReteNodeSet::Iterator::operator*+0xa
Also, mine occurs on startup, I can't even get the browser loaded enough to see the application.
-tom