Sunday, February 15, 2015

Major step in pyqt deployment

Yesterday I brought the pyqtdeploy build process to a new make failure: a module named _sqlite didn't compile because a variable MODULE_NAME was not defined. I thought this looked like a generic problem. I could see lots of uses of that name in various modules and no definitions of it anywhere. But I reported it to the PyQt list and quickly a fix specific to that one module was posted.

Meanwhile I figured out that there was no reason to include that module in Cobro anyway. I'd turned it on in the list of modules because cx_freeze had included it. Well, maybe that means it is imported at some level by something, but for now I just turned off the switch in the pyqtdeploy list.

Then the make failed in a new way: by failing to find a library for QtWebEngineWidgets. That is a PyQt module that Cobro definitely needs. So tonight (Sunday night, 8pm) while Marian is working on the Stanford WBB web site ("Bonnie Bombs the Bruins" is the headline from this afternoon's game), I started to look at that.

There exists a QtWebEngineWidgets module in the PyQt5 distribution folder. But the build process for it does not end up copying it to the SYSROOT where all the build stuff is supposed to end up.

It's a convoluted sequence. First pyqtdeploycli runs and leaves behind a .cfg file. Then the configure.py file runs and, based on the .cfg file, creates Makefiles for all the components to be built. Then you run Qmake which runs instantly. Then you run make, and it does about 10 minutes worth of compiles. Then you run make install, and all the compiled modules get copied to SYSROOT.

After an hour of futzing around I figured out that it was simple: the word QtWebEngineWidgets had been omitted from a list of modules in the .cfg file. Presumably due to a bug in pyqtdeploycli. I added that word manually and reran the remaining steps, and hurrah, the library appeared where it is supposed to be.

Then I held my breath and reran the pyqtdeploy build/qmake/make sequence for Cobro. And it ran! It produced in the build folder a Cobro.app.

Which doesn't run.

Because it is clearly unfinished. There is an 18MB executable, Contents/MacOS/Cobro, but on launch it immediately dies because it can't find a library for QtCore. Of course. Some further step is needed to gather up all the Qt Framework modules and add them to the .app structure.

I have no idea what that step is. There is a build/Cobro.pro, a QMake file, and also a build/Makefile. But qmake doesn't do anything and make just says "nothing to be done for `first'."

Still, it's big progress. An actual app may not be too far off.

No comments: