Skip to content

Commit c7eccda

Browse files
committed
Use python3.11 in CI to make sure toml is validated
This also fixes a regression from #106085 which stopped testing that we support python2 in PR CI.
1 parent d808bc2 commit c7eccda

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/bootstrap/bootstrap_test.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,7 @@ def serialize_and_parse(self, args):
9191
# Verify this is actually valid TOML.
9292
tomllib.loads(build.config_toml)
9393
except ImportError:
94-
# too old a version of python
95-
pass
94+
print("warning: skipping TOML validation, need at least python 3.11", file=sys.stderr)
9695
return build
9796

9897
def test_no_args(self):

src/bootstrap/configure.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ def parse_args(args):
251251

252252
if not found:
253253
unknown_args.append(arg)
254-
254+
255255
# Note: here and a few other places, we use [-1] to apply the *last* value
256256
# passed. But if option-checking is enabled, then the known_args loop will
257257
# also assert that options are only passed once.

src/ci/docker/host-x86_64/mingw-check-tidy/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
FROM ubuntu:22.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
4+
# NOTE: intentionally uses python2 for x.py so we can test it still works.
5+
# validate-toolstate only runs in our CI, so it's ok for it to only support python3.
46
RUN apt-get update && apt-get install -y --no-install-recommends \
57
g++ \
68
make \
79
ninja-build \
810
file \
911
curl \
1012
ca-certificates \
13+
python2.7 \
1114
python3 \
1215
python3-pip \
1316
python3-pkg-resources \
@@ -30,4 +33,4 @@ RUN pip3 install --no-deps --no-cache-dir --require-hashes -r /tmp/reuse-require
3033
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
3134
COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
3235

33-
ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy tidyselftest
36+
ENV SCRIPT python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest

src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/Dockerfile

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ FROM ubuntu:22.04
22

33
ARG DEBIAN_FRONTEND=noninteractive
44

5-
# NOTE: intentionally installs both python2 and python3 so we can test support for both.
65
RUN apt-get update && apt-get install -y --no-install-recommends \
76
g++ \
87
gcc-multilib \
@@ -11,8 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
1110
file \
1211
curl \
1312
ca-certificates \
14-
python2.7 \
15-
python3 \
13+
python3.11 \
1614
git \
1715
cmake \
1816
sudo \

0 commit comments

Comments
 (0)