From b5caddc404dc5076febb88853e4985b5b285dd4c Mon Sep 17 00:00:00 2001 From: William Douglas Date: Mon, 22 Jul 2024 16:15:37 -0700 Subject: [PATCH] Add options flag for avoiding full rebuilds Add an options.conf flag for allowing builds to use mock's --short-circuit for reducing rebuild time. This change moves the feature from default enabling with no way to turn off to default disable with a configure to turn on. Signed-off-by: William Douglas --- autospec/build.py | 2 +- autospec/config.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/autospec/build.py b/autospec/build.py index 67db5aa..6ca5e16 100644 --- a/autospec/build.py +++ b/autospec/build.py @@ -285,7 +285,7 @@ class Build(object): mockopts, ] - if not cleanup and self.must_restart == 0 and self.file_restart > 0 and set(filemanager.excludes) == set(filemanager.manual_excludes): + if config.config_opts.get('avoid_rebuild') and not cleanup and self.must_restart == 0 and self.file_restart > 0 and set(filemanager.excludes) == set(filemanager.manual_excludes): cmd_args.append("--no-clean") cmd_args.append("--short-circuit=binary") diff --git a/autospec/config.py b/autospec/config.py index ad86eda..2962c47 100644 --- a/autospec/config.py +++ b/autospec/config.py @@ -157,6 +157,7 @@ class Config(object): } self.config_opts = {} self.config_options = { + "avoid_rebuild": "Try to use mock short circuit to avoid full rebuilds", "broken_c++": "extend flags with '-std=gnu++98", "cargo_vendor": "create vendor archive with cargo", "use_lto": "configure build for lto",