Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ jobs:
- target: "loongarch64-unknown-linux-gnu"
image: "manylinux_2_36-cross:loongarch64"
compatibility: "manylinux_2_36"
- target: "riscv64gc-unknown-linux-gnu"
image: "manylinux_2_39-cross:riscv64"
compatibility: "manylinux_2_39"
container:
image: docker://ghcr.io/rust-cross/${{ matrix.platform.image }}
env:
Expand All @@ -178,9 +181,9 @@ jobs:
- uses: actions/checkout@v4
# powerpc64le-unknown-linux-musl doesn't have official std library release
- run: rustup target add --toolchain stable ${{ matrix.platform.target }}
if: ${{ !contains(fromJson('["powerpc64le-unknown-linux-musl", "s390x-unknown-linux-gnu", "loongarch64-unknown-linux-gnu"]'), matrix.platform.target) }}
if: ${{ !contains(fromJson('["powerpc64le-unknown-linux-musl", "s390x-unknown-linux-gnu", "loongarch64-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu"]'), matrix.platform.target) }}
- uses: dtolnay/rust-toolchain@stable
if: contains(fromJson('["s390x-unknown-linux-gnu", "loongarch64-unknown-linux-gnu"]'), matrix.platform.target)
if: contains(fromJson('["s390x-unknown-linux-gnu", "loongarch64-unknown-linux-gnu", "riscv64gc-unknown-linux-gnu"]'), matrix.platform.target)
with:
targets: ${{ matrix.platform.target }}
- name: Build wheel
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ jobs:
abi: cp310-cp310
python: python3.10
container: ghcr.io/rust-cross/manylinux_2_36-cross:loongarch64
- target: riscv64gc-unknown-linux-gnu
abi: cp310-cp310
python: python3.10
container: ghcr.io/rust-cross/manylinux_2_39-cross:riscv64
extra-args: --manylinux 2_39
# PyPy
- target: aarch64-unknown-linux-gnu
abi: pp310-pypy310_pp73
Expand All @@ -408,18 +413,18 @@ jobs:
run: |
set -ex
# Use bundled sysconfig
bin/maturin build -i ${{ matrix.platform.python }} --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml
bin/maturin build -i ${{ matrix.platform.python }} --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml ${{ matrix.platform.extra-args }}

# Use PYO3_CROSS_LIB_DIR
export PYO3_CROSS_LIB_DIR=/opt/python/${{ matrix.platform.abi }}
bin/maturin build -i python3.9 --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml
bin/maturin build -i python3.9 --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml ${{ matrix.platform.extra-args }}
unset PYO3_CROSS_LIB_DIR

# Test abi3
bin/maturin build -i ${{ matrix.platform.python }} --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-pure/Cargo.toml
bin/maturin build -i ${{ matrix.platform.python }} --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-pure/Cargo.toml ${{ matrix.platform.extra-args }}

# --find-interpreter
bin/maturin build --find-interpreter --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml
bin/maturin build --find-interpreter --release --out dist --target ${{ matrix.platform.target }} -m test-crates/pyo3-mixed/Cargo.toml ${{ matrix.platform.extra-args }}

test-bootstrap:
name: Test Bootstrap
Expand Down
2 changes: 1 addition & 1 deletion src/target/legacy_py.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ pub(super) static IOS_ARCHES: &[&str] = &["arm64", "x86_64"];
pub(super) static ANDROID_ARCHES: &[&str] = &["armeabi_v7a", "arm64_v8a", "x86", "x86_64"];

pub(super) static MANYLINUX_ARCHES: &[&str] = &[
"x86_64", "i686", "aarch64", "armv7l", "ppc64le", "s390x", "ppc64",
"x86_64", "i686", "aarch64", "armv7l", "ppc64le", "s390x", "ppc64", "riscv64",
];

pub(super) static MUSLLINUX_ARCHES: &[&str] =
Expand Down
16 changes: 9 additions & 7 deletions src/target/pypi_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ pub fn is_arch_supported_by_pypi(target: &Target) -> bool {
/// Validates that a wheel platform tag is allowed by PyPI.
///
/// Based on PyPI warehouse platform tag validation logic.
///
fn is_platform_tag_allowed_by_pypi(platform_tag: &str) -> bool {
// Covers old Windows and old manylinux tags.
if ALLOWED_PLATFORMS.contains(&platform_tag) {
Expand Down Expand Up @@ -170,7 +171,8 @@ mod tests {
// manylinux platforms
("manylinux2014_x86_64", true),
("manylinux_2_17_aarch64", true),
("manylinux_2_17_riscv64", false),
("manylinux_2_17_riscv64", true),
("manylinux_2_39_riscv64", true),
// musllinux platforms
("musllinux_1_1_x86_64", true),
("musllinux_1_1_riscv64", false),
Expand Down Expand Up @@ -222,12 +224,12 @@ mod tests {
("x86_64-unknown-linux-gnu", true),
("aarch64-linux-android", true),
("armv7-linux-androideabi", true),
("riscv64gc-unknown-linux-gnu", false), // Unsupported
("x86_64-unknown-freebsd", false), // Now unsupported (no lazy validation)
("powerpc64-unknown-linux-gnu", true), // PPC64 on Linux is supported
("s390x-unknown-linux-gnu", true), // s390x on Linux is supported
("wasm32-unknown-emscripten", false), // Emscripten is unsupported
("i686-pc-windows-msvc", true), // i686 Windows is supported
("riscv64gc-unknown-linux-gnu", true),
("x86_64-unknown-freebsd", false), // Now unsupported (no lazy validation)
("powerpc64-unknown-linux-gnu", true), // PPC64 on Linux is supported
("s390x-unknown-linux-gnu", true), // s390x on Linux is supported
("wasm32-unknown-emscripten", false), // Emscripten is unsupported
("i686-pc-windows-msvc", true), // i686 Windows is supported
];

for (triple, expected) in targets {
Expand Down
4 changes: 2 additions & 2 deletions tests/common/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ pub fn pypi_compatibility_unsupported_target() -> Result<()> {
"--compatibility",
"pypi",
"--target",
"riscv64gc-unknown-linux-gnu", // Unsupported by PyPI
"riscv32gc-unknown-linux-gnu", // Unsupported by PyPI
"--target-dir",
"test-crates/targets/pypi_compatibility_unsupported_target",
"--out",
Expand All @@ -178,7 +178,7 @@ pub fn pypi_compatibility_unsupported_target() -> Result<()> {
let err_string = err.to_string();
assert!(
err_string.contains(
"Target riscv64gc-unknown-linux-gnu architecture is not supported by PyPI"
"Target riscv32gc-unknown-linux-gnu architecture is not supported by PyPI"
),
"{err_string}",
);
Expand Down
Loading