From 81340c65e0e507ca544e32c0fa0c6880f371eaff Mon Sep 17 00:00:00 2001 From: Eric Boren Date: Mon, 17 Apr 2017 10:29:04 -0400 Subject: [PATCH] RecreateSKPs: Use api.run instead of api.step This gets us the default env, which includes the missing depot_tools. NOTRY=true Bug: skia: Change-Id: Idc6f9c426eb88c36d8c5d9c9bf9568a9414d61a6 Reviewed-on: https://skia-review.googlesource.com/13587 Reviewed-by: Ravi Mistry --- .../Housekeeper-Nightly-RecreateSKPs_Canary.json | 16 ++++++++++++++-- .../Housekeeper-Weekly-RecreateSKPs.json | 20 +++++++++++++++++--- .../recreate_skps.expected/failed_upload.json | 20 +++++++++++++++++--- infra/bots/recipes/recreate_skps.py | 21 ++++++++------------- 4 files changed, 56 insertions(+), 21 deletions(-) diff --git a/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json b/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json index 9c2c3e0..84506ff 100644 --- a/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json +++ b/infra/bots/recipes/recreate_skps.expected/Housekeeper-Nightly-RecreateSKPs_Canary.json @@ -124,8 +124,12 @@ ], "cwd": "[CUSTOM_/_B_WORK]/src", "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1", - "GYP_GENERATORS": "ninja" + "GYP_GENERATORS": "ninja", + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "GN" }, @@ -137,6 +141,12 @@ "chrome" ], "cwd": "[CUSTOM_/_B_WORK]/src", + "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, "name": "Build Chrome" }, { @@ -185,8 +195,10 @@ ], "cwd": "[CUSTOM_/_B_WORK]/skia", "env": { + "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", - "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "Recreate SKPs" }, diff --git a/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json b/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json index 929cfe9..9dd2609 100644 --- a/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json +++ b/infra/bots/recipes/recreate_skps.expected/Housekeeper-Weekly-RecreateSKPs.json @@ -124,8 +124,12 @@ ], "cwd": "[CUSTOM_/_B_WORK]/src", "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1", - "GYP_GENERATORS": "ninja" + "GYP_GENERATORS": "ninja", + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "GN" }, @@ -137,6 +141,12 @@ "chrome" ], "cwd": "[CUSTOM_/_B_WORK]/src", + "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, "name": "Build Chrome" }, { @@ -186,8 +196,10 @@ ], "cwd": "[CUSTOM_/_B_WORK]/skia", "env": { + "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", - "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "Recreate SKPs" }, @@ -276,10 +288,12 @@ ], "cwd": "[CUSTOM_/_B_WORK]/skia", "env": { + "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", "GOPATH": "[START_DIR]/gopath", "GOROOT": "[START_DIR]/go/go", - "PATH": "[START_DIR]/go/go/bin:[START_DIR]/gopath:%(PATH)s" + "PATH": "[START_DIR]/go/go/bin:[START_DIR]/gopath:%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "Upload SKPs" }, diff --git a/infra/bots/recipes/recreate_skps.expected/failed_upload.json b/infra/bots/recipes/recreate_skps.expected/failed_upload.json index 23bebee..517e6ee 100644 --- a/infra/bots/recipes/recreate_skps.expected/failed_upload.json +++ b/infra/bots/recipes/recreate_skps.expected/failed_upload.json @@ -124,8 +124,12 @@ ], "cwd": "[CUSTOM_/_B_WORK]/src", "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", "CPPFLAGS": "-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1", - "GYP_GENERATORS": "ninja" + "GYP_GENERATORS": "ninja", + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "GN" }, @@ -137,6 +141,12 @@ "chrome" ], "cwd": "[CUSTOM_/_B_WORK]/src", + "env": { + "BUILDTYPE": "Release", + "CHROME_HEADLESS": "1", + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" + }, "name": "Build Chrome" }, { @@ -186,8 +196,10 @@ ], "cwd": "[CUSTOM_/_B_WORK]/skia", "env": { + "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", - "PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s" + "PATH": "%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "Recreate SKPs" }, @@ -276,10 +288,12 @@ ], "cwd": "[CUSTOM_/_B_WORK]/skia", "env": { + "BUILDTYPE": "Release", "CHROME_HEADLESS": "1", "GOPATH": "[START_DIR]/gopath", "GOROOT": "[START_DIR]/go/go", - "PATH": "[START_DIR]/go/go/bin:[START_DIR]/gopath:%(PATH)s" + "PATH": "[START_DIR]/go/go/bin:[START_DIR]/gopath:%(PATH)s:RECIPE_PACKAGE_REPO[depot_tools]", + "SKIA_OUT": "[START_DIR]/out" }, "name": "Upload SKPs", "~followup_annotations": [ diff --git a/infra/bots/recipes/recreate_skps.py b/infra/bots/recipes/recreate_skps.py index 36df265..c697bf1 100644 --- a/infra/bots/recipes/recreate_skps.py +++ b/infra/bots/recipes/recreate_skps.py @@ -16,6 +16,7 @@ DEPS = [ 'recipe_engine/step', 'core', 'infra', + 'run', 'vars', ] @@ -95,10 +96,10 @@ def RunSteps(api): gn_env = {'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1', 'GYP_GENERATORS': 'ninja'} with api.step.context({'env': gn_env}): - api.step('GN', [gn, 'gen', out_dir]) + api.run(api.step, 'GN', cmd=[gn, 'gen', out_dir]) # Build Chrome. - api.step('Build Chrome', ['ninja', '-C', out_dir, 'chrome']) + api.run(api.step, 'Build Chrome', cmd=['ninja', '-C', out_dir, 'chrome']) # Clean up the output dir. output_dir = api.path['start_dir'].join('skp_output') @@ -107,12 +108,6 @@ def RunSteps(api): api.file.makedirs('skp_output', output_dir) # Capture the SKPs. - path_var= api.path.pathsep.join([ - str(api.gclient._module.PACKAGE_REPO_ROOT), '%(PATH)s']) - env = { - 'CHROME_HEADLESS': '1', - 'PATH': path_var, - } asset_dir = api.vars.infrabots_dir.join('assets', 'skp') cmd = ['python', asset_dir.join('create.py'), '--chrome_src_path', src_dir, @@ -120,8 +115,8 @@ def RunSteps(api): '--target_dir', output_dir] if 'Canary' not in api.properties['buildername']: cmd.append('--upload_to_partner_bucket') - with api.step.context({'cwd': api.vars.skia_dir, 'env': env}): - api.step('Recreate SKPs', cmd=cmd) + with api.step.context({'cwd': api.vars.skia_dir}): + api.run(api.step, 'Recreate SKPs', cmd=cmd) # Upload the SKPs. if 'Canary' not in api.properties['buildername']: @@ -132,10 +127,10 @@ def RunSteps(api): api.vars.skia_dir.join('infra', 'bots', 'upload_skps.py'), '--target_dir', output_dir, '--gitcookies', str(update_skps_gitcookies)] - env.update(api.infra.go_env) with gitcookies_auth(api, UPDATE_SKPS_KEY): - with api.step.context({'cwd': api.vars.skia_dir, 'env': env}): - api.step('Upload SKPs', cmd=cmd) + with api.step.context({'cwd': api.vars.skia_dir, + 'env': api.infra.go_env}): + api.run(api.step, 'Upload SKPs', cmd=cmd) def GenTests(api): -- 2.7.4