forked from PyO3/setuptools-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-wheels.sh
executable file
·29 lines (25 loc) · 1.02 KB
/
build-wheels.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
set -e -x
mkdir ~/rust-installer
curl -sL https://static.rust-lang.org/rustup.sh -o ~/rust-installer/rustup.sh
sh ~/rust-installer/rustup.sh --prefix=~/rust --spec=nightly -y --disable-sudo
export PATH="$HOME/rust/bin:$PATH"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$HOME/rust/lib"
# Compile wheels
for PYBIN in /opt/python/cp{27,35,36,37}*/bin; do
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"
export PYTHON_LIB=$(${PYBIN}/python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
export LIBRARY_PATH="$LIBRARY_PATH:$PYTHON_LIB"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PYTHON_LIB"
rm -f /io/build/lib.*
"${PYBIN}/pip" install -U setuptools setuptools-rust wheel
"${PYBIN}/pip" wheel /io/ -w /io/dist/
done
# Bundle external shared libraries into the wheels
for whl in /io/dist/*.whl; do
auditwheel repair "$whl" -w /io/dist/
done
# Install packages and test
for PYBIN in /opt/python/cp{27,35,36,37}*/bin/; do
"${PYBIN}/pip" install hello-rust --no-index -f /io/dist/
done