#67524 closed defect (fixed)

boost: python 3.11 support: add upstream enum/gc patch, to avoid downstream build failures

Reported by: mascguy (Christopher Nielsen) Owned by: mascguy (Christopher Nielsen)
Priority: Normal Milestone:
Component: ports Version: 2.8.1
Keywords: Cc: michaelld (Michael Dickens), cjones051073 (Chris Jones), barracuda156
Port: boost

Description

Python 3.11 introduced stricter checks for enum types, which can sometimes cause issues for downstream projects:

88429 - Better explain the GC contract for PyType_FromSpecWithBases

And indeed, this causes issues for Boost, which required a subsequent upstream fix:

Boost Python: Fix enum_type_object type on Python 3.11

The full description from the latter commit is:

The enum_type_object type inherits from PyLong_Type which is not tracked by the GC. Instances doesn't have to be tracked by the GC: remove the Py_TPFLAGS_HAVE_GC flag.

In terms of real-world impact, this caused issues for deluge, via the following PR/comment:

PR 16069 - deluge: update to 2.0.5

But testing locally with the upstream patch included, fixes the issue. So we need to patch all Boost releases that support Python 3.11, to avoid downstream impact.

Change History (4)

comment:1 Changed 11 months ago by mascguy (Christopher Nielsen)

Cc: barracuda156 added

comment:2 Changed 11 months ago by Christopher Nielsen <mascguy@…>

In 2b5cd04e1204a385214673c727f2163992be9283/macports-ports (master):

boost180: python: add upstream patch for enum/gc
See: #67524

comment:3 Changed 11 months ago by Christopher Nielsen <mascguy@…>

In 027409b7f393b25a85d76b1dcecc9cf98d1f3074/macports-ports (master):

boost1{76..79}: python: add upstream patch for enum/gc
See: #67524

comment:4 Changed 11 months ago by mascguy (Christopher Nielsen)

Resolution: fixed
Status: assignedclosed

Patch now applied for boost1{76..80}, so we're done.

Observers: The patch is included in upstream releases starting with boost181, so we'll be good going forward.

Note: See TracTickets for help on using tickets.