From 98a38673ec5188e04da964ee3d9544f102803444 Mon Sep 17 00:00:00 2001
From: Alex Crichton <alex@alexcrichton.com>
Date: Mon, 10 Dec 2018 19:34:47 -0800
Subject: [PATCH 1/2] Fix build of the `build-manifest` tool

Accidentally broken in #56258!
---
 src/tools/build-manifest/src/main.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs
index d9834f9f0a004..896b380f85c95 100644
--- a/src/tools/build-manifest/src/main.rs
+++ b/src/tools/build-manifest/src/main.rs
@@ -14,7 +14,7 @@ extern crate serde_derive;
 
 use std::collections::BTreeMap;
 use std::env;
-use std::fs::File;
+use std::fs;
 use std::io::{self, Read, Write};
 use std::path::{PathBuf, Path};
 use std::process::{Command, Stdio};

From ddd8b416a6bfa009db997e4e8724fa0069a850dc Mon Sep 17 00:00:00 2001
From: Mark Rousskov <mark.simulacrum@gmail.com>
Date: Mon, 10 Dec 2018 20:40:04 -0700
Subject: [PATCH 2/2] Build manifest tool on mingw-check builder

This builder is not really the correct place to put this, but it
definitely has the time budget and checking this tool builds on just one
platform is more than sufficient.
---
 src/ci/docker/mingw-check/Dockerfile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/ci/docker/mingw-check/Dockerfile b/src/ci/docker/mingw-check/Dockerfile
index aab339f399c59..10aedf6a60e10 100644
--- a/src/ci/docker/mingw-check/Dockerfile
+++ b/src/ci/docker/mingw-check/Dockerfile
@@ -20,4 +20,5 @@ COPY scripts/sccache.sh /scripts/
 RUN sh /scripts/sccache.sh
 
 ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
-ENV SCRIPT python2.7 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu
+ENV SCRIPT python2.7 ../x.py check --target=i686-pc-windows-gnu --host=i686-pc-windows-gnu && \
+           python2.7 ../x.py build --stage 0 src/tools/build-manifest