diff --git a/mkosi/config.py b/mkosi/config.py index 9513b488c..100849507 100644 --- a/mkosi/config.py +++ b/mkosi/config.py @@ -5445,15 +5445,7 @@ def want_default_initrd(config: Config) -> bool: return Path("default") in config.initrds -def finalize_historydir(args: Args, output_dir: Optional[Path] = None) -> Path: - # When an output dir is given on the CLI, store the build history there so that concurrent builds with - # different output dirs don't clobber a shared history. Don't check the finalized OutputDirectory= - # config, only the CLI value: the former isn't known yet here (config files and includes are - # parsed later) and vm/boot can't see it anyway since they recover the config from the history instead of - # parsing it. An output dir set only in config files keeps the history in the config dir. - if output_dir is not None: - return output_dir / ".mkosi-private/history" - +def finalize_historydir(args: Args) -> Path: configdir = finalize_configdir(args.directory) return (configdir or Path.cwd()) / ".mkosi-private/history" @@ -5510,7 +5502,7 @@ def parse_config( return args, None, () configdir = finalize_configdir(args.directory) - historydir = finalize_historydir(args, context.cli.get("output_dir")) + historydir = finalize_historydir(args) if have_history(args, historydir): history = Config.from_partial_json((historydir / "latest.json").read_text()) diff --git a/tests/__init__.py b/tests/__init__.py index 440d90a7c..3e107a62e 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -126,13 +126,12 @@ def boot(self, options: Sequence[str] = (), args: Sequence[str] = ()) -> Complet "--register=no", "--machine", self.machine, - "--output-directory", self.output_dir, *options, ], args, stdin=sys.stdin if sys.stdin.isatty() else None, check=False, - ) # fmt: skip + ) if result.returncode != 123: raise subprocess.CalledProcessError(result.returncode, result.args, result.stdout, result.stderr) @@ -159,13 +158,12 @@ def vm( "--register=no", "--machine", self.machine, - "--output-directory", self.output_dir, *options, ], args, stdin=sys.stdin if sys.stdin.isatty() else None, check=False, - ) # fmt: skip + ) if result.returncode != 123: raise subprocess.CalledProcessError(result.returncode, result.args, result.stdout, result.stderr)