Skip to contentSkip to conversation

scripts/autobuild-run: add support for --branch option

PATCH In review James Hilliard 3 participants 8 messages Jun 7, 2022 – Feb 15, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/autobuild-run: add support for --branch option

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
 scripts/autobuild-run | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
scripts/autobuild-run +10 -1
index 337644f..ceb9daf 100755
@@ -207,7 +207,7 @@ class SystemInfo:
 class Builder:
     def __init__(self, instance, njobs, sysinfo,
                  http_url, http_login, http_password,
-                 submitter, make_opts, nice, toolchains_csv,
+                 submitter, make_opts, branch, nice, toolchains_csv,
                  repo, upload, buildpid, debug):
         self.instance = instance
         self.njobs = njobs
@@ -217,6 +217,7 @@ class Builder:
         self.http_password = http_password
         self.submitter = submitter
         self.make_opts = make_opts
+        self.branch = branch
         self.nice = nice
         self.toolchains_csv = toolchains_csv
         self.repo = repo
@@ -264,6 +265,8 @@ class Builder:
         list. This way, branches with a higher weight are more likely to
         be selected.
         """
+        if self.branch:
+            return self.branch
         csv_branches = []
         with urlopen_closing(urlparse.urljoin(self.http_url, 'branches')) as r:
             for l in r.readlines():
@@ -802,6 +805,11 @@ def main():
                         help="string of extra options to pass to Buildroot "
                              "make, such as specific command wrappers",
                         type=str)
+    parser.add_argument("--branch",
+                        help="Restrict builds to a specific branch. "
+                             "Useful for situations where it only makes sense "
+                             "to run tests on a specific branch.",
+                        type=str)
     parser.add_argument("--pid-file",
                         help="path to a file where to store the PID",
                         type=pathlib.Path, default=pathlib.Path("/tmp/buildroot-autobuild.pid"))
@@ -890,6 +898,7 @@ def main():
             http_password = args.http_password,
             submitter = args.submitter,
             make_opts = (args.make_opts or ''),
+            branch = args.branch,
             nice = (args.nice or 0),
             toolchains_csv = args.toolchains_csv,
             repo = args.repo,
Signature · 6 lines
2.25.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 9 lines · On Tue, 7 Jun 2022 17:12:11 -0600 James Hilliard <[email protected]>…

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
 scripts/autobuild-run | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

We looked at this with Arnout, and we don't really see what this would be needed, and actually it could be annoying to have people test "random" branches. If you need extensions to genrandconfig, then the autobuild-run script should be backward compatible with older versions of genrandconfig to be able to support older branches for a certain while.

Thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 14 lines · Thomas Petazzoni
Quoted 9 lines · On Tue, 7 Jun 2022 17:12:11 -0600 James Hilliard <[email protected]>…

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
 scripts/autobuild-run | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Quoted 6 lines

We looked at this with Arnout, and we don't really see what this would be needed, and actually it could be annoying to have people test "random" branches. If you need extensions to genrandconfig, then the autobuild-run script should be backward compatible with older versions of genrandconfig to be able to support older branches for a certain while.

There are a number of other reasons this is useful, for example some build hosts(for example my asahi-linux build host) have compatibility issues in older branches so it doesn't make sense to run autobuilders on anything other than say master.

To prevent testing of unwanted branches I could modify this to restrict the branch override to only allow selecting the branches listed in:
http://autobuild.buildroot.org/branches

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
Quoted 23 lines · James Hilliard
Quoted 14 lines · Thomas Petazzoni
Quoted 9 lines · On Tue, 7 Jun 2022 17:12:11 -0600 James Hilliard <[email protected]>…

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
  scripts/autobuild-run | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)
Quoted 6 lines

We looked at this with Arnout, and we don't really see what this would be needed, and actually it could be annoying to have people test "random" branches. If you need extensions to genrandconfig, then the autobuild-run script should be backward compatible with older versions of genrandconfig to be able to support older branches for a certain while.

Quoted 3 lines

There are a number of other reasons this is useful, for example some build hosts(for example my asahi-linux build host) have compatibility issues in older branches so it doesn't make sense to run autobuilders

If there are compatibility issues, the fixes should be backported to the
stable branches...

Regards,
Arnout

Quoted 14 lines

on anything other than say master.

To prevent testing of unwanted branches I could modify this to restrict the branch override to only allow selecting the branches listed in:
http://autobuild.buildroot.org/branches

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw
Quoted 27 lines · Arnout Vandecappelle
Quoted 23 lines · James Hilliard
Quoted 20 lines · Thomas Petazzoni
Quoted 9 lines · On Tue, 7 Jun 2022 17:12:11 -0600 James Hilliard <[email protected]>…

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
  scripts/autobuild-run | 11 ++++++++++-
  1 file changed, 10 insertions(+), 1 deletion(-)

We looked at this with Arnout, and we don't really see what this would be needed, and actually it could be annoying to have people test "random" branches. If you need extensions to genrandconfig, then the autobuild-run script should be backward compatible with older versions of genrandconfig to be able to support older branches for a certain while.

Quoted 6 lines
Quoted 3 lines

There are a number of other reasons this is useful, for example some build hosts(for example my asahi-linux build host) have compatibility issues in older branches so it doesn't make sense to run autobuilders

If there are compatibility issues, the fixes should be backported to the
stable branches...

Some of the changes would be rather difficult to backport, for example the 2022.02.x branch doesn't have support for --no-toolchains-csv which is effectively required for supporting non-x86_64 autobuilders as we obviously can't use prebuilt toolchains that only run on x86_64 hosts on an aarch64 host.

There are many fixes related to various --no-toolchains-csv build failures that would also need to be backported as well if even feasible.

Quoted 18 lines

Regards,
Arnout

Quoted 14 lines

on anything other than say master.

To prevent testing of unwanted branches I could modify this to restrict the branch override to only allow selecting the branches listed in:
http://autobuild.buildroot.org/branches

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
Quoted 35 lines · James Hilliard
Quoted 27 lines · Arnout Vandecappelle
Quoted 23 lines · James Hilliard
Quoted 20 lines · Thomas Petazzoni
Quoted 9 lines · On Tue, 7 Jun 2022 17:12:11 -0600 James Hilliard <[email protected]>…

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
   scripts/autobuild-run | 11 ++++++++++-
   1 file changed, 10 insertions(+), 1 deletion(-)

We looked at this with Arnout, and we don't really see what this would be needed, and actually it could be annoying to have people test "random" branches. If you need extensions to genrandconfig, then the autobuild-run script should be backward compatible with older versions of genrandconfig to be able to support older branches for a certain while.

Quoted 6 lines
Quoted 3 lines

There are a number of other reasons this is useful, for example some build hosts(for example my asahi-linux build host) have compatibility issues in older branches so it doesn't make sense to run autobuilders

If there are compatibility issues, the fixes should be backported to the
stable branches...

Quoted 8 lines

Some of the changes would be rather difficult to backport, for example the 2022.02.x branch doesn't have support for --no-toolchains-csv which is effectively required for supporting non-x86_64 autobuilders as we obviously can't use prebuilt toolchains that only run on x86_64 hosts on an aarch64 host.

There are many fixes related to various --no-toolchains-csv build failures that would also need to be backported as well if even feasible.

Even so, I'm much more inclined to rewrite the autobuild-run logic to
dynamically test which options genrandconfig can take and adapt accordingly. That way you don't have to manually maintain those branches and update them on each autobuilder instance.

Regards,
Arnout

Quoted 12 lines
Quoted 12 lines

Regards,
Arnout

Quoted 7 lines

on anything other than say master.

To prevent testing of unwanted branches I could modify this to restrict the branch override to only allow selecting the branches listed in:
http://autobuild.buildroot.org/branches

Quoted 1 line
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
Quoted 45 lines · Arnout Vandecappelle
Quoted 41 lines · James Hilliard
Quoted 27 lines · Arnout Vandecappelle
Quoted 23 lines · James Hilliard
Quoted 20 lines · Thomas Petazzoni
Quoted 9 lines · On Tue, 7 Jun 2022 17:12:11 -0600 James Hilliard <[email protected]>…

In some cases it only makes sense to run tests against a specific branch, such as when testing new genrandconfig flags.

Add a config option to override the branch selection.

---
   scripts/autobuild-run | 11 ++++++++++-
   1 file changed, 10 insertions(+), 1 deletion(-)

We looked at this with Arnout, and we don't really see what this would be needed, and actually it could be annoying to have people test "random" branches. If you need extensions to genrandconfig, then the autobuild-run script should be backward compatible with older versions of genrandconfig to be able to support older branches for a certain while.

Quoted 6 lines
Quoted 3 lines

There are a number of other reasons this is useful, for example some build hosts(for example my asahi-linux build host) have compatibility issues in older branches so it doesn't make sense to run autobuilders

If there are compatibility issues, the fixes should be backported to the
stable branches...

Some of the changes would be rather difficult to backport, for example the 2022.02.x branch doesn't have support for --no-toolchains-csv which is effectively required for supporting non-x86_64 autobuilders as we obviously can't use prebuilt toolchains that only run on x86_64 hosts on an aarch64 host.

Quoted 5 lines
Quoted 2 lines

There are many fixes related to various --no-toolchains-csv build failures that would also need to be backported as well if even feasible.

Even so, I'm much more inclined to rewrite the autobuild-run logic to
dynamically test which options genrandconfig can take and adapt accordingly.

The genrandconfig issue is only one of a number of issues that I've seen come up,
there's been a rather long tail of lingering aarch64 compatibility issues that sometimes
require major package updates. For example some systemd fixes for aarch64 build hosts aren't really feasible to backport due to requiring major refactoring.

What we probably eventually want is the ability to identify issues as build host environment specific by rerunning failed builds on different hosts automatically,
but that would probably require some infrastructure changes.

Quoted 2 lines

That way you don't have to manually maintain those branches and update them on each autobuilder instance.

I'm pretty much just using this to restrict my autobuilders to master branch when there
are known compatibility issues with older branches for a particular host configuration.

Quoted 23 lines

Regards,
Arnout

Quoted 19 lines
Quoted 19 lines

Regards,
Arnout

Quoted 14 lines

on anything other than say master.

To prevent testing of unwanted branches I could modify this to restrict the branch override to only allow selecting the branches listed in:
http://autobuild.buildroot.org/branches

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#7 lore raw
Quoted 5 lines · James Hilliard
Quoted 4 lines · Arnout Vandecappelle

On 09/02/2023 21:32, James Hilliard wrote:

[snip]

Quoted 6 lines
Quoted 5 lines
Quoted 2 lines

There are many fixes related to various --no-toolchains-csv build failures that would also need to be backported as well if even feasible.

Even so, I'm much more inclined to rewrite the autobuild-run logic to
dynamically test which options genrandconfig can take and adapt accordingly.

Quoted 6 lines

The genrandconfig issue is only one of a number of issues that I've seen come up,
there's been a rather long tail of lingering aarch64 compatibility issues that sometimes
require major package updates. For example some systemd fixes for aarch64 build hosts aren't really feasible to backport due to requiring major refactoring.

If aarch64 build hosts are broken on the stable branches, that should be
fixed, right? At the very least adding BR2_HOSTARCH dependencies...

Anyway, with 2022.02 EOL in a bit more than a month, it probably doesn't
matter any more...

Regards,
Arnout

Quoted 5 lines

What we probably eventually want is the ability to identify issues as build host environment specific by rerunning failed builds on different hosts automatically,
but that would probably require some infrastructure changes.

Quoted 31 lines
Quoted 2 lines

That way you don't have to manually maintain those branches and update them on each autobuilder instance.

I'm pretty much just using this to restrict my autobuilders to master branch when there
are known compatibility issues with older branches for a particular host configuration.

Quoted 23 lines

Regards,
Arnout

Quoted 19 lines
Quoted 19 lines

Regards,
Arnout

Quoted 14 lines

on anything other than say master.

To prevent testing of unwanted branches I could modify this to restrict the branch override to only allow selecting the branches listed in:
http://autobuild.buildroot.org/branches

Quoted 8 lines

Thanks!

Thomas
--
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot