Skip to content

Commit e27c472

Browse files
committedFeb 16, 2024
Update INSTALL.md instructions for MinGW
1 parent 80459c1 commit e27c472

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed
 

‎INSTALL.md

+17-7
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,9 @@ toolchain.
145145

146146
1. Download the latest [MSYS2 installer][msys2] and go through the installer.
147147

148-
2. Run `mingw32_shell.bat` or `mingw64_shell.bat` from the MSYS2 installation
149-
directory (e.g. `C:\msys64`), depending on whether you want 32-bit or 64-bit
150-
Rust. (As of the latest version of MSYS2 you have to run `msys2_shell.cmd
151-
-mingw32` or `msys2_shell.cmd -mingw64` from the command line instead.)
148+
2. Start a MINGW64 or MINGW32 shell (depending on whether you want 32-bit
149+
or 64-bit Rust) either from your start menu, or by running `mingw64.exe`
150+
or `mingw32.exe` from your MSYS2 installation directory (e.g. `C:\msys64`).
152151

153152
3. From this terminal, install the required tools:
154153

@@ -157,8 +156,7 @@ toolchain.
157156
pacman -Sy pacman-mirrors
158157

159158
# Install build tools needed for Rust. If you're building a 32-bit compiler,
160-
# then replace "x86_64" below with "i686". If you've already got Git, Python,
161-
# or CMake installed and in PATH you can remove them from this list.
159+
# then replace "x86_64" below with "i686".
162160
# Note that it is important that you do **not** use the 'python2', 'cmake',
163161
# and 'ninja' packages from the 'msys2' subsystem.
164162
# The build has historically been known to fail with these packages.
@@ -175,9 +173,21 @@ toolchain.
175173
4. Navigate to Rust's source code (or clone it), then build it:
176174

177175
```sh
178-
python x.py setup user && python x.py build && python x.py install
176+
python x.py setup dist && python x.py build && python x.py install
179177
```
180178

179+
If you want to use the native versions of Git, Python, or CMake you can remove
180+
them from the above pacman command and install them from another source. Make
181+
sure that they're in your Windows PATH, and edit the relevant `mingw[32|64].ini`
182+
file in your MSYS2 installation directory by uncommenting the line
183+
`MSYS2_PATH_TYPE=inherit` to include them in your MSYS2 PATH.
184+
185+
Using Windows native Python can be helpful if you get errors when building LLVM.
186+
You may also want to use Git for Windows, as it is often *much* faster. Turning
187+
off real-time protection in the Windows Virus & Threat protections settings can
188+
also help with long run times (although note that it will automatically turn
189+
itself back on after some time).
190+
181191
### MSVC
182192

183193
MSVC builds of Rust additionally require an installation of Visual Studio 2017

0 commit comments

Comments
 (0)
Please sign in to comment.