@@ -10,21 +10,24 @@ usage() {
1010Build release wheels for rsloop with uv-managed Python interpreters.
1111
1212Usage:
13- scripts/build-wheels.sh [--out DIR] [--skip-python-install] [-- maturin args...]
13+ scripts/build-wheels.sh [--out DIR] [--target TRIPLE] [-- skip-python-install] [-- maturin args...]
1414
1515Options:
1616 -o, --out DIR Output directory for built wheels (default: dist/wheels)
17+ -t, --target TRIPLE Rust compilation target to pass to maturin
1718 --skip-python-install
1819 Reuse installed interpreters instead of running `uv python install`
1920 -h, --help Show this help
2021
2122Environment:
2223 RSLOOP_PYTHON_VERSIONS Space-separated version list to override the defaults
2324 (default: 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.14t)
25+ RSLOOP_RUST_TARGET Rust compilation target to pass to maturin
2426
2527Examples:
2628 scripts/build-wheels.sh
2729 scripts/build-wheels.sh --out wheelhouse
30+ scripts/build-wheels.sh --target aarch64-apple-darwin
2831 RSLOOP_PYTHON_VERSIONS="3.12 3.13 3.14t" scripts/build-wheels.sh -- --features profiler
2932EOF
3033}
@@ -40,6 +43,7 @@ resolve_path() {
4043
4144OUTPUT_DIR=" $DEFAULT_OUTPUT_DIR "
4245INSTALL_PYTHONS=1
46+ RUST_TARGET=" ${RSLOOP_RUST_TARGET:- } "
4347MATURIN_ARGS=()
4448
4549while (( $# )) ; do
@@ -52,6 +56,14 @@ while (($#)); do
5256 OUTPUT_DIR=" $2 "
5357 shift 2
5458 ;;
59+ -t|--target)
60+ if (( $# < 2 )) ; then
61+ echo " missing value for $1 " >&2
62+ exit 1
63+ fi
64+ RUST_TARGET=" $2 "
65+ shift 2
66+ ;;
5567 --skip-python-install)
5668 INSTALL_PYTHONS=0
5769 shift
@@ -102,6 +114,11 @@ for version in "${PYTHON_VERSIONS[@]}"; do
102114 --interpreter " $interpreter "
103115 --out " $OUTPUT_DIR "
104116 )
117+ if [[ -n " $RUST_TARGET " ]]; then
118+ maturin_cmd+=(
119+ --target " $RUST_TARGET "
120+ )
121+ fi
105122 if (( ${# MATURIN_ARGS[@]} )) ; then
106123 maturin_cmd+=(" ${MATURIN_ARGS[@]} " )
107124 fi
0 commit comments