Tuesday, February 17, 2015

Yet another deployment hitch, cleaning up PPQT2

So at Lloyd Konneker's suggestion, I put a symlink to the Qt distribution in the SYSROOT that is at the heart of the pyqtdeploy process. This makes perfect sense; it is essential that the QMake/Make steps have access to the target version of Qt. I should have realized the need for it before. I'm going to blame my mistake at least in part on the confusing and arcane documentation. Anyway.

With that done, the QMake;make steps run aaaaaalmost to completion. But not quite. The very last, and crucial, step is a huge link that should end up putting all the executable resources into the .app folder. It gets partway; it makes Cobro.app/Contents/MacOS/Cobro, an 18MB executable. But none of the other things, the PyQt and Qt frameworks, make it.

The reason seems to be this "warning" message (not really a warning, it clearly causes the process to abort):

ld: warning: could not create compact unwind for _ffi_call_unix64: does not use RBP or RSP based frame

Searching on that reveals a fair number of people were having problems with "compact unwind" a couple of years ago. Around XCode 4 time one could add an option -no-compact-unwind to get around it. I tried adding that to the LFLAGS in the Makefile but it was rejected as unknown.

Turning from banging my head on pyqtdeploy, I fixed the issue of invalid regex replace strings. I just put try/except around the actual replace operation, and put up a warning dialog for the user to enjoy. Then I had to put another except clause, because there are two classes of exceptions that can come from a regex replace. If there is a syntax error, for example using \g< (an incomplete group name reference) it raises a regex.core exception. But using \2 (when there is no group 2) causes an IndexError. So the try statement has to have two, near-identical except clause suites.

After that I spent some time browsing techs on elance and odesk, looking for people with strong PyQt chops who I might hire to set up deployments for me. I'm looking ahead: supposing I can struggle through and make it work on OSX, then I still have to go through making pyqtdeploy work on Ubuntu and then, even more daunting, Win7. Based on my experience so far, I could spend another 3 or 4 months exasperating myself on that.

So I am thinking I can hire somebody to build me three complete, provisioned, virtual machines, one for each OS, that I can run when I need to deploy a new version. I'd happily spend a few hundred to avoid that pain.

Oh, yesterday I said "I've never butted my head so hard against a problem, for so long, with so little to show for it." Today I remembered there was one other time...

Back in 1986 I wrote a book about OS/2. Heh heh... Amazon never forgets! Anyone in dire need of a copy? I still have a few.

So this was before the thing was released. I had a developer's license and got very occasional pre-releases from Microsoft, but the documentation that came with it was just abysmally bad: badly written, incomplete, and inaccurate. I was trying to write a programming book, a careful guide to the APIs. Thanks to the shitty work Microsoft did, I had to basically reverse-engineer every API call. It was horrible. I hated Microsoft so much for the way they treated me (and all the other developers). After I finally delivered the book, I remember telling my patient spouse that I had been continuously angry for months.

I guess Riverbank and pyqtdeploy are pretty decent, compared to Microsoft and OS/2.

No comments: