metadata/rla_approval: improve arg passing and error handling

This CL changes RLA parsing to use env var to pass file paths to avoid
the need to deal with Windows cmd escaping, and adds exception handling
to tell the caller that the given textproto is invalid (instead of a
generic CalledProcessError that eats the important "invalid textproto"
error message.

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

AI agent tooling

This repository contains two separate directories of agent-related tooling with distinct audiences:

  • agents/: Skills and configuration meant for Chromium developers (and their AI agents) working in the Chromium codebase using depot_tools.
  • depot_tools_agents/: AI review agents (e.g. Gerrit review agents) meant only for maintainers of depot_tools working on the depot_tools code itself. This is not intended for use with the Chromium codebase.

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.