Monday, February 23, 2015

PyInstaller and QtWebEngine

While PyInstaller can bundle PPQT2, it cannot bundle Cobro. The difference is QtWebEngine. I've noted before that Cobro, which is basically a browser, was horribly unreliable when it used QtWebKit. I was eager to get Qt5.4 because it came with QtWebEngine, based on the Chrome browser. And executing Cobro from source as a Python app, the difference is striking. I've been running Cobro from the command line daily for a month and it has yet to crash in any way.

Web Engine did come with some problems, as I've noted before. I basically had to give up implementing a custom context menu, and keystrokes for "back" and "forward". And the binaries are huge, totalling close to 100MB when all related modules are counted. But it works! So going back to QWebKit is not an option.

Unfortunately the Web Engine people just can't fit in to the standard Qt ecosystem. In a Mac OS app, the QtWebEngineCore module cannot be dropped into the MacOS folder along with all the QtThisAndThat modules. It has to be placed as a "framework" in the Frameworks folder. If it isn't there, the app won't start; it terminates with the message "Couldn't mmap icudtl.dat". This simple message is the tip of a large, deep iceberg. I've put the ugly details in a PyInstaller issue and won't repeat it all here.

Bottom line, it looks to me as if PyInstaller will never be able to bundle an app using QtWebEngine. This kind of complexity can't be shoe-horned into a "hook", I think.

Which means, Cobro can't be bundled by PyInstaller. I am confident that cx_freeze will have the identical problem. Maybe... just maybe... perhaps when [Py]Qt5.5 comes out, I will pull out and reinstall everything and see if maybe I can get pyqtdeploy to work on it then. Until then, Cobro is just a personal project. I can't hope to distribute it more widely.

No comments: