From: Hyunggi Lee Date: Tue, 9 Mar 2021 05:53:30 +0000 (+0900) Subject: add --pkg-ccache option X-Git-Tag: accepted/tizen/devbase/tools/20210714.004937~1^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5a02afc85143d1c104a7287c820e9877911a3366;p=tools%2Fgbs.git add --pkg-ccache option 1. first build. create _ccache.tar $ gbs build -A armv7l --ccache after build is done _ccache.tar file will be created BUILD-ROOTS/scratch.armv7l.0/home/abuild/rpmbuild/OTHER/_ccache.tar backup _ccache.tar file to your storage 2. rebuild with _ccache.tar $ gbs build -A armv7l --pkg-ccache /path/to/_ccache.tar test build chromium-efl build env: laptop NT371B5M - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz - SAMSUNG MZNLN256 256G SSD first clean build gbs build -A armv7l --ccache build time: 29806s rebuild gbs build -A armv7l --ccache --overwrite --pkg-ccache ~/_ccache.tar build time: 3294s rebuild (with qemu-accel (ccache, ninja) gbs build -A armv7l --ccache --overwrite --pkg-ccache ~/_ccache.tar build time: 2209s Change-Id: I5df049e15eaa16a9859c8193a2b922f52406cd44 Signed-off-by: Hyunggi Lee --- diff --git a/gitbuildsys/cmd_build.py b/gitbuildsys/cmd_build.py index 4e89f95..d8e3f62 100644 --- a/gitbuildsys/cmd_build.py +++ b/gitbuildsys/cmd_build.py @@ -613,6 +613,9 @@ def prepare_depanneur_cmd(args, buildarch, profile, workdir): if args.ccache: cmd += ['--ccache'] + if args.pkg_ccache: + cmd += ['--pkg-ccache=%s' % args.pkg_ccache] + if args.extra_packs: cmd += ['--extra-packs=%s' % args.extra_packs] diff --git a/tools/gbs b/tools/gbs index 14d4119..99bea89 100755 --- a/tools/gbs +++ b/tools/gbs @@ -258,6 +258,9 @@ def build_parser(parser): help='working in offline mode. Start building directly') group.add_argument('--ccache', action="store_true", help='use ccache to speed up rebuilds') + group.add_argument('--pkg-ccache', + help='set ccache.tar file and enable ccache option ' + ', use ccache.tar file to speed up rebuilds') group.add_argument('--icecream', type=int, default=0, help='Use N parallel build jobs with icecream') group.add_argument('--threads', type=int, default=1,