aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2023-07-14 15:17:33 -0400
committerXavier Claessens <xclaesse@gmail.com>2023-07-20 13:51:25 -0400
commitded2204d2c0c24a6f338b4b71b2e1e0a0f184bf3 (patch)
treeb501702b8de09fe5572f4c359ba9fd3bb8a324b2
parent0bb1647fd15cc112098daf9961b2e01cb4e9cd23 (diff)
downloadmeson-ded2204d2c0c24a6f338b4b71b2e1e0a0f184bf3.zip
meson-ded2204d2c0c24a6f338b4b71b2e1e0a0f184bf3.tar.gz
meson-ded2204d2c0c24a6f338b4b71b2e1e0a0f184bf3.tar.bz2
ci: Add Rust Windows cross toolchain on ubuntu-rolling image
-rwxr-xr-xci/ciimage/build.py6
-rwxr-xr-xci/ciimage/ubuntu-rolling/install.sh7
2 files changed, 13 insertions, 0 deletions
diff --git a/ci/ciimage/build.py b/ci/ciimage/build.py
index 0197955..559723c 100755
--- a/ci/ciimage/build.py
+++ b/ci/ciimage/build.py
@@ -74,6 +74,12 @@ class Builder(BuilderBase):
# Also add /ci to PATH
out_data += 'export PATH="/ci:$PATH"\n'
+ out_data += '''
+ if [ -f "$HOME/.cargo/env" ]; then
+ source "$HOME/.cargo/env"
+ fi
+ '''
+
out_file.write_text(out_data, encoding='utf-8')
# make it executable
diff --git a/ci/ciimage/ubuntu-rolling/install.sh b/ci/ciimage/ubuntu-rolling/install.sh
index 697ef06..a02eb8f 100755
--- a/ci/ciimage/ubuntu-rolling/install.sh
+++ b/ci/ciimage/ubuntu-rolling/install.sh
@@ -50,6 +50,13 @@ dub_fetch dubtestproject
dub build dubtestproject:test1 --compiler=ldc2
dub build dubtestproject:test2 --compiler=ldc2
+# Remove debian version of Rust and install latest with rustup.
+# This is needed to get the cross toolchain as well.
+apt-get -y remove rustc || true
+wget -O - https://sh.rustup.rs | sh -s -- -y --profile minimal --component clippy
+source "$HOME/.cargo/env"
+rustup target add x86_64-pc-windows-gnu
+
# cleanup
apt-get -y clean
apt-get -y autoclean