1
1
FROM ubuntu:20.04
2
2
3
3
ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ # NOTE: intentionally installs both python2 and python3 so we can test support for both.
4
6
RUN apt-get update && apt-get install -y --no-install-recommends \
5
7
g++ \
6
8
gcc-multilib \
@@ -10,6 +12,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
10
12
curl \
11
13
ca-certificates \
12
14
python2.7 \
15
+ python3.9 \
13
16
git \
14
17
cmake \
15
18
sudo \
@@ -23,6 +26,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
23
26
xz-utils \
24
27
nodejs
25
28
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
+
26
37
COPY scripts/sccache.sh /scripts/
27
38
RUN sh /scripts/sccache.sh
28
39
@@ -33,21 +44,22 @@ ENV RUST_CONFIGURE_ARGS \
33
44
--enable-llvm-link-shared \
34
45
--set rust.thin-lto-import-instr-limit=10
35
46
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 && \
37
49
# Run the `mir-opt` tests again but this time for a 32-bit target.
38
50
# This enforces that tests using `// EMIT_MIR_FOR_EACH_BIT_WIDTH` have
39
51
# both 32-bit and 64-bit outputs updated by the PR author, before
40
52
# the PR is approved and tested for merging.
41
53
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
42
54
# 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 \
44
56
--host='' --target=i686-unknown-linux-gnu && \
45
57
# Run the UI test suite again, but in `--pass=check` mode
46
58
#
47
59
# This is intended to make sure that both `--pass=check` continues to
48
60
# work.
49
61
#
50
- python2.7 .. /x.py --stage 2 test src/test/ui --pass=check \
62
+ .. /x.ps1 --stage 2 test src/test/ui --pass=check \
51
63
--host='' --target=i686-unknown-linux-gnu && \
52
64
# Run tidy at the very end, after all the other tests.
53
65
python2.7 ../x.py --stage 2 test src/tools/tidy
0 commit comments