Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PyPy and linux cross compilation #46

Merged
merged 3 commits into from
Mar 13, 2021
Merged

Fix PyPy and linux cross compilation #46

merged 3 commits into from
Mar 13, 2021

Conversation

messense
Copy link
Contributor

@messense messense commented Mar 13, 2021

The culprit is that extension-module feature was disabled by accident.

maturin build -i python --release --out dist --no-sdist --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} --cargo-extra-args="--no-default-features" --cargo-extra-args="--features=abi3,extension-module" # disable mimallocator
' > build-wheel.sh

docker run --rm -v "$PWD":/io -w /io messense/manylinux2014-cross:${{ matrix.platform.arch }} bash build-wheel.sh
Copy link
Contributor Author

@messense messense Mar 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ubuntu-16.04 causing cannot allocate memory in static TLS block error when importing the built wheel which I believe is a issue with glibc. messense/manylinux2014-cross docker images use glibc 2.17 which is compliant with manylinux2014 on aarch64 and armv7l.

https://github.com/messense/pyrus-cramjam/runs/2101449199?check_suite_focus=true

echo 'curl -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable
source ~/.cargo/env
rustup target add ${{ matrix.platform.target }}
maturin build -i python --release --out dist --no-sdist --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} --cargo-extra-args="--no-default-features" --cargo-extra-args="--features=abi3,extension-module" # disable mimallocator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to disable mimalloctor because we don't have a C11 compatible C compiler in the docker container.

Copy link
Owner

@milesgranger milesgranger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thank you so much! 🚀

@milesgranger milesgranger merged commit 3201a5a into milesgranger:rust-file Mar 13, 2021
@messense messense deleted the rust-file branch March 13, 2021 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants