Reland "win toolchain: Prepare downloader for windows sdk dir switch"

This is a reland of e72789f5b4e6e96a6c114133eb7d147da6be656b

Original change's description:
> win toolchain: Prepare downloader for windows sdk dir switch
>
> crrev.com/c/2655836 tries to move the Windows SDK from
> "win_sdk" to "Windows Kits/10".
>
> get_toolchain_if_necessary.py (in depot_tools) saves the path to the SDK to
> third_party/depot_tools/win_toolchain/data.json which then gets copied
> by a script in the chromium repo to build/win_toolchain.json.
> For the SDK move to work, chromium's pinned depot_tools
> must write the new SDK path when rolling in the new toolchain package.
> This change makes depot_tools handle win packages that have the
> windows sdk either win "win_sdk" or in "Windows Kits\10".
>
> The plan is:
>
> 1. Land this change, which can handle both path styles
> 2. Wait for depot_tools in chromium to update
> 3. Then roll to a win toolchain package with the new layout
>
> In a few years, when we no longer need the old layout,
> we can remove this detection code again and assume the new layout.
>
> Bug: 1173176
> Change-Id: Iaefc5c16685d3dbfff87a3e50a7b20b457366e44
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2666429
> Commit-Queue: Nico Weber <thakis@chromium.org>
> Auto-Submit: Nico Weber <thakis@chromium.org>
> Reviewed-by: Bruce Dawson <brucedawson@chromium.org>

Bug: 1173176,1173393
Change-Id: Ic706f694f8f0260208fa637864e62d7cc4f7ce93
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2668127
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: Takuto Ikuta <tikuta@chromium.org>
1 file changed
tree: 87dc5fe1702dcbb9dbf3b11c37946693b269760b
  1. bootstrap/
  2. fetch_configs/
  3. git-templates/
  4. infra/
  5. man/
  6. python-bin/
  7. python2-bin/
  8. recipes/
  9. testing_support/
  10. tests/
  11. third_party/
  12. win_toolchain/
  13. zsh-goodies/
  14. .cipd_impl.ps1
  15. .gitattributes
  16. .gitignore
  17. .style.yapf
  18. .vpython
  19. .vpython3
  20. auth.py
  21. autoninja
  22. autoninja.bat
  23. autoninja.py
  24. bb
  25. bb.bat
  26. bootstrap_python3
  27. breakpad.py
  28. cipd
  29. cipd.bat
  30. cipd_bin_setup.bat
  31. cipd_bin_setup.sh
  32. cipd_client_version
  33. cipd_client_version.digests
  34. cipd_manifest.txt
  35. cipd_manifest.versions
  36. cit
  37. cit.bat
  38. cit.py
  39. clang-format
  40. clang-format.bat
  41. clang_format.py
  42. clang_format_merge_driver
  43. clang_format_merge_driver.bat
  44. clang_format_merge_driver.py
  45. codereview.settings
  46. compile_single_file
  47. compile_single_file.bat
  48. compile_single_file.py
  49. cpplint.bat
  50. cpplint.py
  51. cpplint_chromium.py
  52. cros
  53. CROS_OWNERS
  54. crosjobs
  55. detect_host_arch.py
  56. DIR_METADATA
  57. dirmd
  58. dirmd.bat
  59. download_from_google_storage
  60. download_from_google_storage.bat
  61. download_from_google_storage.py
  62. ensure_bootstrap
  63. fetch
  64. fetch.bat
  65. fetch.py
  66. fix_encoding.py
  67. gclient
  68. gclient-new-workdir.py
  69. gclient.bat
  70. gclient.py
  71. gclient_completion.sh
  72. gclient_eval.py
  73. gclient_paths.py
  74. gclient_scm.py
  75. gclient_utils.py
  76. gerrit_client.py
  77. gerrit_util.py
  78. git-cache
  79. git-cl
  80. git-crrev-parse
  81. git-drover
  82. git-find-releases
  83. git-footers
  84. git-freeze
  85. git-gs
  86. git-hyper-blame
  87. git-map
  88. git-map-branches
  89. git-mark-merge-base
  90. git-migrate-default-branch
  91. git-nav-downstream
  92. git-nav-upstream
  93. git-new-branch
  94. git-number
  95. git-rebase-update
  96. git-rename-branch
  97. git-reparent-branch
  98. git-retry
  99. git-runhooks
  100. git-squash-branch
  101. git-thaw
  102. git-upstream-diff
  103. git_cache.py
  104. git_cl.py
  105. git_cl_completion.sh
  106. git_common.py
  107. git_dates.py
  108. git_drover.py
  109. git_find_releases.py
  110. git_footers.py
  111. git_freezer.py
  112. git_hyper_blame.py
  113. git_map.py
  114. git_map_branches.py
  115. git_mark_merge_base.py
  116. git_migrate_default_branch.py
  117. git_nav_downstream.py
  118. git_new_branch.py
  119. git_number.py
  120. git_rebase_update.py
  121. git_rename_branch.py
  122. git_reparent_branch.py
  123. git_retry.py
  124. git_squash_branch.py
  125. git_upstream_diff.py
  126. gn
  127. gn.bat
  128. gn.py
  129. goma_auth
  130. goma_auth.bat
  131. goma_ctl
  132. goma_ctl.bat
  133. GOMA_OWNERS
  134. gsutil.py
  135. gsutil.py.bat
  136. gsutil.vpython
  137. led
  138. led.bat
  139. LICENSE
  140. lockfile.py
  141. luci-auth
  142. luci-auth.bat
  143. LUCI_OWNERS
  144. lucicfg
  145. lucicfg.bat
  146. mac_toolchain
  147. metrics.py
  148. metrics.README.md
  149. metrics_utils.py
  150. my_activity.py
  151. ninja
  152. ninja-linux32
  153. ninja-linux64
  154. ninja-mac
  155. ninja.exe
  156. ninjalog.README.md
  157. ninjalog_uploader.py
  158. ninjalog_uploader_wrapper.py
  159. OWNERS
  160. owners.py
  161. owners_client.py
  162. owners_finder.py
  163. post_build_ninja_summary.py
  164. PRESUBMIT.py
  165. presubmit_canned_checks.py
  166. presubmit_support.py
  167. profile.xml
  168. prpc
  169. prpc.bat
  170. pylint
  171. pylint-1.5
  172. pylint-1.6
  173. pylint-1.7
  174. pylint-1.8
  175. pylint-1.9
  176. pylint-2.6
  177. pylint.bat
  178. pylint_main.py
  179. pylintrc
  180. python_runner.sh
  181. rdb
  182. rdb.bat
  183. rdb_wrapper.py
  184. README.gclient.md
  185. README.git-cl.md
  186. README.md
  187. repo
  188. repo_launcher
  189. roll-dep
  190. roll-dep.bat
  191. roll_dep.py
  192. scm.py
  193. setup_color.py
  194. split_cl.py
  195. subcommand.py
  196. subprocess2.py
  197. update_depot_tools
  198. update_depot_tools.bat
  199. update_depot_tools_toggle.py
  200. upload_metrics.py
  201. upload_to_google_storage.py
  202. vpython
  203. vpython.bat
  204. vpython3
  205. vpython3.bat
  206. WATCHLISTS
  207. watchlists.py
  208. weekly
  209. whitespace.txt
  210. win32imports.py
  211. wtf
  212. yapf
  213. yapf.bat
