Commit e313ab06 authored by Chidera Olibie's avatar Chidera Olibie Committed by LUCI CQ

Revert "Update diff_deps receipe to py3"

This reverts commit 988c0af5.

Reason for revert:
This change breaks our bot: https://logs.chromium.org/logs/chromium/buildbucket/cr-buildbucket/8821937225081267713/+/u/cleanup_index.lock/stdout.

The reference for the newly added cleanup.py looks incorrect.

Original change's description:
> Update diff_deps receipe to py3
>
> Recipe-Nontrivial-Roll: build
> Bug: 1289280
> Change-Id: Ia87693ab8187acc5fa5cbd76664b999ad65d2809
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3438326
> Reviewed-by: Josip Sokcevic <sokcevic@google.com>
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>

Bug: 1289280
Change-Id: I8d430a29abafafe2501c73b2b20063c2a134024d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3473364
Auto-Submit: Chidera Olibie <colibie@google.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: 's avatarAravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
parent 0f13273f
......@@ -162,7 +162,7 @@ PYTHON_VERSION_COMPATIBILITY: PY2+3
#### **class [GclientApi](/recipes/recipe_modules/gclient/api.py#77)([RecipeApi][recipe_engine/wkt/RecipeApi]):**
&emsp; **@property**<br>&mdash; **def [DepsDiffException](/recipes/recipe_modules/gclient/api.py#424)(self):**
&emsp; **@property**<br>&mdash; **def [DepsDiffException](/recipes/recipe_modules/gclient/api.py#440)(self):**
&mdash; **def [\_\_call\_\_](/recipes/recipe_modules/gclient/api.py#87)(self, name, cmd, infra_step=True, \*\*kwargs):**
......@@ -179,11 +179,11 @@ Return a step generator function for gclient checkouts.
&emsp; **@staticmethod**<br>&mdash; **def [config\_to\_pythonish](/recipes/recipe_modules/gclient/api.py#139)(cfg):**
&mdash; **def [diff\_deps](/recipes/recipe_modules/gclient/api.py#367)(self, cwd):**
&mdash; **def [diff\_deps](/recipes/recipe_modules/gclient/api.py#383)(self, cwd):**
&mdash; **def [get\_config\_defaults](/recipes/recipe_modules/gclient/api.py#133)(self):**
&mdash; **def [get\_gerrit\_patch\_root](/recipes/recipe_modules/gclient/api.py#298)(self, gclient_config=None):**
&mdash; **def [get\_gerrit\_patch\_root](/recipes/recipe_modules/gclient/api.py#314)(self, gclient_config=None):**
Returns local path to the repo where gerrit patch will be applied.
......@@ -196,7 +196,7 @@ Instead, properly map a repository to a local path using repo_path_map.
TODO(nodir): remove this. Update all recipe tests to specify a git_repo
matching the recipe.
&mdash; **def [get\_repo\_path](/recipes/recipe_modules/gclient/api.py#325)(self, repo_url, gclient_config=None):**
&mdash; **def [get\_repo\_path](/recipes/recipe_modules/gclient/api.py#341)(self, repo_url, gclient_config=None):**
Returns local path to the repo checkout given its url.
......@@ -226,7 +226,7 @@ Args:
&mdash; **def [runhooks](/recipes/recipe_modules/gclient/api.py#285)(self, args=None, name='runhooks', \*\*kwargs):**
&mdash; **def [set\_patch\_repo\_revision](/recipes/recipe_modules/gclient/api.py#355)(self, gclient_config=None):**
&mdash; **def [set\_patch\_repo\_revision](/recipes/recipe_modules/gclient/api.py#371)(self, gclient_config=None):**
Updates config revision corresponding to patched project.
......
......@@ -292,8 +292,24 @@ class GclientApi(recipe_api.RecipeApi):
"""Remove all index.lock files. If a previous run of git crashed, bot was
reset, etc... we might end up with leftover index.lock files.
"""
cmd = ['python3', '-u', self.resource('cleanup.py'), self.m.path['start_dir']]
return self.m.step('cleanup index.lock', cmd)
self.m.python.inline(
'cleanup index.lock',
"""
from __future__ import print_function
import os, sys
build_path = sys.argv[1]
if os.path.exists(build_path):
for (path, dir, files) in os.walk(build_path):
for cur_file in files:
if cur_file.endswith('index.lock'):
path_to_file = os.path.join(path, cur_file)
print('deleting %s' % path_to_file)
os.remove(path_to_file)
""",
args=[self.m.path['start_dir']],
infra_step=True,
)
def get_gerrit_patch_root(self, gclient_config=None):
"""Returns local path to the repo where gerrit patch will be applied.
......@@ -382,7 +398,7 @@ class GclientApi(recipe_api.RecipeApi):
step_result = self(
'recursively git diff all DEPS',
['recurse', 'python3', self.resource('diff_deps.py')],
['recurse', 'python', self.resource('diff_deps.py')],
stdout=self.m.raw_io.output_text(add_output_log=True),
)
......
#!/usr/bin/env python3
from __future__ import print_function
import os, sys
build_path = sys.argv[1]
if os.path.exists(build_path):
for (path, dir, files) in os.walk(build_path):
for cur_file in files:
if cur_file.endswith('index.lock'):
path_to_file = os.path.join(path, cur_file)
print('deleting %s' % path_to_file)
os.remove(path_to_file)
......@@ -195,12 +195,28 @@
},
{
"cmd": [
"python3",
"python",
"-u",
"RECIPE_MODULE[depot_tools::gclient]/resources/cleanup.py",
"\nfrom __future__ import print_function\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print('deleting %s' % path_to_file)\n os.remove(path_to_file)\n",
"[START_DIR]"
],
"name": "cleanup index.lock"
"infra_step": true,
"name": "cleanup index.lock",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@from __future__ import print_function@@@",
"@@@STEP_LOG_LINE@python.inline@import os, sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@build_path = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@if os.path.exists(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for (path, dir, files) in os.walk(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for cur_file in files:@@@",
"@@@STEP_LOG_LINE@python.inline@ if cur_file.endswith('index.lock'):@@@",
"@@@STEP_LOG_LINE@python.inline@ path_to_file = os.path.join(path, cur_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ print('deleting %s' % path_to_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ os.remove(path_to_file)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
......
......@@ -317,11 +317,12 @@
},
{
"cmd": [
"python3",
"python",
"-u",
"RECIPE_MODULE[depot_tools::gclient]/resources/cleanup.py",
"\nfrom __future__ import print_function\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print('deleting %s' % path_to_file)\n os.remove(path_to_file)\n",
"[START_DIR]"
],
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:ci"
......@@ -334,7 +335,22 @@
"hostname": "rdbhost"
}
},
"name": "cleanup index.lock"
"name": "cleanup index.lock",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@from __future__ import print_function@@@",
"@@@STEP_LOG_LINE@python.inline@import os, sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@build_path = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@if os.path.exists(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for (path, dir, files) in os.walk(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for cur_file in files:@@@",
"@@@STEP_LOG_LINE@python.inline@ if cur_file.endswith('index.lock'):@@@",
"@@@STEP_LOG_LINE@python.inline@ path_to_file = os.path.join(path, cur_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ print('deleting %s' % path_to_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ os.remove(path_to_file)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
......
......@@ -315,11 +315,12 @@
},
{
"cmd": [
"python3",
"python",
"-u",
"RECIPE_MODULE[depot_tools::gclient]/resources/cleanup.py",
"\nfrom __future__ import print_function\nimport os, sys\n\nbuild_path = sys.argv[1]\nif os.path.exists(build_path):\n for (path, dir, files) in os.walk(build_path):\n for cur_file in files:\n if cur_file.endswith('index.lock'):\n path_to_file = os.path.join(path, cur_file)\n print('deleting %s' % path_to_file)\n os.remove(path_to_file)\n",
"[START_DIR]"
],
"infra_step": true,
"luci_context": {
"realm": {
"name": "project:try"
......@@ -332,7 +333,22 @@
"hostname": "rdbhost"
}
},
"name": "cleanup index.lock"
"name": "cleanup index.lock",
"~followup_annotations": [
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@from __future__ import print_function@@@",
"@@@STEP_LOG_LINE@python.inline@import os, sys@@@",
"@@@STEP_LOG_LINE@python.inline@@@@",
"@@@STEP_LOG_LINE@python.inline@build_path = sys.argv[1]@@@",
"@@@STEP_LOG_LINE@python.inline@if os.path.exists(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for (path, dir, files) in os.walk(build_path):@@@",
"@@@STEP_LOG_LINE@python.inline@ for cur_file in files:@@@",
"@@@STEP_LOG_LINE@python.inline@ if cur_file.endswith('index.lock'):@@@",
"@@@STEP_LOG_LINE@python.inline@ path_to_file = os.path.join(path, cur_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ print('deleting %s' % path_to_file)@@@",
"@@@STEP_LOG_LINE@python.inline@ os.remove(path_to_file)@@@",
"@@@STEP_LOG_END@python.inline@@@"
]
},
{
"cmd": [
......
#!/usr/bin/env python3
#!/usr/bin/env python
from __future__ import print_function
import os
......
......@@ -31,7 +31,7 @@
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
"python3",
"python",
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
......
......@@ -31,7 +31,7 @@
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
"python3",
"python",
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
......@@ -100,7 +100,7 @@
"Traceback (most recent call last):",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/tests/diff_deps.py\", line 35, in RunSteps",
" affected_files = api.gclient.diff_deps(api.path['cache'])",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 396, in diff_deps",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 412, in diff_deps",
" raise self.DepsDiffException(msg)",
"DepsDiffException('Couldn't checkout previous ref: fatal: bad object abcdef1234567890')"
]
......
......@@ -31,7 +31,7 @@
"-u",
"RECIPE_REPO[depot_tools]/gclient.py",
"recurse",
"python3",
"python",
"RECIPE_MODULE[depot_tools::gclient]/resources/diff_deps.py"
],
"cwd": "[CACHE]",
......@@ -99,7 +99,7 @@
"Traceback (most recent call last):",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/tests/diff_deps.py\", line 35, in RunSteps",
" affected_files = api.gclient.diff_deps(api.path['cache'])",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 412, in diff_deps",
" File \"RECIPE_REPO[depot_tools]/recipes/recipe_modules/gclient/api.py\", line 428, in diff_deps",
" raise self.DepsDiffException(msg)",
"DepsDiffException('Unexpected result: autoroll diff found 0 files changed')"
]
......
......@@ -31,7 +31,7 @@
"-u",
"RECIPE_REPO[depot_tools]\\gclient.py",
"recurse",
"python3",
"python",
"RECIPE_MODULE[depot_tools::gclient]\\resources\\diff_deps.py"
],
"cwd": "[CACHE]",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment