Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions zorg/buildbot/builders/UnifiedTreeBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ def getCmakeExBuildFactory(
post_finalize_steps = None,
jobs = None, # Restrict a degree of parallelism.
env = None, # Common environmental variables.
hint = None,
):

""" Create and configure a builder factory to build a LLVM project from the unified source tree.
Expand Down Expand Up @@ -789,6 +790,15 @@ def getCmakeExBuildFactory(
env : dict, optional
Common environmental variables for all build steps (default is None).

hint : string, optional
Use this hint to apply suffixes to the step names when factory is used as a nested factory for another one.
The suffix will be added to the step name separated by dash symbol.

As example, passing of 'stageX' with 'hint' will force generating of the following step names:
cmake-cofigure => cmake-configure-stageX
build => build-stageX
install => install-stageX
& etc.

Returns
-------
Expand Down Expand Up @@ -866,6 +876,7 @@ def norm_target_list_arg(lst):
f = LLVMBuildFactory(
depends_on_projects = depends_on_projects,
enable_runtimes = enable_runtimes,
hint = hint,
llvm_srcdir = llvm_srcdir,
src_to_build_dir = src_to_build_dir,
obj_dir = obj_dir,
Expand All @@ -875,7 +886,7 @@ def norm_target_list_arg(lst):
f.addSteps([
# Set up some properties, which could be used to configure the builders.
steps.SetProperties(
name = 'set-props',
name = f.makeStepName('set-props'),
properties = {
"depends_on_projects" : ";".join(sorted(f.depends_on_projects)),
"enable_projects" : ";".join(sorted(f.enable_projects)),
Expand All @@ -889,7 +900,7 @@ def norm_target_list_arg(lst):
# This is an incremental build, unless otherwise has been requested.
# Remove obj dirs for a clean build.
steps.RemoveDirectory(
name = 'clean-obj-dir',
name = f.makeStepName('clean-obj-dir'),
dir = util.Interpolate(f.obj_dir),
description = ["Remove", util.Interpolate(f.obj_dir), "directory"],
haltOnFailure = False,
Expand Down Expand Up @@ -926,7 +937,7 @@ def norm_target_list_arg(lst):
if vs:
f.addStep(
steps.SetPropertyFromCommand(
name = "set-props.vs_env",
name = f.makeStepName("set-props.vs_env"),
command = builders_util.getVisualStudioEnvironment(vs, vs_arch),
extract_fn = builders_util.extractVSEnvironment,
env = env
Expand All @@ -952,7 +963,7 @@ def norm_target_list_arg(lst):
# Remove install directory.
f.addSteps([
steps.RemoveDirectory(
name = f"clean-install-dir",
name = f.makeStepName("clean-install-dir"),
dir = util.Interpolate(f.install_dir),
description = ["Remove", util.Interpolate(f.install_dir), "directory"],
haltOnFailure = False,
Expand All @@ -972,7 +983,7 @@ def norm_target_list_arg(lst):

f.addStep(
steps.CMake(
name = f"cmake-configure",
name = f.makeStepName("cmake-configure"),
path = LLVMBuildFactory.pathRelativeTo(f.llvm_srcdir, f.obj_dir),
generator = generator,
definitions = cmake_definitions,
Expand All @@ -983,6 +994,7 @@ def norm_target_list_arg(lst):
workdir = f.obj_dir
))

hint_suffix = f"-{hint}" if hint else None
# Build Commands.
#NOTE: please note that the default target (.) cannot be specified by the IRenderable object.
for target in targets:
Expand All @@ -996,7 +1008,8 @@ def norm_target_list_arg(lst):

f.addStep(
steps.CMake(
name = util.Interpolate("build-%(kw:title)s", title = target_title),
name = util.Interpolate("build-%(kw:title)s%(kw:hint:-)s",
title = target_title, hint = hint_suffix),
options = cmake_build_options,
description = ["Build target", target_title],
haltOnFailure = True,
Expand All @@ -1012,7 +1025,8 @@ def norm_target_list_arg(lst):
for target in checks:
f.addStep(
LitTestCommand(
name = util.Interpolate("test-%(kw:title)s", title = target),
name = util.Interpolate("test-%(kw:title)s%(kw:hint:-)s",
title = target, hint = hint_suffix),
command = [steps.CMake.DEFAULT_CMAKE, "--build", ".", "--target", target],
description = ["Test just built components:", target],
descriptionDone = ["Test just built components:", target, "completed"],
Expand All @@ -1025,7 +1039,8 @@ def norm_target_list_arg(lst):
for target, cmd in checks_on_target:
f.addStep(
LitTestCommand(
name = util.Interpolate("test-%(kw:title)s", title = target),
name = util.Interpolate("test-%(kw:title)s%(kw:hint:-)s",
title = target, hint = hint_suffix),
command = cmd,
description = ["Test just built components:", target],
descriptionDone = ["Test just built components:", target, "completed"],
Expand All @@ -1044,7 +1059,7 @@ def norm_target_list_arg(lst):
f.addStep(
steps.CMake(
name = util.Transform(lambda s: s if s.startswith("install") else f"install-{s}",
util.Interpolate("%(kw:title)s", title = target)),
util.Interpolate("%(kw:title)s%(kw:hint:-)s", title = target, hint = hint_suffix)),
options = ["--build", ".", "--target", target],
description = ["Install just built components:", target],
haltOnFailure = False,
Expand Down