README.md

depot_tools

Tools for working with Chromium development. It requires python 2.7 or 3.8 for python 3 support.

Tools

The most important tools are:

  • fetch: A gclient wrapper to checkout a project. Use fetch --help for more details.
  • gclient: A meta-checkout tool. Think repo or git submodules, except that it support OS-specific rules, e.g. do not checkout Windows only dependencies when checking out for Android. Use gclient help for more details and README.gclient.md.
  • git cl: A code review tool to interact with Rietveld or Gerrit. Use git cl help for more details and README.git-cl.md.
  • roll-dep: A gclient dependency management tool to submit a dep roll, updating a dependency to a newer revision.

There are a lot of git utilities included.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0.

To update package manually, run update_depot_tools.bat on Windows, or ./update_depot_tools on Linux or Mac.

On Windows only, running gclient will install git and python.

Contributing

To contribute change for review:

git new-branch <somename>
# Hack
git add .
git commit -a -m "Fixes goat teleporting"
# find reviewers
git cl owners
git log -- <yourfiles>

# Request a review.
git cl upload -r reviewer1@chromium.org,reviewer2@chromium.org --send-mail

# Edit change description if needed.
git cl desc

# If change is approved, flag it to be committed.
git cl set-commit

# If change needs more work.
git rebase-update
...
git cl upload -t "Fixes goat teleporter destination to be Australia"

See also open bugs, open reviews, forum or report problems.

cpplint.py

Until 2018, our cpplint.py was a copy of the upstream version at https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that repository is not maintained any more. If you want to update cpplint.py in depot_tools, just upload a patch to do so. We will figure out a long-term strategy via issue https://crbug.com/916550.

Note that the cpplint.py here is also used by the Tricium analyzer, so if the cpplint.py here changes, we should also update the copy used there.