cairocffi icon indicating copy to clipboard operation
cairocffi copied to clipboard

Create wheels

Open stuaxo opened this issue 6 years ago • 5 comments

This is a ticket to chat about improving installation -

Originally I was going to suggest a manylinux WHL.. but I'm not convinced this is as possible, after having a bit of a play with trying to do this with pycairo.

The problem with using manylinux, is that cairo compiled with the standard options pulls in too many dependencies, since all backends are enabled.

My current thinking is that going to cairo itself and working out how to split up the backends could be an interesting option.

stuaxo avatar Dec 11 '19 12:12 stuaxo

Originally I was going to suggest a manylinux WHL.. but I'm not convinced this is as possible, after having a bit of a play with trying to do this with pycairo.

Cairocffi used to have a wheel package, but as a file has to be generated during installation depending on the Cairo version installed, it was removed.

But. As Cairo’s API is somehow backwards-compatible, we could try to generate and distribute the file generated with the latest version of cairo, and hope that it works for previous versions too. Features added in a recent version of cairocffi would not work with an old version of cairo (probably with an ugly error), but that’s already the case without the wheel. This could fix #140 too.

liZe avatar Mar 29 '20 10:03 liZe

But. As Cairo’s API is somehow backwards-compatible, we could try to generate and distribute the file generated with the latest version of cairo, and hope that it works for previous versions too.

It probably won’t, because we currently use the ABI level, not the API level, as we don’t want users to install a C compiler.

liZe avatar Apr 12 '20 13:04 liZe

Possibly, including a cairo.dll in the whl file would do. See how this site has wheels for cairocffi.

naveen521kk avatar Sep 22 '20 14:09 naveen521kk

When I opened this I was looking at the possibility of using cairocffi in a docker container where I couldn't use a compiler, so Linux not Windows*.

The cairo.dll that you helped get added to pycairo for the next release is statically linked to some of the other dependencies, which may or may not help jhere.

*Not that a WHL wouldn't be a bad thing here.

stuaxo avatar Sep 22 '20 14:09 stuaxo

The cairo.dll that you helped get added to pycairo for the next release is statically linked to some of the other dependencies, which may or may not help jhere.

Possibly generating one through msys doesn't hurt. But that for windows.

Linking those pycairo https://github.com/pygobject/pycairo/pull/191 and https://github.com/pygobject/pycairo/pull/196

naveen521kk avatar Sep 22 '20 15:09 naveen521kk

Just dropping a hint here that cibuildwheel can make this work much easier!

Korijn avatar Oct 19 '22 08:10 Korijn

Just dropping a hint here that cibuildwheel can make this work much easier!

Thanks for the link.

The problem is not that it’s hard to build a wheel. The problem is that a file has to be generated when CairoCFFI is installed, and this file may depend on the version of Cairo installed on the system. So, if we keep this behavior, we can’t use wheels because we can’t build different wheels for different versions of Cairo.

liZe avatar Oct 22 '22 06:10 liZe

As we need to generate files at installation time, we can’t build wheels (as far as we know). If someone’s sure that there’s a reliable solution to build a wheel, please open a new issue!

liZe avatar Mar 11 '23 21:03 liZe