Skip to content

Conversation

@djhoese
Copy link
Member

@djhoese djhoese commented Nov 2, 2022

Conda-forge has been trying for a long time to build a PyPy binary of aggdraw, but has been failing:

conda-forge/aggdraw-feedstock#25

The error is basically:

  aggdraw.cxx:271:1: error: invalid conversion from 'printfunc' {aka 'int (*)(_object*, FILE*, int)'} to 'Py_ssize_t' {aka 'long int'} [-fpermissive]
    271 | };
        | ^
        | |
        | printfunc {aka int (*)(_object*, FILE*, int)}
  aggdraw.cxx:312:1: error: invalid conversion from 'printfunc' {aka 'int (*)(_object*, FILE*, int)'} to 'Py_ssize_t' {aka 'long int'} [-fpermissive]
    312 | };
        | ^
        | |
        | printfunc {aka int (*)(_object*, FILE*, int)}
  error: command '/home/conda/feedstock_root/build_artifacts/aggdraw_1667346120715/_build_env/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1

It turns out printfunc is deprecated and unused, but was repurposed in Python 3.8:

https://peps.python.org/pep-0590/#changes-to-the-pytypeobject-struct

I found a PR in swig that had to make the same type of update (swig/swig#2264) so I copied that simple logic here. Once merged I'll have to cherry-pick it to the maint branch so it can be released for the current stable version.

I should be able to turn on PyPy wheel builds in CI too.

dov and others added 21 commits January 21, 2019 21:55
- Move agg2 source directory to agg
- Update agg to 2.4
- Update aggdraw source to match and work with agg 2.4 interfaces
- Update tests to work with new code
# Conflicts:
#	CHANGELOG.md
Use array delete for point arrays
…troll#62)

* Change default linejoin and linecap to preserve previous behavior

* Change default line_cap from round_cap to butt_cap

* Switch to ci-helpers workaround branch

* Remove leftover copy/paste in appveyor config

* Update tests for butt_cap default

* Switch to strict conda channel priority for consistency

* Switch to strict conda channel priority for consistency

* Try removing CMD_IN_ENV use in appveyor

* Try activating conda environment again

* Add CMD_IN_ENV to environment activate because why not

* Add CMD_IN_ENV to all test runs

* Switch back to upstream ci-helpers tests

* Remove unnecessary CMD_IN_ENV calls in appveyor

* Add conda init for all possible shells on appveyor

* Use conda run to execute python commands

* Remove hopefully unnecessary conda init call

* Switch travis back to upstream ci-helpers repository
Fix "PY_SSIZE_T_CLEAN macro must be defined for '#' formats" error
@djhoese djhoese force-pushed the bugfix-dep-printfunc branch from ea9cc79 to 8f15b50 Compare November 2, 2022 01:33
@djhoese
Copy link
Member Author

djhoese commented Nov 2, 2022

Ok turns out this is much harder than I thought. Here's what Cython says and we're a pure C++ module at this point:

https://cython.readthedocs.io/en/stable/src/userguide/pypy.html

This will just have to wait I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants