GithubHelp home page GithubHelp logo

rust-cross / manylinux-cross Goto Github PK

View Code? Open in Web Editor NEW
50.0 2.0 11.0 465 KB

manylinux2014 and manylinux_2_28 aarch64/armv7l/s390x/ppc64/ppc64le cross compilation docker image

License: MIT License

Dockerfile 85.06% Rust 0.51% Python 4.18% Jinja 10.25%
manylinux manylinux2014 pyo3 maturin cross-compilation

manylinux-cross's Introduction

manylinux-cross

manylinux2014 Docker Image manylinux_2_28 Docker Image Test Bors enabled

manylinux2014 and manylinux_2_28 aarch64/armv7l/s390x/ppc64le cross compilation docker images, supports both x86_64(amd64) and aarch64(arm64) architectures.

manylinux2014

Docker image repository: messense/manylinux2014-cross, based on Ubuntu 22.04 with GCC 4.8.5.

Architecture Tag Target Python Host Python
x86_64 x86_64 Copied from manylinux2014_x86_64 Python 3.7 - 3.12
i686 i686 Copied from manylinux2014_i686 Python 3.7 - 3.12
aarch64 aarch64 Copied from manylinux2014_aarch64 Python 3.7 - 3.12
armv7l armv7l / armv7 /opt/python/cp3[7-11], built from source Python 3.7 - 3.12
s390x s390x Copied from manylinux2014_s390x Python 3.7 - 3.12
ppc64 ppc64 /opt/python/cp3[7-11], built from source Python 3.7 - 3.12
ppc64le ppc64le Copied from manylinux2014_ppc64le Python 3.7 - 3.12

manylinux_2_28

Docker image repository: messense/manylinux_2_28-cross, based on Ubuntu 22.04 with GCC 7.5.0.

Architecture Tag Target Python Host Python
x86_64 x86_64 Copied from manylinux_2_28_x86_64 Python 3.7 - 3.12
aarch64 aarch64 Copied from manylinux_2_28_aarch64 Python 3.7 - 3.12
armv7l armv7l / armv7 /opt/python/cp3[7-11], built from source Python 3.7 - 3.12
s390x s390x /opt/python/cp3[7-11], built from source Python 3.7 - 3.12
ppc64le ppc64le /opt/python/cp3[7-11], built from source Python 3.7 - 3.12

Environment variables

Following list of environment variables are set:

  • TARGET_CC
  • TARGET_CXX
  • TARGET_AR
  • TARGET_SYSROOT
  • TARGET_C_INCLUDE_PATH
  • CARGO_BUILD_TARGET
  • CARGO_TARGET_${target}_LINKER

manylinux-cross's People

Contributors

dependabot[bot] avatar imphil avatar messense avatar raymanp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

manylinux-cross's Issues

GCC version

The readme states:

Docker image repository: messense/manylinux2014-cross, based on Ubuntu 22.04 with GCC 4.8.5.

Docker image repository: messense/manylinux_2_28-cross, based on Ubuntu 22.04 with GCC 7.5.0.

But manylinux2014 comes with GCC 10, and manylinux_2_28 comes with GCC 12...? Is this intentional?

PS. Also the /opt/python/cp3[6-11] was not adapted after python 3.6 was dropped.

`manylinux_2_28-cross:x86_64` : `ssl module in Python is not available`

Sorry if I've misunderstood the discussion @ pypa/cibuildwheel#598 but I can't get this to work with cibuildwheel:

# pyproject.toml

[tool.cibuildwheel.linux]
archs = ["x86_64", "aarch64"]
manylinux-x86_64-image = "messense/manylinux_2_28-cross:x86_64"
...

produces

$ cibuildwheel --platform linux

  Installing build dependencies: started
  Running command pip subprocess to install build dependencies
  Using pip 22.3.1 from /opt/_internal/cpython-3.10.8/lib/python3.10/site-packages/pip (python 3.10)
  WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
  WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
  WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
  WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
  WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
  WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError("Can't connect to HTTPS URL because the SSL module is not available.")': /simple/setuptools/
  Could not fetch URL https://pypi.org/simple/setuptools/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='pypi.org', port=443): Max retries exceeded with url: /simple/setuptools/ (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.")) - skipping
  ERROR: Could not find a version that satisfies the requirement setuptools>=42 (from versions: none)
  ERROR: No matching distribution found for setuptools>=42
  error: subprocess-exited-with-error

