From: James Hilliard <james.hilliard1@gmail.com>
To: buildroot@buildroot.org
Cc: James Hilliard <james.hilliard1@gmail.com>
Subject: [Buildroot] [PATCH buildroot-test v2 1/1] scripts/autobuild-run: make hung build timeout configurable
Date: Sun, 17 Jul 2022 22:39:01 -0600 [thread overview]
Message-ID: <20220718043901.873466-1-james.hilliard1@gmail.com> (raw)
A reasonable value for this may vary depending on system load, specs
and how many parallel builds are being run, so we should make it
configurable.
Tweak LoadConfigFile parser to properly convert arg types.
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
Changes v1 -> v2:
- fix LoadConfigFile type conversion
---
scripts/autobuild-run | 26 ++++++++++++++------------
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/scripts/autobuild-run b/scripts/autobuild-run
index 337644f..e8530f9 100755
--- a/scripts/autobuild-run
+++ b/scripts/autobuild-run
@@ -120,9 +120,6 @@ else:
decode_bytes = _identity
encode_str = _identity
-# A number of packages can take > 60mins of build time (e.g
-# gst-ffmpeg, qt5webkit, mimic)
-HUNG_BUILD_TIMEOUT = 120 # mins
VERSION = 1
def rm_ro(f, p, _):
@@ -208,7 +205,7 @@ class Builder:
def __init__(self, instance, njobs, sysinfo,
http_url, http_login, http_password,
submitter, make_opts, nice, toolchains_csv,
- repo, upload, buildpid, debug):
+ repo, upload, buildpid, debug, hung_build_timeout):
self.instance = instance
self.njobs = njobs
self.sysinfo = sysinfo
@@ -223,6 +220,7 @@ class Builder:
self.upload = upload
self.buildpid = buildpid
self.debug = debug
+ self.hung_build_timeout = hung_build_timeout
self.build_parallel = False
# frequently needed directories
@@ -388,7 +386,7 @@ class Builder:
if os.path.exists(build_time_logfile):
mtime = datetime.datetime.fromtimestamp(os.stat(build_time_logfile).st_mtime)
- if mtime < datetime.datetime.now() - datetime.timedelta(minutes=HUNG_BUILD_TIMEOUT):
+ if mtime < datetime.datetime.now() - datetime.timedelta(minutes=self.hung_build_timeout):
if sub_proc.poll() is None:
monitor_thread_hung_build_flag.set() # Used by do_build() to determine build hang
log_write(self.log, "INFO: build hung")
@@ -756,12 +754,10 @@ class LoadConfigFile(argparse.Action):
config = configparser.RawConfigParser(allow_no_value=True)
config.read_file(values)
for k, v in config.items('main'):
- key = k.replace("-", "_")
- value = v
- if key.startswith("no_") and value is None:
- key = key[3:]
- value = False
- setattr(namespace, key, value)
+ args = ["--" + k]
+ if v:
+ args += [v]
+ parsed = parser.parse_args(args, namespace=namespace)
def main():
@@ -811,6 +807,11 @@ def main():
parser.add_argument("--debug", "-d",
help="Send log output to stdout instead of log file",
type=str)
+ parser.add_argument("--hung-build-timeout",
+ help="A number of packages can take > 60mins of build "
+ "time (e.g gst-ffmpeg, qt5webkit, mimic), sets "
+ "timeout in minutes",
+ type=int, default=120)
toolchains_csv = parser.add_mutually_exclusive_group(required=False)
toolchains_csv.add_argument("--toolchains-csv",
dest="toolchains_csv",
@@ -895,7 +896,8 @@ def main():
repo = args.repo,
upload = upload,
buildpid = buildpid,
- debug = args.debug)
+ debug = args.debug,
+ hung_build_timeout = args.hung_build_timeout)
p = multiprocessing.Process(target=builder.run_instance)
p.start()
processes.append(p)
--
2.34.1
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next reply other threads:[~2022-07-18 4:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-18 4:39 James Hilliard [this message]
2022-07-18 10:05 ` [Buildroot] [PATCH buildroot-test v2 1/1] scripts/autobuild-run: make hung build timeout configurable Thomas Petazzoni via buildroot
2022-07-18 20:11 ` James Hilliard
2024-07-14 13:27 ` Arnout Vandecappelle via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220718043901.873466-1-james.hilliard1@gmail.com \
--to=james.hilliard1@gmail.com \
--cc=buildroot@buildroot.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.