11FROM ubuntu:20.04
22
33ARG DEBIAN_FRONTEND=noninteractive
4+
5+ # NOTE: intentionally installs both python2 and python3 so we can test support for both.
46RUN apt-get update && apt-get install -y --no-install-recommends \
57 g++ \
68 gcc-multilib \
@@ -10,6 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1012 curl \
1113 ca-certificates \
1214 python2.7 \
15+ python3.9 \
1316 git \
1417 cmake \
1518 sudo \
@@ -23,6 +26,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2326 xz-utils \
2427 nodejs
2528
29+ # Install powershell so we can test x.ps1 on Linux
30+ RUN apt-get update && \
31+ apt-get install -y apt-transport-https software-properties-common && \
32+ curl -s "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" > packages-microsoft-prod.deb && \
33+ dpkg -i packages-microsoft-prod.deb && \
34+ apt-get update && \
35+ apt-get install -y powershell
36+
2637COPY scripts/sccache.sh /scripts/
2738RUN sh /scripts/sccache.sh
2839
@@ -33,21 +44,22 @@ ENV RUST_CONFIGURE_ARGS \
3344 --enable-llvm-link-shared \
3445 --set rust.thin-lto-import-instr-limit=10
3546
36- ENV SCRIPT python2.7 ../x.py --stage 2 test --exclude src/tools/tidy && \
47+ # NOTE: intentionally uses all of `x.py`, `x.sh`, and `x.ps1` to make sure they all work on Linux.
48+ ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
3749 # Run the `mir-opt` tests again but this time for a 32-bit target.
3850 # This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
3951 # both 32-bit and 64-bit outputs updated by the PR author, before
4052 # the PR is approved and tested for merging.
4153 # It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
4254 # despite having different output on 32-bit vs 64-bit targets.
43- python2.7 .. /x.py --stage 2 test src/test/mir-opt \
55+ .. /x.sh --stage 2 test src/test/mir-opt \
4456 --host='' --target=i686-unknown-linux-gnu && \
4557 # Run the UI test suite again, but in `--pass=check` mode
4658 #
4759 # This is intended to make sure that both `--pass=check` continues to
4860 # work.
4961 #
50- python2.7 .. /x.py --stage 2 test src/test/ui --pass=check \
62+ .. /x.ps1 --stage 2 test src/test/ui --pass=check \
5163 --host='' --target=i686-unknown-linux-gnu && \
5264 # Run tidy at the very end, after all the other tests.
5365 python2.7 ../x.py --stage 2 test src/tools/tidy
0 commit comments