Currently investigating whether manylinux2014 works...

aarch64 is building bad Python libs

When using armv7l cross Python for building Python libs (cpython), the result is good, however, using the aarch64 cross Python the libs crash when using on target.

I think the problem are the copied cross Pythons in /opt/python from manylinux project for aarch64.
In armv7l the cross pythons are built from scratch. Another cross env where I build the cross python myself like for armv7l the resulting Python libs are good and work correctly on the target aarch64 machine.

Best would be to build the cross pythons for aarch64 from scratch like for armv7l.

What are TARGET_* environment variables?

I see that CC_<target>, CXX_<target>, and etc. are used by rust cc crate. What uses are the TARGET_* environment variables? Are they already used by some common build system (e.g., rustc, cc, cmake), or just for the convenience of the container user as shortcuts?

messense/manylinux_2_28-cross:armv7 broken qemu headers

qemu-arm-static: Could not open '/lib/ld-linux-armhf.so.3': No such file or directory

with libstdc++6-armhf-cross installed

/opt/python/cp310-cp310/bin/python3: error while loading shared libraries: libcrypt.so.1: cannot open shared object file: No such file or directory

setuptools fails on 3.7 and 3.8

I'm having an issue with setuptools failing to run bdist and bdist_wheel

It's so far failed on 3.7 and 3.8 with the same error, but it's fine on 3.10 and 3.9

To reproduce, I'm using cross compilation on the docker image messense/manylinux2014-cross:armv7l.

Source code used to test: https://github.com/vicky5124/lavasnek_rs/

# To reproduce:

# get rust
curl https://sh.rustup.rs -sSf | sh -s -- --target armv7-unknown-linux-gnueabihf stable -y
source $HOME/.cargo/env

# get pip
curl -sS https://bootstrap.pypa.io/get-pip.py | python3.8

# setup cross
python3.8 -m pip install 'crossenv>=1.1.2'
python3.8 -m crossenv /opt/python/cp38-cp38/bin/python3 --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= .venv
source .venv/bin/activate

# setup deps
pip install -U pip wheel setuptools-rust setuptools
export PYO3_CROSS_LIB_DIR="$PWD/.venv/lib"

# build wheel
python setup.py bdist_wheel --dist-dir ./dist/

Anyone has any idea on how to fix this?, I can't find anyone with the same issue providing a solution online.

Also, is this why 3.7 and 3.8 are commented on the CI tests?

Cross compiling "python embedded in rust" binary (pyo3) for armv7

Can your docker images (manylinux2014-cross or manylinux_2_28-cross) be used to cross compile a rust project for an armv7 machine which is using pyo3 to call python? If possible, I would prefer a static embedding of python into the binary.

Here is what I have tried so far:

  1. Create a docker image based on manylinux2014-cross with rust toolchain installed
FROM messense/manylinux2014-cross:armv7
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
RUN /root/.cargo/bin/rustup target add armv7-unknown-linux-gnueabihf
  1. Create a tiny rust project inside the corresponding docker container

Cargo.toml:

[package]
name = "foo"
version = "0.1.0"
edition = "2021"

[dependencies]
pyo3 = { version = "0.18.3", features = ["auto-initialize"] }

main.rs:

use pyo3::prelude::*;

fn main() -> PyResult<()> {
    Python::with_gil(|py| {
        let builtins = PyModule::import(py, "builtins")?;
        let total: i32 = builtins
            .getattr("sum")?
            .call1((vec![1, 2, 3],))?
            .extract()?;
        println!("{total}");
        Ok(())
    })
}
  1. Build with PYO3_CROSS_PYTHON_VERSION=3.11 cargo build

The build fails due to a linker error: ld: cannot find -lpython3.11. It seems to me there is a python installation missing for the target system. Is there an easy way to fix that issue?

ppc64 manylinux2014 Python 3.6

With Python3 being EOL for quite some time, most distros have a way to upgrade to newer Python versions. One example of where it's not the case is (still supported) RHEL-7 ppc64. While for other supported architectures, there is rh-python38 from Software Collections, but ppc64 is stuck with Python3.6.
What it means is that while we can build a cp37 ppc64 python wheel, we have no way to install it on RHEL- 7 or CentOS-7.

So, while ugly, I'm wondering whether it wouldn't make sense to have 3.6 available in manylinux2014-cross:ppc64

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.