From a6bff0c3446bb8f85f61aac7746f5810c3179392 Mon Sep 17 00:00:00 2001 From: Joe Gregorio Date: Tue, 26 Jan 2021 11:39:51 -0500 Subject: [PATCH] Fix CheckGeneratedFiles bot. It turns out previous builds may leave root-owned files in the work cache, and sometimes those contain '.fp' files, which touch will fail on, since the recipe doesn't run as root. Solution is to restrict 'touch fp files' to the src/ subdirectory. Change-Id: Ic0d70a67548ec66dbd1d3905fd1cacfadde181f2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359496 Reviewed-by: John Stiles Reviewed-by: Eric Boren Commit-Queue: Joe Gregorio --- .../Housekeeper-PerCommit-CheckGeneratedFiles.json | 4 ++-- infra/bots/recipes/check_generated_files.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json b/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json index 57dac5a819..7561cc4be2 100644 --- a/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json +++ b/infra/bots/recipes/check_generated_files.expected/Housekeeper-PerCommit-CheckGeneratedFiles.json @@ -173,7 +173,7 @@ "cmd": [ "python", "-u", - "import os\nimport subprocess\n\nfor r, d, files in os.walk('[START_DIR]/cache/work/skia'):\n for f in files:\n if f.endswith('.fp'):\n path = os.path.join(r, f)\n print 'touch %s' % path\n subprocess.check_call(['touch', path])\n" + "import os\nimport subprocess\n\nfor r, d, files in os.walk(os.path.join('[START_DIR]/cache/work/skia', 'src')):\n for f in files:\n if f.endswith('.fp'):\n path = os.path.join(r, f)\n print 'touch %s' % path\n subprocess.check_call(['touch', path])\n" ], "cwd": "[START_DIR]/cache/work/skia", "env": { @@ -185,7 +185,7 @@ "@@@STEP_LOG_LINE@python.inline@import os@@@", "@@@STEP_LOG_LINE@python.inline@import subprocess@@@", "@@@STEP_LOG_LINE@python.inline@@@@", - "@@@STEP_LOG_LINE@python.inline@for r, d, files in os.walk('[START_DIR]/cache/work/skia'):@@@", + "@@@STEP_LOG_LINE@python.inline@for r, d, files in os.walk(os.path.join('[START_DIR]/cache/work/skia', 'src')):@@@", "@@@STEP_LOG_LINE@python.inline@ for f in files:@@@", "@@@STEP_LOG_LINE@python.inline@ if f.endswith('.fp'):@@@", "@@@STEP_LOG_LINE@python.inline@ path = os.path.join(r, f)@@@", diff --git a/infra/bots/recipes/check_generated_files.py b/infra/bots/recipes/check_generated_files.py index ba2ada82e9..437f2d700b 100644 --- a/infra/bots/recipes/check_generated_files.py +++ b/infra/bots/recipes/check_generated_files.py @@ -50,7 +50,7 @@ def RunSteps(api): program="""import os import subprocess -for r, d, files in os.walk('%s'): +for r, d, files in os.walk(os.path.join('%s', 'src')): for f in files: if f.endswith('.fp'): path = os.path.join(r, f)