Skip to content

Commit

Permalink
Use python3.11 in CI to make sure toml is validated
Browse files Browse the repository at this point in the history
This also fixes a regression from
rust-lang#106085 which stopped testing that
we support python2 in PR CI.
  • Loading branch information
jyn514 committed Mar 17, 2023
1 parent d808bc2 commit c7eccda
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions src/bootstrap/bootstrap_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ def serialize_and_parse(self, args):
# Verify this is actually valid TOML.
tomllib.loads(build.config_toml)
except ImportError:
# too old a version of python
pass
print("warning: skipping TOML validation, need at least python 3.11", file=sys.stderr)
return build

def test_no_args(self):
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ def parse_args(args):

if not found:
unknown_args.append(arg)

# Note: here and a few other places, we use [-1] to apply the *last* value
# passed. But if option-checking is enabled, then the known_args loop will
# also assert that options are only passed once.
Expand Down
5 changes: 4 additions & 1 deletion src/ci/docker/host-x86_64/mingw-check-tidy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM ubuntu:22.04

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

ENV SCRIPT python3 ../x.py test --stage 0 src/tools/tidy tidyselftest
ENV SCRIPT python2.7 ../x.py test --stage 0 src/tools/tidy tidyselftest
4 changes: 1 addition & 3 deletions src/ci/docker/host-x86_64/x86_64-gnu-llvm-14/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ FROM ubuntu:22.04

ARG DEBIAN_FRONTEND=noninteractive

# NOTE: intentionally installs both python2 and python3 so we can test support for both.
RUN apt-get update && apt-get install -y --no-install-recommends \
g++ \
gcc-multilib \
Expand All @@ -11,8 +10,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
file \
curl \
ca-certificates \
python2.7 \
python3 \
python3.11 \
git \
cmake \
sudo \
Expand Down

0 comments on commit c7eccda

Please sign in to comment.