From c9b8e4033d056d9921a5566a73740dadda1fc253 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 17 Sep 2021 22:23:09 +0800 Subject: [PATCH] Adjust auditwheel tests --- test-crates/lib_with_disallowed_lib/src/lib.rs | 8 ++++++++ tests/manylinux_incompliant.sh | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/test-crates/lib_with_disallowed_lib/src/lib.rs b/test-crates/lib_with_disallowed_lib/src/lib.rs index e0d8761ed..5dfcd9abb 100644 --- a/test-crates/lib_with_disallowed_lib/src/lib.rs +++ b/test-crates/lib_with_disallowed_lib/src/lib.rs @@ -1,8 +1,16 @@ +use std::os::raw::c_ulong; + use pyo3::prelude::*; +#[link(name = "z")] +extern "C" { + fn gzflags() -> c_ulong; +} + #[pyfunction] fn add(x: usize, y: usize) -> usize { let _version = unsafe { libz_sys::zlibVersion() }; + let _flags = unsafe { gzflags() }; let sum = x + y; sum } diff --git a/tests/manylinux_incompliant.sh b/tests/manylinux_incompliant.sh index 9f0491418..de296fec5 100755 --- a/tests/manylinux_incompliant.sh +++ b/tests/manylinux_incompliant.sh @@ -10,7 +10,7 @@ for PYBIN in /opt/python/cp3[6]*/bin; do fi done -# Fail because we're linking zlib, which is not allowed in manylinux +# Fail because we're linking zlib with black-listed symbols(gzflags), which is not allowed in manylinux yum install -y zlib-devel for PYBIN in /opt/python/cp3[6]*/bin; do if cargo run -- build --no-sdist -m test-crates/lib_with_disallowed_lib/Cargo.toml -i "${PYBIN}/python" --manylinux 2014 -o dist; then