From 2a37a78bac0d404dcf3c26b2cbda7fa7b79f3c73 Mon Sep 17 00:00:00 2001 From: Alex Bradbury Date: Tue, 12 Nov 2024 22:01:15 +0000 Subject: [PATCH] Prevent UnifiedTreeBuilder producing step names over 50 characters in length (#293) Upstream buildbot releases error if a step name has over 50 characters long . UnifiedTreeBuilder can produce quite long step names that violate this, meaning it's difficult to spin up a local test environment (as in ) without local hacks to workaround this. In this patch, we simply truncate step names at creation time. This means llvm-zorg's buildbot config can be used with an unmodified upstream buildbot package. --- zorg/buildbot/builders/UnifiedTreeBuilder.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/zorg/buildbot/builders/UnifiedTreeBuilder.py b/zorg/buildbot/builders/UnifiedTreeBuilder.py index 5d1f394d5..ace899bc4 100644 --- a/zorg/buildbot/builders/UnifiedTreeBuilder.py +++ b/zorg/buildbot/builders/UnifiedTreeBuilder.py @@ -204,8 +204,15 @@ def addNinjaSteps( step_name = "build-{}unified-tree".format(step_name) step_description.extend(["unified", "tree"]) + # Helper to for use truncating step names to 50 chars, needed due to + # . + def trunc50(name): + if len(name) > 50: + return name[:47] + "..." + return name + # Build the unified tree. - f.addStep(NinjaCommand(name=step_name, + f.addStep(NinjaCommand(name=trunc50(step_name), haltOnFailure=True, targets=targets, description=step_description, @@ -223,7 +230,7 @@ def addNinjaSteps( check_env = env or {} for check in checks: - f.addStep(LitTestCommand(name="test-%s-%s" % (step_name, check), + f.addStep(LitTestCommand(name=trunc50("test-%s-%s" % (step_name, check)), command=['ninja', check], description=[ "Test", "just", "built", "components", "for", @@ -237,7 +244,7 @@ def addNinjaSteps( # Install just built components if install_dir: # TODO: Run this step only if none of the prevous failed. - f.addStep(NinjaCommand(name="install-%sall" % step_name, + f.addStep(NinjaCommand(name=trunc50("install-%sall" % step_name), targets=["install"], description=["Install", "just", "built", "components"], env=env or {},