Revert "Add a Str() function to gclient for use in DEPS files."

This reverts commit c7eed83f9616452f94af0affe2fad6fe571fbfe3.

Reason for revert: I'm getting reports of internal iOS checkouts being broken. Reverting while I reproduce / debug it.

Original change's description:
> Add a Str() function to gclient for use in DEPS files.
> 
> gclient's existing functionality for handling variables is
> ambiguous: the value of a variable can either be a string literal
> or an expression fragment. The implementation is required to
> parse a value as an expression, and, if it is legal, treat it
> as an expression instead of a literal. This means that
> 
>   gclient_gn_args_file = 'src/build/args.gni'
>   gclient_gn_args = ['xcode_version']
>   vars = {
>     'xcode_version': 'xcode-12'
>   }
> 
> would cause a problem because gclient would try to parse the
> variable as an expression, and 'xcode' would not be defined.
> 
> This patch adds a workaround for this, where you can instead
> use the Str() function to explicitly tell gclient to treat the
> value as a string and not a potential expression.
> 
> The above example would be changed to:
> 
>   gclient_gn_args_file = 'src/build/args.gni'
>   gclient_gn_args = ['xcode_version']
>   vars = {
>     'xcode_version': Str('xcode-12')
>   }
> 
> The variable may still be used in every context where it was legal
> to be used before.
> 
> Bug: 1099242
> 
> Change-Id: Ic2a17eea5f7098113bdba0557fe29e1a931a74b8
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2268406
> Reviewed-by: Ben Pastene <bpastene@chromium.org>
> Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
> Commit-Queue: Dirk Pranke <dpranke@google.com>

TBR=thakis@chromium.org,dpranke@google.com,ehmaldonado@chromium.org,bpastene@chromium.org,apolito@google.com,infra-scoped@luci-project-accounts.iam.gserviceaccount.com

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