Commit 0085efb6edeb77036e0f17310199ce3b2fea9590 in that repo has some first steps towards building a pluggable transports bundle. When you run make, you will end up with new extra files
These archives contain an installation of pyptlib (which is standing as a proof-of-concept placeholder for all pluggable transport files). I implemented it only for the linux bundles so far.
A summary of the changes:
A new gitian-pluggable-transports.yml builds pyptlib and pluggable-transports-linux$GBUILD_BITS-gbuilt.zip.
A new gitian-ptbundle.yml (almost completely a copy of gitian-bundle.yml) does all the things that gitian-bundle.yml does, plus it copies the contents of pluggable-transports-linux$GBUILD_BITS-gbuilt.zip and names the output file tor-pluggable-transports-browser-linux... instead of tor-browser-linux....
Two new steps in mkbundle-linux.sh (cheekily labeled 4/3 and 5/3) call the above descriptors.
Some questions that came up as I was doing it. They don't all need answers.
Is this overall the right way to do it? Should there be a gitian-ptbundle.yml that is almost a copy of gitian-bundle.yml? It wasn't clear to me how to factor out the stuff in common.
We will need to make changes to torrc. (For example.) What's a good way to do that? I don't want to modify e.g. Bundle-Data/linux/Data/Tor/torrc because that's used by the vanilla bundles. Really all we need is to append some lines to the end of the torrc that is normally installed (currently an empty file).
gitian-tor.yml builds libssl. Pluggable transports need libssl too. How do we handle this situation? Have each descriptor build its own copy of libssl, but copy only one into the package?
Should pluggable transport binaries, libraries, and Python packages be installed into /Tor alongside the tor binary, or somewhere else? In the bundles we have been building, they are all in the same directory (App).
My plan is to build all the pluggable transports (flashproxy and obfsproxy, with all their dependencies) in the single descriptor gitian-pluggable-transports.yml. Should each subprogram instead get its own descriptor? Would that mean duplicating descriptor code to build the dependencies they have in common?
Some tips for others wanting to help: The full gitian build takes a long time. You can rebuild only selected parts as long as you don't do make clean (or make, which does make clean). Use make build or manually run ./mkbundle-linux.sh instead. Do this to watch build progress and see what went wrong when there's a problem:
tail -F ~/gitian-builder/var/build.log
Delete the appropriate *gbuilt* files from ~/gitian-builder/inputs/ to get mkbundle-linux.sh to rebuild certain things. All this is actually covered in README.build.
...
Some questions that came up as I was doing it. They don't all need answers.
Is this overall the right way to do it? Should there be a gitian-ptbundle.yml that is almost a copy of gitian-bundle.yml? It wasn't clear to me how to factor out the stuff in common.
Mike should weigh in on this but I'd like to see some consolidation if possible. :-)
We will need to make changes to torrc. (For example.) What's a good way to do that? I don't want to modify e.g. Bundle-Data/linux/Data/Tor/torrc because that's used by the vanilla bundles. Really all we need is to append some lines to the end of the torrc that is normally installed (currently an empty file).
Please don't add anything to torrc (it should be empty). We are planning to remove that file from the bundles once #10060 (moved) is fixed. torrc will be reserved for saving user's changes; all of the default settings that are part of TBB should be placed in torrc-defaults. One approach would be to append your changes to torrc-defaults when assembling the bundle. There is also #1922 (moved) but it doesn't look like anyone is working on that.
...
Should pluggable transport binaries, libraries, and Python packages be installed into /Tor alongside the tor binary, or somewhere else? In the bundles we have been building, they are all in the same directory (App).
I defer to Mike but I would prefer a subdirectory within /Tor, e.g., /Tor/PT/.
Since a Python interpreter is already shipped with the Windows PT bundles, perhaps, if sandboxing TBB and any spawned PTs is desirable, the sandboxtranslation of pypy (with the tracing JIT) looks interesting. Not to mention much faster. My packaged, compiled (for 64-bit linux) pypy-c-sandbox with the tracing JIT comes to 12MB, if this is comparable to the size of the currently included Python interpreter, perhaps the speed and security benefits are worth further looking into.
We will need to make changes to torrc. (For example.) What's a good way to do that? I don't want to modify e.g. Bundle-Data/linux/Data/Tor/torrc because that's used by the vanilla bundles. Really all we need is to append some lines to the end of the torrc that is normally installed (currently an empty file).
Please don't add anything to torrc (it should be empty). We are planning to remove that file from the bundles once #10060 (moved) is fixed. torrc will be reserved for saving user's changes; all of the default settings that are part of TBB should be placed in torrc-defaults. One approach would be to append your changes to torrc-defaults when assembling the bundle. There is also #1922 (moved) but it doesn't look like anyone is working on that.
I see now what you are doing with torrc-defaults. The requirements of the pluggable transports bundle may be a little tricky, then. Most of the extra configuration we add is a bunch of Bridge lines. There needs to be a sensible list of default bridges, because that works for many users; but it also needs to be possible to remove all the default bridges and configure your own, because for another group of users the defaults don't work.
What's different about Bridge lines is that if there are some present in torrc-defaults and you add some in torrc, the ones you add don't override the defaults, they augment the defaults. Do you have any ideas for how to handle this situation? If we put the default bridges in torrc-defaults, then some users will have to edit torrc-defaults to remove them every time they update their bundle.
This is the extra configuration we're currently using:
UseBridges, LearnCircuitBuildTimeout, CircuitBuildTimeout, and ClientTransportPlugin can be moved to torrc-defaults no problem. But the Bridge lines are problematic.
What's different about Bridge lines is that if there are some present in torrc-defaults and you add some in torrc, the ones you add don't override the defaults, they augment the defaults.
Actually never mind; putting a single bridge in torrcdoes seem to make all those in torrc-defaults get ignored. So maybe there's no problem.
In the 2.x series of PT bundles, compiled Python modules such as Crypto/Cipher/_AES.so were fat binaries containing i386 and x86_64 architectures, just because that was the default behavior of the native compiler. Now using the cross compiler, they come out as i386 only. I found that trying to import such a module caused a runtime error using the default 64-bit Python 2.7 on OS X 10.9. The commit log for 80cb9490726e76768b8dddde6e1d82b9b2ecf3d2 has more information. What I did was add the environment variables