Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add Rust Windows cross toolchain on ubuntu-rolling image #12015

Merged
merged 1 commit into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 --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