summaryrefslogtreecommitdiffstats
path: root/src/ci/docker/host-x86_64/mingw-check
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/ci/docker/host-x86_64/mingw-check
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/ci/docker/host-x86_64/mingw-check')
-rw-r--r--src/ci/docker/host-x86_64/mingw-check/Dockerfile45
-rwxr-xr-xsrc/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh20
-rwxr-xr-xsrc/ci/docker/host-x86_64/mingw-check/validate-toolstate.sh19
3 files changed, 84 insertions, 0 deletions
diff --git a/src/ci/docker/host-x86_64/mingw-check/Dockerfile b/src/ci/docker/host-x86_64/mingw-check/Dockerfile
new file mode 100644
index 000000000..9ee84f420
--- /dev/null
+++ b/src/ci/docker/host-x86_64/mingw-check/Dockerfile
@@ -0,0 +1,45 @@
+FROM ubuntu:18.04
+
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ g++ \
+ make \
+ ninja-build \
+ file \
+ curl \
+ ca-certificates \
+ python3 \
+ git \
+ cmake \
+ sudo \
+ gdb \
+ xz-utils \
+ libssl-dev \
+ pkg-config \
+ mingw-w64
+
+RUN curl -sL https://nodejs.org/dist/v16.9.0/node-v16.9.0-linux-x64.tar.xz | tar -xJ
+ENV PATH="/node-v16.9.0-linux-x64/bin:${PATH}"
+# Install es-check
+# Pin its version to prevent unrelated CI failures due to future es-check versions.
+RUN npm install es-check@6.1.1 -g
+RUN npm install eslint@8.6.0 -g
+
+COPY scripts/sccache.sh /scripts/
+RUN sh /scripts/sccache.sh
+
+COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
+COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
+
+ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
+ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
+ python3 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu --all-targets && \
+ python3 ../x.py build --stage 0 src/tools/build-manifest && \
+ python3 ../x.py test --stage 0 src/tools/compiletest && \
+ python3 ../x.py test --stage 2 src/tools/tidy && \
+ python3 ../x.py test --stage 0 core alloc std test proc_macro && \
+ python3 ../x.py doc --stage 0 library/test && \
+ /scripts/validate-toolstate.sh && \
+ /scripts/validate-error-codes.sh && \
+ # Runs checks to ensure that there are no ES5 issues in our JS code.
+ es-check es6 ../src/librustdoc/html/static/js/*.js && \
+ eslint -c ../src/librustdoc/html/static/.eslintrc.js ../src/librustdoc/html/static/js/*.js
diff --git a/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh b/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh
new file mode 100755
index 000000000..e9aa948eb
--- /dev/null
+++ b/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+# Checks that no error code explanation is removed.
+
+set -eo pipefail
+
+if [[ -z "$BASE_COMMIT" ]]; then
+ echo "not checking error code explanations removal"
+ exit 0
+fi
+
+echo "Check if an error code explanation was removed..."
+
+if (git diff "$BASE_COMMIT" --name-status | grep '^D' \
+ | grep --quiet "compiler/rustc_error_codes/src/error_codes/"); then
+ echo "Error code explanations should never be removed!"
+ echo "Take a look at E0001 to see how to handle it."
+ exit 1
+fi
+
+echo "No error code explanation was removed!"
diff --git a/src/ci/docker/host-x86_64/mingw-check/validate-toolstate.sh b/src/ci/docker/host-x86_64/mingw-check/validate-toolstate.sh
new file mode 100755
index 000000000..c6d728eb8
--- /dev/null
+++ b/src/ci/docker/host-x86_64/mingw-check/validate-toolstate.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+# A quick smoke test to make sure publish_tooolstate.py works.
+
+set -euo pipefail
+IFS=$'\n\t'
+
+rm -rf rust-toolstate
+git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
+cd rust-toolstate
+python3 "../../src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" \
+ "$(git log --format=%s -n1 HEAD)" "" ""
+# Only check maintainers if this build is supposed to publish toolstate.
+# Builds that are not supposed to publish don't have the access token.
+if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then
+ TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python3 \
+ "../../src/tools/publish_toolstate.py"
+fi
+cd ..
+rm -rf rust-toolstate