[tools] Add dep on depot_tools and use it from release scripts

This is needed since depot_tools may not be in PATH on LUCI bots. Using the copy
of depot_tools that contains the recipes is also incorrect as it is not
guaranteed to contain binaries that do not have corresponding recipe API, which
does not apply to script called from a recipe. This also protects our release
scripts from breaking due to arbitrary changes to depot_tools.

Chromium also pins depot_tools for similar reasons:
https://cs.chromium.org/chromium/src/DEPS?l=525&rcl=f24fa931ae08b0e42aae2d13034229088179da7f

R=machenbach@chromium.org

Bug: chromium:831171
Change-Id: I393052b1c489d25e2e3fa173149635448e9bd2dc
Reviewed-on: https://chromium-review.googlesource.com/1054676
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Sergiy Byelozyorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53179}
This commit is contained in:
Sergiy Byelozyorov 2018-05-14 11:25:53 +02:00 committed by Commit Bot
parent 6c78bd9a1e
commit 54e5224590
2 changed files with 9 additions and 0 deletions

2
DEPS
View File

@ -15,6 +15,8 @@ deps = {
Var('chromium_url') + '/chromium/src/build.git' + '@' + 'b61b6b6a2e285bba391061b049b89066b93165e7',
'v8/tools/gyp':
Var('chromium_url') + '/external/gyp.git' + '@' + 'd61a9397e668fa9843c4aa7da9e79460fe590bfb',
'v8/third_party/depot_tools':
Var('chromium_url') + '/chromium/tools/depot_tools.git' + '@' + 'd1de725e0b53f5f0bb331471e5673aee0e72a5b7',
'v8/third_party/icu':
Var('chromium_url') + '/chromium/deps/icu.git' + '@' + 'e4194dc7bbb3305d84cbb1b294274ca70d230721',
'v8/third_party/instrumented_libraries':

View File

@ -57,6 +57,13 @@ RELEASE_WORKDIR = "/tmp/v8-release-scripts-work-dir/"
V8_BASE = os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# Add our copy of depot_tools to the PATH as many scripts use tools from there,
# e.g. git-cl, fetch, git-new-branch etc, and we can not depend on depot_tools
# being in the PATH on the LUCI bots.
path_to_depot_tools = os.path.join(V8_BASE, 'third_party', 'depot_tools')
new_path = path_to_depot_tools + os.pathsep + os.environ.get('PATH')
os.environ['PATH'] = new_path
def TextToFile(text, file_name):
with open(file_name, "w") as f: