Skip to content

Add support for PEP 513 "manylinux1" wheels #71935

@jonringer

Description

@jonringer

Issue description

I would like to add support for manylinux1 wheels as a build format.
Through the use of hooks, I would do an autoPatchelf stage on the .so's where they would get patched to linux against the corresponding dependencies:

libpanelw.so.5
libncursesw.so.5
libgcc_s.so.1
libstdc++.so.6
libm.so.6
libdl.so.2
librt.so.1
libc.so.6
libnsl.so.1
libutil.so.1
libpthread.so.0
libresolv.so.2
libX11.so.6
libXext.so.6
libXrender.so.1
libICE.so.6
libSM.so.6
libGL.so.1
libgobject-2.0.so.0
libgthread-2.0.so.0
libglib-2.0.so.0

How would this look from a python package perspective?

  pname = ...;
  version = ...;
  format = "manylinux1";

or something to that degree, there seems to be a few manylinux related PEPs: 513 571 600

I would probably also have to update fetchPypi to allow for fetching of the format as well with python version info:

 fetchPypi {
   inherit pname version format;
   sha256 = ...;
   pythonVersion = python.version;
  };

Additional changes/challenges

Need someway to say that our python intepreter is conditionally able to support doing manylinux1 builds.

Proposed solution (First thing that comes to mind):
hook for preBuild:

  export NIX_PYTHON_MANYLINUX=1

hook for fixupPhase:

   nativeBuildInputs = nativeBuildInputs ++ [ autoPatchelfHook ];
   buildInputs = buildInputs ++ [ ... list of required libraries ... ];

changes to python interpreter:

  echo "import os; manylinux1_compatible = not os.environ.get('NIX_PYTHON_MANYLINUX')" >> $out/lib/${libPrefix}/_manylinux.py

cc @FRidh

Metadata

Metadata

Assignees

No one assigned

    Labels

    0.kind: enhancementAdd something new or improve an existing system.6.topic: pythonPython is a high-level, general-purpose programming language.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions