changeset 52901:811584a7fa99

ci: build rust wheel too We start with the one we need for the CI first.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 12 Dec 2024 00:51:26 +0000
parents 7132a6dd6c82
children e02a286c1968
files contrib/build-one-linux-wheel.sh contrib/heptapod-ci.yml
diffstat 2 files changed, 20 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/build-one-linux-wheel.sh	Sat Feb 15 16:25:29 2025 +0100
+++ b/contrib/build-one-linux-wheel.sh	Thu Dec 12 00:51:26 2024 +0000
@@ -6,13 +6,25 @@
 set -eu
 
 if [ $# -lt 2 ]; then
-    echo "usage $0 PYTHONTAG DEST_DIR" >&2
+    echo "usage $0 PYTHONTAG DEST_DIR [FLAVOR]" >&2
     echo "" >&2
     echo 'PYTHONTAG should be of the form "cp310-cp310"' >&2
     exit 64
 fi
 py_tag=$1
 destination_directory=$2
+flavor=${3:-c}
+
+
+flavor_arg=""
+if [[ "${flavor}" == "c" ]]; then
+    :
+elif [[ "$flavor" == "rust" ]]; then
+    flavor_arg="--config-setting=--global-option=--rust"
+else
+    echo "unknown flavor: \"$flavor\""
+    exit 96
+fi
 
 
 tmp_wheel_dir=./tmp-wheelhouse
@@ -20,6 +32,6 @@
 if [ -e $tmp_wheel_dir ]; then
     rm -rf $tmp_wheel_dir
 fi
-/opt/python/$py_tag/bin/python -m build --outdir $tmp_wheel_dir
+/opt/python/$py_tag/bin/python -m build --outdir $tmp_wheel_dir $flavor_arg
 # adjust it to make it universal
 auditwheel repair $tmp_wheel_dir/*.whl -w $destination_directory
--- a/contrib/heptapod-ci.yml	Sat Feb 15 16:25:29 2025 +0100
+++ b/contrib/heptapod-ci.yml	Thu Dec 12 00:51:26 2024 +0000
@@ -104,7 +104,7 @@
     - test -n "$WHEEL_TYPE"
     - echo $FLAVOR
     - mkdir -p wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
-    - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID
+    - contrib/build-one-linux-wheel.sh $BUILD_PY_ID wheels/$PLATFORM/$WHEEL_TYPE/$BUILD_PY_ID $WHEEL_TYPE
   artifacts:
     paths:
       - wheels/
@@ -126,6 +126,11 @@
           - cp312-cp312
           - cp313-cp313
 
+build-rust-wheel:
+  image: "registry.heptapod.net:443/mercurial/ci-images/core-wheel-x86_64-rust:v3.0"
+  extends: build-c-wheel
+  variables:
+    WHEEL_TYPE: "rust"
 
 .wheel-trigger:
   extends: .trigger