Skip to content

Built Chaco may be binary-incompatible with older NumPy versions #778

@mdickinson

Description

@mdickinson

PR #730 introduced a pyproject.toml that declares build dependencies - this means that a pip install chaco will automatically first install NumPy, instead of just failing because NumPy isn't present in the build environment.

But there's a subtle problem here: with the current pyproject.toml,

  • pip install chaco will build Chaco against the latest release of NumPy available from PyPI (regardless of any version of NumPy that happens to already be in the environment)
  • the extension modules generated this way will not necessarily be compatible with earlier versions of NumPy

The result is that the built Chaco may segfault if installed into an environment whose NumPy version is not the latest NumPy.

As a general rule, extension modules built against earlier versions of NumPy can reasonably be expected to be ABI-compatible with later versions of NumPy, but not the other way around.

A possible solution is to pin the NumPy version (just to the minor version, not the bugfix level) used for the build to the earliest NumPy version that we might want to support. This is the approach taken in ibm2ieee, for example.

See also previous discussion in #467.

xref: enthought/ibm2ieee#7, enthought/ibm2ieee#8, enthought/ibm2ieee#9, enthought/ibm2ieee#10
further reading: pypa/pip#6144, pypa/pip#4582, numpy/numpy#5888

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions