Re: [gtk-osx-devel] python3 modules





On Jan 6, 2018, at 4:48 AM, Antoine Martin <antoine nagafix co uk> wrote:

Hi,

The xpra project is finally trying to migrate from GTK2 to GTK3, and
also making the jump to Python 3 whilst we're at it.
We have a fairly large number of python module dependencies for which we
have created a moduleset:
http://xpra.org/trac/browser/xpra/trunk/osx/jhbuild/xpra-python.modules

What is the recommended way to build the same module for both python2
and python3?
I was hoping to minimize the moduleset duplication, but the python3
version needs to depend on "python3" so they need a different XML node.
Unless we can just remove the python dependency altogether and always
ensure it is built early?

Then I was hoping to use the distutils "python3" attribute to avoid
having to mess with symlinks from python to python3, but that didn't
seem to have the desired effect. Am I missing something?

Another problem with building them twice is that jhbuild will keep the
existing checkout directory since the path is the same, and the source
doesn't get cleaned automatically so it seems quite easy to get things
messed up.

Are there any better solutions?


BTW, I believe there's a mistake on the home page:
https://wiki.gnome.org/Projects/GTK+/OSX/Building
It should say:
ln -sf python3-config python-config
Instead of:
ln -sf python3-config python

You can set up the dependencies to build for *either* Py2 or Py3 by putting both in an <after> block instead 
of a <dependencies> block. The caveat is that you must then include one or the other in the list of modules 
to build, either directly or indirectly via a meta-module.

For a module to be built for both, put both in the dependencies. In that case the underlying project must be 
written to work with two versions of python at once. That’s easy for a cmake, meson, or autotools project but 
is beyond the abilities of waf and distutils.

No, you’re not missing anything about the distutils python3 attribute, but unfortunately a couple of projects 
are: They insist on using the python and python-config symlinks regardless of what we tell distutils or set 
in the environment.

Jhbuild always builds clean if you build out-of-tree (set ‘buildroot in your jhbuildrc-custom)’ , but some 
projects do dumb things in their build system that makes it not work. In those cases you can pass --clean to 
jhbuild on the command line or setting “makeclean” in your jhbuildrc-custom. I recommend that you build 
out-of-tree as much as possible. Set supports-out-of-tree-builds=“false” in any modules where the underlying 
project requires building in source.

You’re right about the wiki page. Fixed, thanks.

Regards,
John Ralls



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]