Skip to content

Commit 619f0c2

Browse files
committed
Execute smoke test in VM for m68k
1 parent a749693 commit 619f0c2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

.github/workflows/nightly_rustc.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ jobs:
4848
remove_packages_one_command: true
4949
remove_folders: "/usr/share/swift /usr/share/miniconda /usr/share/az* /usr/local/lib/node_modules /usr/local/share/chromium /usr/local/share/powershell /usr/local/julia /usr/local/aws-cli /usr/local/aws-sam-cli /usr/share/gradle"
5050

51+
- name: Install packages
52+
if: ${{ matrix.arch.cross_target != '' }}
53+
run: |
54+
sudo apt-get update
55+
sudo apt-get install qemu-system qemu-user-static
56+
5157
# `rustup show` installs from rust-toolchain.toml
5258
- name: Setup rust toolchain
5359
run: rustup show
@@ -63,6 +69,10 @@ jobs:
6369
sudo dpkg --force-overwrite -i package.deb
6470
done
6571
72+
- name: Download VM artifact
73+
if: ${{ matrix.arch.cross_target != '' }}
74+
run: curl -LO https://github.com/cross-cg-gcc-tools/vms/releases/latest/download/debian-${{ matrix.arch.cross_target }}.img
75+
6676
- name: Download cross-compiling libgccjit.so and move it in libgccjit-libs-dir
6777
if: ${{ matrix.arch.cross_target != '' }}
6878
run: |
@@ -84,6 +94,13 @@ jobs:
8494
mkdir -p $dir
8595
mv libgccjit-${{ matrix.arch.cross_target }}.so $dir/libgccjit.so
8696
97+
- name: Prepare VM
98+
if: ${{ matrix.arch.cross_target != '' }}
99+
run: |
100+
mkdir vm
101+
sudo mount debian-${{ matrix.arch.cross_target }}.img vm
102+
sudo cp $(which qemu-${{ matrix.arch.cross_target }}-static) vm/usr/bin/
103+
87104
- name: Patch linux-raw-sys and rustix.
88105
if: ${{ matrix.arch.cross_target != '' }}
89106
run: |
@@ -115,15 +132,35 @@ jobs:
115132
./x build --host=${{ matrix.arch.host_target }} --stage 2 --config ../rustc_codegen_gcc/tests/bootstraps/bootstrap.${{ matrix.arch.host_target }}.toml
116133
117134
- name: Link toolchain
135+
if: ${{ matrix.arch.cross_target == '' }}
118136
run: |
119137
cd rust
120138
rustup toolchain link my-toolchain build/${{ matrix.arch.host_target }}/stage2
121139
122140
- name: Smoke test
141+
if: ${{ matrix.arch.cross_target == '' }}
123142
run: |
124143
rustc +my-toolchain -V > output
125144
grep rustc output
126145
146+
- name: Copy toolchain in VM
147+
if: ${{ matrix.arch.cross_target != '' }}
148+
run: |
149+
echo **** .
150+
ls
151+
echo **** vm
152+
ls vm
153+
echo **** vm/home
154+
ls vm/home
155+
echo ****
156+
rsync -a --exclude=stage2/lib/rustlib/src --exclude=stage2/lib/rustlib/rustc-src/ rust/build/m68k-unknown-linux-gnu/stage2 vm/home/stage2
157+
158+
- name: Smoke test
159+
if: ${{ matrix.arch.cross_target != '' }}
160+
run: |
161+
sudo chroot vm qemu-m68k-static /home/stage2/rustc > output
162+
grep rustc output
163+
127164
- name: Compile test program
128165
run: |
129166
cd rustc_codegen_gcc/tests/hello-world

0 commit comments

Comments
 (0)