|
15 | 15 | - [Debugging preprocessor issues](#debugging-preprocessor-issues)
|
16 | 16 | - [Implementation notes](#implementation-notes)
|
17 | 17 | - [Notes on Clang internals](#notes-on-clang-internals)
|
| 18 | +- [Notes on Windows](#notes-on-windows) |
18 | 19 |
|
19 | 20 | ## Install dependencies
|
20 | 21 |
|
@@ -217,3 +218,41 @@ cost of assertions in Clang itself vs in our code.
|
217 | 218 |
|
218 | 219 | See [docs/SourceLocation.md](/docs/SourceLocation.md) for information
|
219 | 220 | about how source locations are handled in Clang.
|
| 221 | + |
| 222 | +## Notes on Windows |
| 223 | + |
| 224 | +We have limited familiarity with Windows overall, |
| 225 | +so this section includes detailed steps to (try to) |
| 226 | +build the code on Windows. |
| 227 | + |
| 228 | +1. Spin up a Windows Server 2022 machine on GCP. |
| 229 | + This generally takes a bit more time than Linux machines. |
| 230 | +2. Install [Microsoft Remote Desktop](https://apps.apple.com/us/app/microsoft-remote-desktop/id1295203466) |
| 231 | + through the App Store. |
| 232 | +3. Run the GCP command: (via RDP dropdown > View gcloud command to reset password) |
| 233 | + ```bash |
| 234 | + gcloud compute reset-windows-password --zone "<your zone>" --project <your project>" "<instane name>" |
| 235 | + ``` |
| 236 | + This will print a password. |
| 237 | +4. In the GCP UI, download the RDP file for remote login. |
| 238 | +5. Open the RDP file using Microsoft Remote Desktop. |
| 239 | +6. Enter the password from step 3. |
| 240 | +7. Start Powershell.exe as Admin and [install Chocolatey](https://docs.chocolatey.org/en-us/choco/setup#install-with-powershell.exe) |
| 241 | +8. Install [Git for Windows](https://github.com/git-for-windows/git/releases/). |
| 242 | +9. Run Git Bash as Admin and install Python and Bazelisk: |
| 243 | + ``` |
| 244 | + choco install -yv bazelisk python3 |
| 245 | + ``` |
| 246 | + After this, you may need to restart Git Bash for Python to be found. |
| 247 | + If after restarting, check if `python3 --version` and `python --version` work. |
| 248 | + If `python3 --version` doesn't work, then copy over the binary |
| 249 | + ```bash |
| 250 | + cp "$(which python)" "$(dirname "$(which python)")/python3" |
| 251 | + ``` |
| 252 | +10. Before invoking Bazel, make sure to run: |
| 253 | + ```bash |
| 254 | + export MSYS2_ARG_CONV_EXCL="*" |
| 255 | + ``` |
| 256 | + for correctly handling `//` in Bazel targets. |
| 257 | +
|
| 258 | +After this, you should be able to run the build as usual. |
0 commit comments