[1/2] Add binutils-snapshots builder

Message ID 20240522221523.458943-2-mark@klomp.org
State New
Headers
Series [1/2] Add binutils-snapshots builder |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Mark Wielaard May 22, 2024, 10:08 p.m. UTC
  ---
 builder/master.cfg | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
  

Patch

diff --git a/builder/master.cfg b/builder/master.cfg
index e462f8426ca0..e5c1796c6996 100644
--- a/builder/master.cfg
+++ b/builder/master.cfg
@@ -954,6 +954,19 @@  binutils_try_scheduler = schedulers.AnyBranchScheduler(
                       "binutils-try-ubuntu-riscv"])
 c['schedulers'].append(binutils_try_scheduler)
 
+binutils_snapshot_scheduler = schedulers.Periodic(
+        name="binutils-snapshots",
+        change_filter=util.ChangeFilter(project="binutils-gdb",
+                                        branch="master"),
+        branch="master",
+        periodicBuildTimer=15*60, # 15 minutes in seconds
+        onlyIfChanged=True,
+        fileIsImportant=binutilsImportant,
+        onlyImportant=True,
+        reason="binutils periodic project master branch snapshot",
+        builderNames=["binutils-snapshots"])
+c['schedulers'].append(binutils_snapshot_scheduler)
+
 # Only trigger scheduler for changes to gdb (or deps)
 gdb_files = ["bfd/",
              "config/",
@@ -2865,6 +2878,20 @@  binutils_make_clean_step = steps.ShellCommand(
         command=["make", "clean"],
         name="make clean")
 
+binutils_step_setversion = steps.ShellCommand(
+        name="set bfd version",
+        command='sed -i "s/m4_define(\\[BFD_VERSION\\], \\[\\([0-9\\\\.]\\+\\)\\])/m4_define(\\[BFD_VERSION\\], [\\1-$(git rev-parse --short @)])/" bfd/version.m4')
+binutils_step_src_release = steps.ShellCommand(
+        name="src-release",
+        command="./src-release.sh -g binutils")
+binutils_create_output_step = steps.ShellCommand(
+        name="create output",
+        command="mkdir -p /home/builder/shared/output/src &&"
+        + "mv ./binutils-*tar.gz /home/builder/shared/output/src")
+binutils_create_publish_file_step = steps.ShellCommand(
+        name="create publish file",
+        command="echo binutils/trunk > /home/builder/shared/publish")
+
 binutils_factory = util.BuildFactory()
 binutils_factory.addStep(binutils_step_git)
 binutils_factory.addStep(binutils_step_rm_build_dir)
@@ -2899,6 +2926,14 @@  binutils_gdb_autoregen_factory.addStep(binutils_gdb_step_git)
 binutils_gdb_autoregen_factory.addStep(autoregen_step)
 binutils_gdb_autoregen_factory.addStep(git_diff_step)
 
+binutils_factory_snapshot = util.BuildFactory()
+binutils_factory_snapshot.addStep(binutils_step_git)
+binutils_factory_snapshot.addStep(binutils_step_setversion)
+binutils_factory_snapshot.addStep(binutils_step_src_release)
+binutils_factory_snapshot.addStep(wait_snapshots_output_ready_step)
+binutils_factory_snapshot.addStep(binutils_create_output_step)
+binutils_factory_snapshot.addStep(binutils_create_publish_file_step)
+
 binutils_debian_amd64_builder = util.BuilderConfig(
 	name="binutils-debian-amd64",
         properties={'container-file':
@@ -3093,6 +3128,16 @@  binutils_gdb_autoregen_builder = util.BuilderConfig(
         factory=binutils_gdb_autoregen_factory)
 c['builders'].append(binutils_gdb_autoregen_builder)
 
+binutils_snapshots_builder = util.BuilderConfig(
+        name="binutils-snapshots",
+        collapseRequests=True,
+        properties={'container-file':
+                    readContainerFile('debian-stable')},
+        workernames="snapshots",
+        tags=["binutils-snapshots"],
+        factory=binutils_factory_snapshot)
+c['builders'].append(binutils_snapshots_builder)
+
 # gdb build steps, factory and builders
 
 gdb_git_step = steps.Git(
@@ -5403,6 +5448,17 @@  mn_binutils_try = reporters.MailNotifier(
         generators=[generator_binutils_try])
 c['services'].append(mn_binutils_try)
 
+# Snapshot builder reports
+generator_binutils_snapshot_problem = reporters.BuildStatusGenerator(
+        tags=["binutils-snapshots"],
+        mode=('problem',))
+mn_binutils_snapshot_change = reporters.MailNotifier(
+        fromaddr="builder@sourceware.org",
+        sendToInterestedUsers=True,
+        extraRecipients=['binutils@sourceware.org'],
+        generators=[generator_binutils_snapshot_problem])
+c['services'].append(mn_binutils_snapshot_change)
+
 # Problem report for the whole gdb tagged builder set
 generator_gdb = reporters.BuildSetStatusGenerator(
         mode=('problem',), tags=['gdb'])