Automate pyinst linux bundle script
In order to be able to have nightly builds of the bundles, we need to automate several steps that right now need manual intervention in the virtualenv. This issue is for documenting the needs and tracking the progress of the script(s) that do this packaging.
Basically, the bundles will be created by activating a special virtualenv (leap-pyinst), that already has:
1. All leap external dependencies installed. 2. pyinstaller installed from develop branch 3. a leap/ module in site-packages, which is the unpacking of the needed sumo tarball 4. some small modifications to the namespace packages, to workaround a bug not currently solved in pyinstaller.
My idea is to reuse this virtualenv, but also having a script to re-create it.
For 1: we should "pip install -r pkg/requirements" for all our repos. After the req-leap split, this no longer will pull leap libraries. For extra speed in this step, we can use the dependencies binaries (wheels) that our CI will publish.
For 2: just clone + checkout/pull + setup install pyinstaller.
For 3: I think for now the script can receive a (local) path to the sumo-tarball to unpack. As an enhancement, we can point it to a -latest symlink somewhere in the ftp where CI will upload it.
For 4: afaik, the only modifications right now (after having tricked the leap deps using the sumo tarball approach) are with the zope namespace. So, what's needed is:
- create bare zope dir in site-packages - touch zope/__init__.py - move the zope.interface folder to zope/ - move the zope.proxy folder to zope/ - remove the zope* eggs in site-packages - remove any refs to these eggs in easy-install.pth ?? (unsure about this, talking from the top of my head)
After these tweaks have been made, the only thing needed would be to invoke pyinstaller against the spec file:
make clean_pkg && make pyinst
A last step is needed, in where we:
(linux) - mv bitmask frozen binary to bitmask-app - cp bitmask-launcher (shell wrapper) to dist/bitmask/bitmask - cp all the needed helper files, tuf config etc - rename dist/bitmask distribution folder to bitmask--
Some missing files are also needed. The right way to do this would be to write specific analysis hooks for pyinstaller, that we should submit upstream. That I can remember now:
- osrandom_engine.{c,h} in cryptography/hazmat/bindings/openssl/ - dbschema.sql in u1db
These missing files can be found by executing dist/bitmask/bitmask binary, the missing path appears in the error message that raises if they aren't added to the dist/bitmask folder.
(from redmine: created on 2015-07-29, closed on 2015-08-07, relates #7304 (closed))