OLD | NEW |
(Empty) | |
| 1 Automatic updates of the Windows toolchain |
| 2 ========================================== |
| 3 |
| 4 ## On the consumer side, e.g. in Chromium src.git: |
| 5 |
| 6 - `vs_toolchain.py update` is called early during `DEPS`. `Update()` asks |
| 7 depot\_tools to put in place a particular version of the toolchain (whatever |
| 8 src will currently build with). src provides an output .json file, where |
| 9 `Update()` saves relevant information about the toolchain, the paths, version |
| 10 numbers, etc. |
| 11 - Later in `DEPS`, `build/gyp_chromium` uses |
| 12 `vs_toolchain:SetEnvironmentAndGetRuntimeDllDirs()`, which loads the .json |
| 13 file, and uses it to set a few `GYP_` variables and update the `PATH` to |
| 14 include CRT runtime directories (see below). |
| 15 - Then, `gyp_chromium` runs gyp generation. |
| 16 - Finally, it uses `vs_toolchain` again to copy runtime dlls to the output |
| 17 directories. |
| 18 |
| 19 The reason the logic was split between `depot_tools` and `src` was because at |
| 20 some point, the bots had insufficient hard drive space and if there were > 1 |
| 21 build directories (say, if a build machine handled the Release and Debug builds |
| 22 for a given configuration) then the duplication of the toolchain in both trees |
| 23 would cause the bot to run out of disk space. |
| 24 |
| 25 ## On the depot\_tools side: |
| 26 |
| 27 `get_toolchain_if_necessary.py` takes an output .json file (per above) and an |
| 28 input SHA1. It tries to confirm that the user is probably a Google employee (or |
| 29 a bot) to encourage them to use the automatic toolchain rather than using a |
| 30 system installed one. It then uses gsutil to download the zip corresponding to |
| 31 the hash. This requires authentication with @google.com credentials, so it walks |
| 32 the user through that process if necessary. |
| 33 |
| 34 (Previously in the VS2010 and early VS2013 timeframe, we also supported building |
| 35 with Express editions of VS. Along with `toolchain2013.py` this script dealt |
| 36 with all the complexity of acquiring the Express ISO, SDK bits, patches, etc. |
| 37 and applying them all in the correct sequence. However, Express no longer works, |
| 38 and Community is not too hard to install properly, so we just let the user do |
| 39 that. The primary benefit of having an automatically updated toolchain is that |
| 40 it works for bots, allows changes to the toolchain to be tryjob'd, reduces |
| 41 Infra/Labs work, and ensures that devs match bots.) |
| 42 |
| 43 For the above convoluted reason `get_toolchain_if_necessary` uses |
| 44 `toolchain2013.py` to extract the zip file, but the majority of the code in |
| 45 there is no longer used and what remains should be inlined into |
| 46 `get_toolchain_if_necessary` in the future. |
| 47 |
| 48 When the zip file is extracted, the mtimes of all the files, and the sha1 of the |
| 49 entire tree are saved to a local file. This allows future updates to compare |
| 50 whether the bits of the toolchain currently on disk are different than expected |
| 51 (the passed in SHA1), and if so, replace it with a toolchain with the correct |
| 52 SHA1. This is probably a bit more complicated than necessary, and again dates |
| 53 back to when the toolchain was assembled from many pieces. It could probably |
| 54 just write a stamp file with the SHA1, or just a version number, and trust that |
| 55 on future runs. |
| 56 |
| 57 Finally, it copies the json file to the location that the caller requested (the |
| 58 json file is generated during the unzip/acquire process in `toolchain2013.py`). |
| 59 |
| 60 ## Building a <sha1>.zip |
| 61 |
| 62 Ignoring the `toolchain2013.py` steps to acquire a toolchain automatically from |
| 63 bits for Express, the procedure is roughly: |
| 64 - Get a clean Windows VM, |
| 65 - Install Visual Studio 2013 with updates as you want it, |
| 66 - Install Windows 8.1 SDK, |
| 67 - Run `package_from_installed.py`, |
| 68 - Upload the resulting zip file to the chrome-wintoolchain GS bucket. |
| 69 |
| 70 That script first builds a zip file of the required pieces, including generating |
| 71 a batch file corresponding to `SetEnv.cmd` or `vcvarsall.bat`. It then extracts |
| 72 that zip to a temporary location and calculates the SHA1 in the same way that |
| 73 the `depot_tools` update procedure would do, so that it knows what to rename the |
| 74 zip file to. |
OLD | NEW |