Add '--max-retry-times' option for gbs build. sandbox/xuwc/max_retry_times
authorwanchao.xu <wanchao.xu@samsung.com>
Thu, 21 Nov 2024 07:16:14 +0000 (15:16 +0800)
committerwanchao.xu <wanchao.xu@samsung.com>
Tue, 10 Dec 2024 02:49:16 +0000 (10:49 +0800)
Change-Id: I8f4347b95ce3fe50c14d68d47aca26987aef474c
Signed-off-by: wanchao.xu <wanchao.xu@samsung.com>
gitbuildsys/cmd_build.py
tools/gbs

index ae10dd67d5e89b81ad2a1ee0ac1c9e29ad9005e3..f2cd061c40fb61f0bae323302b128afff74806f5 100644 (file)
@@ -317,6 +317,7 @@ def prepare_depanneur_opts(args):
         if not args.threads < loopdev:
             raise GbsError('When using the kvm, loop device should be larger than the threads option.')
     cmd_opts += ['--packaging-dir=%s' % get_packaging_dir(args)]
+    cmd_opts += ['--max-retry-times=%d' % args.max_retry_times]
 
     return cmd_opts
 
index 5ef1f5fcd7da19654a15be8b21a9de8185732fff..51bbc14284eb3ea1031ad1d65a4c6818f7ba9ccd 100755 (executable)
--- a/tools/gbs
+++ b/tools/gbs
@@ -250,6 +250,8 @@ def build_parser(parser):
     group.add_argument('--deps-build', action='store_true',
                         help='Download packages depends on local package from gbs.conf, and do build')
     group.add_argument('--snapshot', type=str, help='Specify snapshot id to use')
+    group.add_argument('--max-retry-times', type=int, default=3,
+                        help='maximum times to rebuild if the build can be built successfully')
 
     group = parser.add_argument_group('speed up building options')
     group.add_argument('--incremental', action='store_true',