Skip to content

Commit c8f0d49

Browse files
committed
Auto merge of rust-lang#122321 - majaha:mingw_ci_new, r=Mark-Simulacrum
`mv` tools off the path instead of `rm -r`-ing them in `install-msys2.sh` This is a follow up patch to rust-lang#121182 r? `@Mark-Simulacrum`
2 parents a615cea + 2c77140 commit c8f0d49

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

INSTALL.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ toolchain.
154154
however this is not recommended as it's excrutiatingly slow, and not frequently
155155
tested for compatability.
156156

157-
2. Start a MINGW64 or MINGW32 shell (depending on whether you want 32-bit
157+
3. Start a MINGW64 or MINGW32 shell (depending on whether you want 32-bit
158158
or 64-bit Rust) either from your start menu, or by running `mingw64.exe`
159159
or `mingw32.exe` from your MSYS2 installation directory (e.g. `C:\msys64`).
160160

161-
3. From this terminal, install the required tools:
161+
4. From this terminal, install the required tools:
162162

163163
```sh
164164
# Update package mirrors (may be needed if you have a fresh install of MSYS2)
@@ -178,7 +178,7 @@ toolchain.
178178
mingw-w64-x86_64-ninja
179179
```
180180

181-
4. Navigate to Rust's source code (or clone it), then build it:
181+
5. Navigate to Rust's source code (or clone it), then build it:
182182

183183
```sh
184184
python x.py setup dist && python x.py build && python x.py install

src/ci/scripts/install-msys2.sh

+13-10
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,19 @@ if isWindows; then
2828
# Install pacboy for easily installing packages
2929
pacman -S --noconfirm pactoys
3030

31-
# Delete these pre-installed tools so we can't accidentally use them, because we are using the
32-
# MSYS2 setup action versions instead.
33-
# Delete pre-installed version of MSYS2
34-
echo "Cleaning up tools in PATH"
35-
rm -r "/c/msys64/"
36-
# Delete Strawberry Perl, which contains a version of mingw
37-
rm -r "/c/Strawberry/"
38-
# Delete these other copies of mingw, I don't even know where they come from.
39-
rm -r "/c/mingw64/"
40-
rm -r "/c/mingw32/"
31+
# Remove these pre-installed tools so we can't accidentally use them, because we are using the
32+
# MSYS2 setup action versions instead. Because `rm -r`-ing them is slow, we mv them off path
33+
# instead.
34+
# Remove pre-installed version of MSYS2
35+
echo "Cleaning up existing tools in PATH"
36+
notpath="/c/NOT/ON/PATH/"
37+
mkdir --parents "$notpath"
38+
mv -t "$notpath" "/c/msys64/"
39+
# Remove Strawberry Perl, which contains a version of mingw
40+
mv -t "$notpath" "/c/Strawberry/"
41+
# Remove these other copies of mingw, I don't even know where they come from.
42+
mv -t "$notpath" "/c/mingw64/"
43+
mv -t "$notpath" "/c/mingw32/"
4144
echo "Finished cleaning up tools in PATH"
4245

4346
if isKnownToBeMingwBuild; then

0 commit comments

Comments
 (0)