Skip to content

Commit

Permalink
ci: Add Rust Windows cross toolchain on ubuntu-rolling image
Browse files Browse the repository at this point in the history
  • Loading branch information
xclaesse committed Jul 20, 2023
1 parent 1d84989 commit 8ba05c1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ci/ciimage/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ def gen_bashrc(self) -> None:
# 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
Expand Down
7 changes: 7 additions & 0 deletions ci/ciimage/ubuntu-rolling/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
source "$HOME/.cargo/env"
rustup target add x86_64-pc-windows-gnu

# cleanup
apt-get -y clean
apt-get -y autoclean

0 comments on commit 8ba05c1

Please sign in to comment.