[tor-dev] Fwd: Reproducibility of Pluggable Transports python.msi

Joseph Bisch joseph.bisch at gmail.com
Wed Sep 9 15:49:21 UTC 2015


I'm resending this, because tor-dev didn't accept my message
originally. Sorry David and Jeremy for the double message.
____________________________________________________

Hello David and Jeremy,

I am the "reproducible build specialist" that Jeremy was referring to,
though I don't know if I would call myself that. As Jeremy said,
Armory isn't yet reproducible on Windows, but hopefully some of this
information will be helpful.

First of all, none of the following has been wrapped in Gitian and
checked for reproducibility yet, because I was primarily concerned
with just getting cross-compiling of Python working first. But it is
at least possible to cross-compile Python 3.4.3.

I have a PR[0] open for Armory that covers the whole exe creation
process using pyqtdeploy, but a lot of that is probably not relevant
to Tor if something other than pyqtdeploy is used. So I will go over
the parts specifically having to do with building Python from source.
Also, the PR isn't fully working yet.

I found that Python 2 is much more difficult to get cross-compiling
than Python 3. So I decided to go with Python 3. I used the patches[1]
that the Arch Linux Mingw Python 3 package uses.

Before compiling Python, you will want to compile OpenSSL.

I have instructions for building Python 3 from source. Since steps two
and three are probably only relevant in Armory's case (we are building
Python statically and then "freezing" it with pyqtdeploy, so all
modules need to be embedded), you just have to download the Python
3.4.3 source and the Arch patches and run the build_py3.sh script[3].
That is the latest script, so don't use the one in the PR. The script
is still a little fragile (everything seems to work with the build I
did on my desktop, but importing json with the build I did on my
laptop gives a PyInit_Thread error and importing hashlib gives a page
fault). Also, I'm not sure if every flag/variable is necessary for the
build to work.

Also, my latest comment[4] on the PR explains some things I had to do
to the OpenSSL and Python source trees to get the build working. I
should probably make patches out of them and they may be appropriate
for integration into OpenSSL and Python upstream. Though I don't know
how my changes affect other system configurations, such as when
someone is compiling on Windows.

Hope that helps. I'd also appreciate any feedback anyone might have.
Also, let me know if there is a better channel to talk about this,
because getting Python to cross-compile isn't strictly tor-dev
related.

[0] - https://github.com/etotheipi/BitcoinArmory/pull/303
[1] - https://github.com/Alexpux/MINGW-packages/tree/master/mingw-w64-python3
[2] - https://github.com/josephbisch/BitcoinArmory/blob/autotools-windows/mingwbuild/build_py3_instructions.txt
[3] - https://gist.github.com/josephbisch/cf2d32a798f063f0bf71
[4] - https://github.com/etotheipi/BitcoinArmory/pull/303#issuecomment-138762224

Cheers,
Joseph


More information about the tor-dev mailing list