From 7cad921a198bbdb1c42e180ab81bda7da3b1e58a Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Mon, 11 Jul 2022 13:11:57 -0400 Subject: [PATCH] Add a 'FrameworkWorkarounds' Android job Lets use this to test special behavior that's normally gated behind SK_BUILD_FOR_ANDROID_FRAMEWORK (or preferably: feature flags that are only enabled in the framework). Change-Id: If272ed118d712dc1a49b6e2fc9660f86566e2220 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/557576 Commit-Queue: Brian Osman Reviewed-by: Kevin Lubick Reviewed-by: Leon Scroggins --- infra/bots/jobs.json | 2 + infra/bots/recipe_modules/build/android.py | 5 + ...64-Debug-Android_FrameworkWorkarounds.json | 102 ++++++++++ .../recipe_modules/build/examples/full.py | 1 + infra/bots/tasks.json | 192 ++++++++++++++++++ 5 files changed, 302 insertions(+) create mode 100644 infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds.json diff --git a/infra/bots/jobs.json b/infra/bots/jobs.json index 90e0743e97..c252084358 100644 --- a/infra/bots/jobs.json +++ b/infra/bots/jobs.json @@ -41,6 +41,7 @@ "cq_config": {} }, {"name": "Build-Debian10-Clang-arm64-Debug-Android_API30"}, + {"name": "Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds"}, {"name": "Build-Debian10-Clang-arm64-Debug-Android_HWASAN"}, {"name": "Build-Debian10-Clang-arm64-Debug-Android_Vulkan"}, {"name": "Build-Debian10-Clang-arm64-Release-Android"}, @@ -474,6 +475,7 @@ {"name": "Test-Android-Clang-Pixel5-GPU-Adreno620-arm64-Release-All-Android_Vulkan"}, {"name": "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Release-All-Android"}, {"name": "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android"}, + {"name": "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android_FrameworkWorkarounds"}, {"name": "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Release-All-Android_Vulkan"}, {"name": "Test-Android-Clang-Pixel6-GPU-MaliG78-arm64-Release-All-Android"}, {"name": "Test-Android-Clang-Pixel6-GPU-MaliG78-arm64-Debug-All-Android"}, diff --git a/infra/bots/recipe_modules/build/android.py b/infra/bots/recipe_modules/build/android.py index 4af35e0b88..58ad4f7fbf 100644 --- a/infra/bots/recipe_modules/build/android.py +++ b/infra/bots/recipe_modules/build/android.py @@ -52,6 +52,11 @@ def compile_fn(api, checkout_root, out_dir): if 'Wuffs' in extra_tokens: args['skia_use_wuffs'] = 'true' + # The 'FrameworkWorkarounds' bot is used to test special behavior that's + # normally enabled with SK_BUILD_FOR_ANDROID_FRAMEWORK. + if 'FrameworkWorkarounds' in extra_tokens: + extra_cflags.append('-DSK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE') + # If an Android API level is specified, use that. for t in extra_tokens: m = re.search(r'API(\d+)', t) diff --git a/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds.json b/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds.json new file mode 100644 index 0000000000..b27da099d1 --- /dev/null +++ b/infra/bots/recipe_modules/build/examples/full.expected/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds.json @@ -0,0 +1,102 @@ +[ + { + "cmd": [ + "vpython", + "-u", + "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", + "--json-output", + "/path/to/tmp/json", + "copy", + "[START_DIR]/cache/work/skia/infra/bots/assets/android_ndk_linux/VERSION", + "/path/to/tmp/" + ], + "infra_step": true, + "name": "Get android_ndk_linux VERSION", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@VERSION@42@@@", + "@@@STEP_LOG_END@VERSION@@@" + ] + }, + { + "cmd": [ + "python", + "-u", + "[START_DIR]/cache/work/skia/bin/fetch-gn" + ], + "cwd": "[START_DIR]/cache/work/skia", + "env": { + "CHROME_HEADLESS": "1", + "PATH": ":RECIPE_REPO[depot_tools]" + }, + "infra_step": true, + "name": "fetch-gn" + }, + { + "cmd": [ + "[START_DIR]/cache/work/skia/bin/gn", + "gen", + "[START_DIR]/cache/work/skia/out/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds/Debug", + "--args=extra_cflags=[\"-O1\", \"-DREBUILD_IF_CHANGED_ndk_version=42\", \"-DSK_SUPPORT_LEGACY_ALPHA_BITMAP_AS_COVERAGE\"] ndk=\"[START_DIR]/android_ndk_linux\" target_cpu=\"arm64\" werror=true" + ], + "cwd": "[START_DIR]/cache/work/skia", + "env": { + "CHROME_HEADLESS": "1", + "PATH": ":RECIPE_REPO[depot_tools]" + }, + "name": "gn gen" + }, + { + "cmd": [ + "ninja", + "-C", + "[START_DIR]/cache/work/skia/out/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds/Debug" + ], + "cwd": "[START_DIR]/cache/work/skia", + "env": { + "CHROME_HEADLESS": "1", + "PATH": ":RECIPE_REPO[depot_tools]" + }, + "name": "ninja" + }, + { + "cmd": [ + "python", + "-u", + "import errno\nimport glob\nimport os\nimport shutil\nimport sys\n\nsrc = sys.argv[1]\ndst = sys.argv[2]\nbuild_products = ['dm', 'nanobench', 'skpbench']\n\ntry:\n os.makedirs(dst)\nexcept OSError as e:\n if e.errno != errno.EEXIST:\n raise\n\nfor pattern in build_products:\n path = os.path.join(src, pattern)\n for f in glob.glob(path):\n dst_path = os.path.join(dst, os.path.relpath(f, src))\n if not os.path.isdir(os.path.dirname(dst_path)):\n os.makedirs(os.path.dirname(dst_path))\n print('Copying build product %s to %s' % (f, dst_path))\n shutil.move(f, dst_path)\n", + "[START_DIR]/cache/work/skia/out/Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds/Debug", + "[START_DIR]/[SWARM_OUT_DIR]/out/Debug" + ], + "infra_step": true, + "name": "copy build products", + "~followup_annotations": [ + "@@@STEP_LOG_LINE@python.inline@import errno@@@", + "@@@STEP_LOG_LINE@python.inline@import glob@@@", + "@@@STEP_LOG_LINE@python.inline@import os@@@", + "@@@STEP_LOG_LINE@python.inline@import shutil@@@", + "@@@STEP_LOG_LINE@python.inline@import sys@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@src = sys.argv[1]@@@", + "@@@STEP_LOG_LINE@python.inline@dst = sys.argv[2]@@@", + "@@@STEP_LOG_LINE@python.inline@build_products = ['dm', 'nanobench', 'skpbench']@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@try:@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(dst)@@@", + "@@@STEP_LOG_LINE@python.inline@except OSError as e:@@@", + "@@@STEP_LOG_LINE@python.inline@ if e.errno != errno.EEXIST:@@@", + "@@@STEP_LOG_LINE@python.inline@ raise@@@", + "@@@STEP_LOG_LINE@python.inline@@@@", + "@@@STEP_LOG_LINE@python.inline@for pattern in build_products:@@@", + "@@@STEP_LOG_LINE@python.inline@ path = os.path.join(src, pattern)@@@", + "@@@STEP_LOG_LINE@python.inline@ for f in glob.glob(path):@@@", + "@@@STEP_LOG_LINE@python.inline@ dst_path = os.path.join(dst, os.path.relpath(f, src))@@@", + "@@@STEP_LOG_LINE@python.inline@ if not os.path.isdir(os.path.dirname(dst_path)):@@@", + "@@@STEP_LOG_LINE@python.inline@ os.makedirs(os.path.dirname(dst_path))@@@", + "@@@STEP_LOG_LINE@python.inline@ print('Copying build product %s to %s' % (f, dst_path))@@@", + "@@@STEP_LOG_LINE@python.inline@ shutil.move(f, dst_path)@@@", + "@@@STEP_LOG_END@python.inline@@@" + ] + }, + { + "name": "$result" + } +] \ No newline at end of file diff --git a/infra/bots/recipe_modules/build/examples/full.py b/infra/bots/recipe_modules/build/examples/full.py index 92e85360b2..543c9cd33f 100644 --- a/infra/bots/recipe_modules/build/examples/full.py +++ b/infra/bots/recipe_modules/build/examples/full.py @@ -36,6 +36,7 @@ TEST_BUILDERS = [ 'Build-Debian10-Clang-arm-Release-Android_ASAN', 'Build-Debian10-Clang-arm-Release-Chromebook_GLES', 'Build-Debian10-Clang-arm-Release-Flutter_Android', + 'Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds', 'Build-Debian10-Clang-arm64-Debug-Android_HWASAN', 'Build-Debian10-Clang-arm64-Release-Android_Wuffs', 'Build-Debian10-Clang-x86_64-Debug-Chromebook_GLES', diff --git a/infra/bots/tasks.json b/infra/bots/tasks.json index b49dd93787..739ac77800 100755 --- a/infra/bots/tasks.json +++ b/infra/bots/tasks.json @@ -90,6 +90,11 @@ "Build-Debian10-Clang-arm64-Debug-Android_API30" ] }, + "Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds": { + "tasks": [ + "Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds" + ] + }, "Build-Debian10-Clang-arm64-Debug-Android_HWASAN": { "tasks": [ "Build-Debian10-Clang-arm64-Debug-Android_HWASAN" @@ -2010,6 +2015,11 @@ "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android" ] }, + "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android_FrameworkWorkarounds": { + "tasks": [ + "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android_FrameworkWorkarounds" + ] + }, "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Release-All-Android": { "tasks": [ "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Release-All-Android" @@ -4470,6 +4480,95 @@ ], "service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com" }, + "Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds": { + "caches": [ + { + "name": "vpython", + "path": "cache/vpython" + } + ], + "casSpec": "compile", + "cipd_packages": [ + { + "name": "infra/3pp/tools/cpython3/linux-amd64", + "path": "cipd_bin_packages/cpython3", + "version": "version:2@3.8.10.chromium.19" + }, + { + "name": "infra/tools/luci-auth/${platform}", + "path": "cipd_bin_packages", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "infra/tools/luci/kitchen/${platform}", + "path": ".", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "infra/tools/luci/vpython-native/${platform}", + "path": "cipd_bin_packages", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "infra/tools/luci/vpython/${platform}", + "path": "cipd_bin_packages", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "skia/bots/android_ndk_linux", + "path": "android_ndk_linux", + "version": "version:16" + } + ], + "command": [ + "cipd_bin_packages/vpython3${EXECUTABLE_SUFFIX}", + "-u", + "skia/infra/bots/run_recipe.py", + "${ISOLATED_OUTDIR}", + "compile", + "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildername\":\"Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds\",\"swarm_out_dir\":\"build\"}", + "skia" + ], + "dependencies": [ + "Housekeeper-PerCommit-BundleRecipes" + ], + "dimensions": [ + "cpu:x86-64-Haswell_GCE", + "gpu:none", + "machine_type:n1-highcpu-64", + "os:Debian-10.3", + "pool:Skia" + ], + "environment": { + "RECIPES_USE_PY3": "true", + "VPYTHON_LOG_TRACE": "1" + }, + "env_prefixes": { + "PATH": [ + "cipd_bin_packages/cpython3", + "cipd_bin_packages/cpython3/bin", + "cipd_bin_packages", + "cipd_bin_packages/bin" + ], + "VPYTHON_DEFAULT_SPEC": [ + "skia/.vpython" + ], + "VPYTHON_VIRTUALENV_ROOT": [ + "cache/vpython" + ] + }, + "execution_timeout_ns": 3600000000000, + "extra_tags": { + "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations" + }, + "idempotent": true, + "io_timeout_ns": 3600000000000, + "max_attempts": 2, + "outputs": [ + "build" + ], + "service_account": "skia-external-compile-tasks@skia-swarming-bots.iam.gserviceaccount.com" + }, "Build-Debian10-Clang-arm64-Debug-Android_HWASAN": { "caches": [ { @@ -39393,6 +39492,99 @@ ], "service_account": "skia-external-gm-uploader@skia-swarming-bots.iam.gserviceaccount.com" }, + "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android_FrameworkWorkarounds": { + "caches": [ + { + "name": "vpython", + "path": "cache/vpython" + } + ], + "casSpec": "test", + "cipd_packages": [ + { + "name": "infra/3pp/tools/cpython3/linux-arm64", + "path": "cipd_bin_packages/cpython3", + "version": "version:2@3.8.10.chromium.19" + }, + { + "name": "infra/tools/luci-auth/${platform}", + "path": "cipd_bin_packages", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "infra/tools/luci/kitchen/${platform}", + "path": ".", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "infra/tools/luci/vpython-native/${platform}", + "path": "cipd_bin_packages", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "infra/tools/luci/vpython/${platform}", + "path": "cipd_bin_packages", + "version": "git_revision:34ecdc8775563915792e05ba9d921342808ae2dc" + }, + { + "name": "skia/bots/gsutil", + "path": "gsutil", + "version": "version:0" + } + ], + "command": [ + "cipd_bin_packages/vpython3${EXECUTABLE_SUFFIX}", + "-u", + "skia/infra/bots/run_recipe.py", + "${ISOLATED_OUTDIR}", + "test", + "{\"$kitchen\":{\"devshell\":true,\"git_auth\":true},\"buildbucket_build_id\":\"<(BUILDBUCKET_BUILD_ID)\",\"buildername\":\"Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android_FrameworkWorkarounds\",\"dm_flags\":\"[\\\"dm\\\",\\\"--nameByHash\\\",\\\"--key\\\",\\\"arch\\\",\\\"arm64\\\",\\\"compiler\\\",\\\"Clang\\\",\\\"configuration\\\",\\\"Debug\\\",\\\"cpu_or_gpu\\\",\\\"GPU\\\",\\\"cpu_or_gpu_value\\\",\\\"Adreno620\\\",\\\"extra_config\\\",\\\"Android_FrameworkWorkarounds\\\",\\\"model\\\",\\\"Pixel5\\\",\\\"os\\\",\\\"Android12\\\",\\\"style\\\",\\\"default\\\",\\\"--nocpu\\\",\\\"--config\\\",\\\"gles\\\",\\\"glesdft\\\",\\\"srgb-gles\\\",\\\"--src\\\",\\\"tests\\\",\\\"gm\\\",\\\"image\\\",\\\"colorImage\\\",\\\"svg\\\",\\\"--skip\\\",\\\"_\\\",\\\"svg\\\",\\\"_\\\",\\\"svgparse_\\\",\\\"srgb-gles\\\",\\\"image\\\",\\\"_\\\",\\\"_\\\",\\\"_\\\",\\\"image\\\",\\\"gen_platf\\\",\\\"error\\\",\\\"_\\\",\\\"test\\\",\\\"_\\\",\\\"GrStyledShape\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced1.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced2.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\"interlaced3.png\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".arw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".cr2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".dng\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".nrw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".orf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".raf\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".rw2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".pef\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".srw\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ARW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".CR2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".DNG\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".NRW\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".ORF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RAF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".RW2\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".PEF\\\",\\\"_\\\",\\\"image\\\",\\\"_\\\",\\\".SRW\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLArrayCast_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLArrayComparison_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLCommaSideEffects_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLIntrinsicMixFloat_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLIntrinsicClampFloat_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLOutParamsAreDistinctFromGlobal_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLIntrinsicIsInf_GPU\\\",\\\"_\\\",\\\"tests\\\",\\\"_\\\",\\\"SkSLStructFieldFolding_GPU\\\",\\\"--nonativeFonts\\\",\\\"--verbose\\\"]\",\"dm_properties\":\"{\\\"buildbucket_build_id\\\":\\\"<(BUILDBUCKET_BUILD_ID)\\\",\\\"builder\\\":\\\"Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Debug-All-Android_FrameworkWorkarounds\\\",\\\"gitHash\\\":\\\"<(REVISION)\\\",\\\"issue\\\":\\\"<(ISSUE)\\\",\\\"patch_storage\\\":\\\"<(PATCH_STORAGE)\\\",\\\"patchset\\\":\\\"<(PATCHSET)\\\",\\\"swarming_bot_id\\\":\\\"${SWARMING_BOT_ID}\\\",\\\"swarming_task_id\\\":\\\"${SWARMING_TASK_ID}\\\",\\\"task_id\\\":\\\"<(TASK_ID)\\\"}\",\"do_upload\":\"true\",\"gold_hashes_url\":\"https://gold.skia.org/json/v1/hashes\",\"gs_bucket\":\"skia-infra-gm\",\"images\":\"true\",\"patch_issue\":\"<(ISSUE_INT)\",\"patch_ref\":\"<(PATCH_REF)\",\"patch_repo\":\"<(PATCH_REPO)\",\"patch_set\":\"<(PATCHSET_INT)\",\"patch_storage\":\"<(PATCH_STORAGE)\",\"repository\":\"<(REPO)\",\"resources\":\"true\",\"revision\":\"<(REVISION)\",\"skps\":\"true\",\"svgs\":\"true\",\"swarm_out_dir\":\"test\",\"task_id\":\"<(TASK_ID)\"}", + "skia" + ], + "dependencies": [ + "Build-Debian10-Clang-arm64-Debug-Android_FrameworkWorkarounds", + "Housekeeper-PerCommit-BundleRecipes", + "Housekeeper-PerCommit-IsolateSKP", + "Housekeeper-PerCommit-IsolateSVG", + "Housekeeper-PerCommit-IsolateSkImage" + ], + "dimensions": [ + "device_os:SP2A.220305.012", + "device_type:redfin", + "os:Android", + "pool:Skia" + ], + "environment": { + "RECIPES_USE_PY3": "true", + "VPYTHON_LOG_TRACE": "1" + }, + "env_prefixes": { + "PATH": [ + "gsutil/gsutil", + "cipd_bin_packages/cpython3", + "cipd_bin_packages/cpython3/bin", + "cipd_bin_packages", + "cipd_bin_packages/bin" + ], + "VPYTHON_DEFAULT_SPEC": [ + "skia/.vpython" + ], + "VPYTHON_VIRTUALENV_ROOT": [ + "cache/vpython" + ] + }, + "execution_timeout_ns": 14400000000000, + "expiration_ns": 72000000000000, + "extra_tags": { + "log_location": "logdog://logs.chromium.org/skia/${SWARMING_TASK_ID}/+/annotations" + }, + "io_timeout_ns": 14400000000000, + "max_attempts": 2, + "outputs": [ + "test" + ], + "service_account": "skia-external-gm-uploader@skia-swarming-bots.iam.gserviceaccount.com" + }, "Test-Android12-Clang-Pixel5-GPU-Adreno620-arm64-Release-All-Android": { "caches": [ {