siso: put flag handling in _handle_collector and cover it with tests.

Bug: b/455433899
Change-Id: I6cf6f1cd5ea7b91a34c89695ce86bc266a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/7458169
Reviewed-by: Fumitoshi Ukai <ukai@google.com>
Commit-Queue: Alex Ovsienko <ovsienko@google.com>
Reviewed-by: Junji Watanabe <jwata@google.com>
2 files changed
tree: 899cfc93b1cd495b4ea4a4d76e786ab07add6aeb
  1. .vscode/
  2. bootstrap/
  3. fetch_configs/
  4. hooks/
  5. infra/
  6. infra_lib/
  7. jj/
  8. man/
  9. mcp/
  10. metadata/
  11. python-bin/
  12. python2-bin/
  13. recipes/
  14. testing_support/
  15. tests/
  16. third_party/
  17. win_toolchain/
  18. zsh-goodies/
  19. .cipd_impl.ps1
  20. .flake8
  21. .git-blame-ignore-revs
  22. .gitattributes
  23. .gitignore
  24. .isort.cfg
  25. .style.yapf
  26. .vpython3
  27. android_build_server_helper.py
  28. auth.py
  29. autoninja
  30. autoninja.bat
  31. autoninja.py
  32. bazel.py
  33. bb
  34. bb.bat
  35. black
  36. bootstrap_python3
  37. breakpad.py
  38. BUILD_OWNERS
  39. build_telemetry
  40. build_telemetry.bat
  41. build_telemetry.py
  42. caffeinate.py
  43. cipd
  44. cipd.bat
  45. cipd_bin_setup.bat
  46. cipd_bin_setup.sh
  47. cipd_client_version
  48. cipd_client_version.digests
  49. cipd_manifest.txt
  50. cipd_manifest.versions
  51. cipd_manifest_cros_python2.txt
  52. cipd_manifest_cros_python2.versions
  53. clang-format
  54. clang-format.bat
  55. clang_format.py
  56. codereview.settings
  57. compile_single_file
  58. compile_single_file.bat
  59. compile_single_file.py
  60. cpplint.bat
  61. cpplint.py
  62. cpplint_chromium.py
  63. create_temp_file.py
  64. cros
  65. CROS_OWNERS
  66. cros_python2.vpython
  67. detect_host_arch.py
  68. DIR_METADATA
  69. dirmd
  70. dirmd.bat
  71. download_from_google_storage
  72. download_from_google_storage.bat
  73. download_from_google_storage.py
  74. ensure_bootstrap
  75. fetch
  76. fetch.bat
  77. fetch.py
  78. gclient
  79. gclient-new-workdir.py
  80. gclient.bat
  81. gclient.py
  82. gclient_completion.sh
  83. gclient_eval.py
  84. gclient_paths.py
  85. gclient_scm.py
  86. gclient_utils.py
  87. gerrit_cache.py
  88. gerrit_client.py
  89. gerrit_util.py
  90. git-cache
  91. git-cl
  92. git-credential-luci
  93. git-credential-luci.bat
  94. git-crrev-parse
  95. git-drover
  96. git-find-releases
  97. git-footers
  98. git-freeze
  99. git-gs
  100. git-hyper-blame
  101. git-map
  102. git-map-branches
  103. git-mark-merge-base
  104. git-nav-downstream
  105. git-nav-upstream
  106. git-new-branch
  107. git-number
  108. git-rebase-update
  109. git-rename-branch
  110. git-reparent-branch
  111. git-retry
  112. git-runhooks
  113. git-squash-branch
  114. git-squash-branch-tree
  115. git-thaw
  116. git-upstream-diff
  117. git_auth.py
  118. git_cache.py
  119. git_cl.py
  120. git_cl_completion.sh
  121. git_common.py
  122. git_completion.sh
  123. git_dates.py
  124. git_find_releases.py
  125. git_footers.py
  126. git_freezer.py
  127. git_hyper_blame.py
  128. git_map.py
  129. git_map_branches.py
  130. git_mark_merge_base.py
  131. git_nav_downstream.py
  132. git_new_branch.py
  133. git_number.py
  134. git_rebase_update.py
  135. git_rename_branch.py
  136. git_reparent_branch.py
  137. git_retry.py
  138. git_squash_branch.py
  139. git_squash_branch_tree.py
  140. git_upstream_diff.py
  141. gn
  142. gn.bat
  143. gn.py
  144. gn_helper.py
  145. google-java-format
  146. google-java-format.bat
  147. google_java_format.py
  148. gsutil.py
  149. gsutil.py.bat
  150. gsutil.py.vpython3
  151. isort
  152. led
  153. led.bat
  154. LICENSE
  155. lockfile.py
  156. luci-auth
  157. luci-auth-fido2-plugin.bat
  158. luci-auth-ssh-helper
  159. luci-auth-ssh-helper.bat
  160. luci-auth-ssh-plugin
  161. luci-auth-ssh-plugin.bat
  162. luci-auth.bat
  163. luci_auth_fido2_plugin.py
  164. LUCI_OWNERS
  165. lucicfg
  166. lucicfg.bat
  167. mac_toolchain
  168. metrics-xml-format
  169. metrics.py
  170. metrics.README.md
  171. metrics_utils.py
  172. metrics_xml_format.py
  173. my_activity.py
  174. newauth.py
  175. ninja
  176. ninja.bat
  177. ninja.py
  178. ninjalog_uploader.py
  179. OWNERS
  180. owners_client.py
  181. owners_finder.py
  182. pinpoint
  183. pinpoint.bat
  184. post_build_ninja_summary.py
  185. PRESUBMIT.py
  186. presubmit_canned_checks.py
  187. presubmit_diff.py
  188. presubmit_support.py
  189. prpc
  190. prpc.bat
  191. pylint-2.17
  192. pylint-2.17.bat
  193. pylint-2.6
  194. pylint-2.6.bat
  195. pylint-2.7
  196. pylint-2.7.bat
  197. pylint-3.2
  198. pylint-3.2.bat
  199. pylint_main.py
  200. pylintrc-2.17
  201. pylintrc-2.6
  202. pylintrc-2.7
  203. pylintrc-3.2
  204. pyproject.toml
  205. python_runner.sh
  206. rdb
  207. rdb.bat
  208. rdb_wrapper.py
  209. README.gclient.md
  210. README.git-cl.md
  211. README.google_cloud_storage.md
  212. README.md
  213. reclient_helper.py
  214. RECLIENT_OWNERS
  215. reclientreport
  216. reclientreport.bat
  217. reclientreport.py
  218. repo
  219. repo_launcher
  220. roll-dep
  221. roll-dep.bat
  222. roll_dep.py
  223. roll_downstream_gcs_deps.py
  224. rustfmt.py
  225. scm.py
  226. setup_color.py
  227. siso
  228. siso.bat
  229. siso.py
  230. split_cl.py
  231. subcommand.py
  232. subprocess2.py
  233. swift-format
  234. swift_format.py
  235. update_depot_tools
  236. update_depot_tools.bat
  237. update_depot_tools_toggle.py
  238. upload_metrics.py
  239. upload_to_google_storage.py
  240. upload_to_google_storage_first_class.py
  241. utils.py
  242. vpython3
  243. vpython3.bat
  244. WATCHLISTS
  245. watchlists.py
  246. whitespace.txt
  247. win32imports.py
  248. yapf
  249. yapf.bat
README.md

depot_tools

Tools for Chromium development. Requires Python 3.8+.

gsutil: Python 3.9–3.13 required.

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.

Also, includes shell script/batch file for tools required to build chromium, e.g.

  • gn: a meta-build system that generates build files for Ninja
  • autoninja: a wrapper for siso and ninja.
  • siso: a build tool that aims to significantly speed up Chromium's build.
  • ninja: a small build system with a focus on speed. deprecated by Siso.

These shell script/batch file runs python script with python-bin/python3 that find binaries in chromium checkout, and run with proper setup/check. To use these wrappers, you need to initialize/bootstrap depot_tools (using gclient, update_depot_tools or ensure_bootstrap).

Installing

See set-up documentation.

depot_tools is also available in

These depot_tools would not be initialized/bootstrapped (i.e. no python-bin/python3 binary available), so the build tool wrapper won't work, unless it is explicitly initialized by ensure_bootstrap. Or, directly call the python script instead of using the shell script/batch file.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0 or run ./update_depot_tools_toggle.py --disable.

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

Running gclient will install python3 binary.

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.