[libwebp] Add static-analysis builders
Change-Id: Ib1ff956bde3194ee56d399501afc291a92672fa1
Bug: b:185520507
Reviewed-on: https://chromium-review.googlesource.com/c/codecs/infra/+/3241886
Commit-Queue: Roberto Alanis Baez <[email protected]>
Reviewed-by: James Zern <[email protected]>
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg
index b4bcee1..d1ae78f 100644
--- a/infra/config/generated/commit-queue.cfg
+++ b/infra/config/generated/commit-queue.cfg
@@ -542,6 +542,12 @@
builders {
name: "open-codecs/try/libwebp-patch-check"
}
+ builders {
+ name: "open-codecs/try/libwebp-static-analysis-deep"
+ }
+ builders {
+ name: "open-codecs/try/libwebp-static-analysis-shallow"
+ }
retry_config {
single_quota: 1
global_quota: 2
diff --git a/infra/config/generated/cr-buildbucket.cfg b/infra/config/generated/cr-buildbucket.cfg
index 764b0d6..ec596dd 100644
--- a/infra/config/generated/cr-buildbucket.cfg
+++ b/infra/config/generated/cr-buildbucket.cfg
@@ -7498,6 +7498,104 @@
}
}
builders {
+ name: "libwebp-static-analysis-deep"
+ swarming_host: "chromium-swarm.appspot.com"
+ dimensions: "cpu:x86-64"
+ dimensions: "os:Ubuntu"
+ dimensions: "pool:luci.open-codecs.try"
+ exe {
+ cipd_package: "infra/recipe_bundles/chromium.googlesource.com/codecs/infra"
+ cipd_version: "refs/heads/main"
+ cmd: "luciexe"
+ }
+ properties:
+ '{'
+ ' "$codecs/prerequisites": {'
+ ' "cipd_package": ['
+ ' {'
+ ' "dest": "android-ndk",'
+ ' "package_path": "infra/recipe_bundles/chromium.googlesource.com/codecs/infra/android-ndk",'
+ ' "version": "latest"'
+ ' },'
+ ' {'
+ ' "dest": "mips-img-linux-gnu/bin",'
+ ' "package_path": "infra/recipe_bundles/chromium.googlesource.com/codecs/infra/mips-img-linux-gnu",'
+ ' "version": "latest"'
+ ' },'
+ ' {'
+ ' "dest": "mips-mti-linux-gnu/bin",'
+ ' "package_path": "infra/recipe_bundles/chromium.googlesource.com/codecs/infra/mips-mti-linux-gnu",'
+ ' "version": "latest"'
+ ' }'
+ ' ]'
+ ' },'
+ ' "recipe": "run_infra_script",'
+ ' "script_arg": ['
+ ' "deep"'
+ ' ],'
+ ' "script_name": "run_static_analysis.sh"'
+ '}'
+ execution_timeout_secs: 2700
+ service_account: "open-codecs-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+ experiments {
+ key: "luci.recipes.use_python3"
+ value: 100
+ }
+ experiments {
+ key: "luci.use_realms"
+ value: 100
+ }
+ }
+ builders {
+ name: "libwebp-static-analysis-shallow"
+ swarming_host: "chromium-swarm.appspot.com"
+ dimensions: "cpu:x86-64"
+ dimensions: "os:Ubuntu"
+ dimensions: "pool:luci.open-codecs.try"
+ exe {
+ cipd_package: "infra/recipe_bundles/chromium.googlesource.com/codecs/infra"
+ cipd_version: "refs/heads/main"
+ cmd: "luciexe"
+ }
+ properties:
+ '{'
+ ' "$codecs/prerequisites": {'
+ ' "cipd_package": ['
+ ' {'
+ ' "dest": "android-ndk",'
+ ' "package_path": "infra/recipe_bundles/chromium.googlesource.com/codecs/infra/android-ndk",'
+ ' "version": "latest"'
+ ' },'
+ ' {'
+ ' "dest": "mips-img-linux-gnu/bin",'
+ ' "package_path": "infra/recipe_bundles/chromium.googlesource.com/codecs/infra/mips-img-linux-gnu",'
+ ' "version": "latest"'
+ ' },'
+ ' {'
+ ' "dest": "mips-mti-linux-gnu/bin",'
+ ' "package_path": "infra/recipe_bundles/chromium.googlesource.com/codecs/infra/mips-mti-linux-gnu",'
+ ' "version": "latest"'
+ ' }'
+ ' ]'
+ ' },'
+ ' "recipe": "run_infra_script",'
+ ' "script_arg": ['
+ ' "shallow"'
+ ' ],'
+ ' "script_name": "run_static_analysis.sh"'
+ '}'
+ execution_timeout_secs: 2700
+ service_account: "open-codecs-try-builder@chops-service-accounts.iam.gserviceaccount.com"
+ experiments {
+ key: "luci.recipes.use_python3"
+ value: 100
+ }
+ experiments {
+ key: "luci.use_realms"
+ value: 100
+ }
+ }
+ builders {
name: "libwebp2-patch-check"
swarming_host: "chromium-swarm.appspot.com"
dimensions: "cpu:x86-64"
diff --git a/infra/config/generated/luci-milo.cfg b/infra/config/generated/luci-milo.cfg
index 588d8e2..d576ac6 100644
--- a/infra/config/generated/luci-milo.cfg
+++ b/infra/config/generated/luci-milo.cfg
@@ -468,6 +468,12 @@
name: "buildbucket/luci.open-codecs.try/libwebp-compile-android-x86_64-shared-debug"
}
builders {
+ name: "buildbucket/luci.open-codecs.try/libwebp-static-analysis-shallow"
+ }
+ builders {
+ name: "buildbucket/luci.open-codecs.try/libwebp-static-analysis-deep"
+ }
+ builders {
name: "buildbucket/luci.open-codecs.try/libwebp2-patch-check"
}
builders {
diff --git a/infra/config/subprojects/libwebp/try.star b/infra/config/subprojects/libwebp/try.star
index b215c29..30853e4 100644
--- a/infra/config/subprojects/libwebp/try.star
+++ b/infra/config/subprojects/libwebp/try.star
@@ -110,6 +110,10 @@
"x86_64",
]
+# Libwebp static analysis configuration list.
+_LIBWEBP_STATIC_ANALYSIS_MODES = ["shallow", "deep"]
+
+# TODO(): Capture index.html output and it will need warning threshold itself.
def _libwebp_compile_builder(
*,
name,
@@ -128,7 +132,7 @@
compile_targets: host platform list
excluded_builders: filter list to remove builder from lucicfg
properties: builder's input properties
- **kwargs: other keywords args
+ **kwargs: other keyword args
"""
builders = []
for config in build_types:
@@ -162,6 +166,39 @@
)
return builders
+def _libwebp_static_analysis_builder(
+ *,
+ name,
+ scan_build_modes,
+ properties = {},
+ **kwargs):
+ """Defines static analysis builds.
+
+ Args:
+ name: name of builder
+ scan_build_modes: static analysis configuration list
+ properties: builder's input properties
+ **kwargs: other keyword args
+ """
+ builders = []
+ for mode in scan_build_modes:
+ builder_name = "%s-%s" % (name, mode)
+
+ overridden_properties = {
+ "script_name": "run_static_analysis.sh",
+ "script_arg": [mode],
+ }
+ overridden_properties.update(properties)
+ builders.append(
+ try_helper.create_builder(
+ name = builder_name,
+ os = "linux",
+ properties = overridden_properties,
+ **kwargs
+ ),
+ )
+ return builders
+
libwebp_try_builder = try_helper.setup_builder(
prefix = "libwebp",
repo = LIBWEBP_REPO_URL,
@@ -227,3 +264,11 @@
compile_targets = _LIBWEBP_COMPILE_ANDROID_TARGETS,
recipe = "run_infra_script",
)
+
+# Defines libwebp builds for static analysis.
+libwebp_try_builder(
+ name = "static-analysis",
+ builder_creator = _libwebp_static_analysis_builder,
+ scan_build_modes = _LIBWEBP_STATIC_ANALYSIS_MODES,
+ recipe = "run_infra_script",
+)