From: Daan De Meyer Date: Sat, 14 Feb 2026 12:36:48 +0000 (+0100) Subject: Revert "Use python3.12 as interpreter in CentOS Stream 9 zipapp" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=717020c97b1dc2163f28571cd35c8835bb5afe70;p=thirdparty%2Fmkosi.git Revert "Use python3.12 as interpreter in CentOS Stream 9 zipapp" This reverts commit d6ddc66acb05d3d761d3f600c6b029319db9ae95. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index ca3965bcb..f92ec1b5e 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -4206,7 +4206,7 @@ def run_box(args: Args, config: Config) -> None: with contextlib.ExitStack() as stack: if config.tools() != Path("/"): - path = stack.enter_context(tempfile.TemporaryDirectory(prefix="mkosi-path-")) + d = stack.enter_context(tempfile.TemporaryDirectory(prefix="mkosi-path-")) # We have to point zipapp to a directory containing the mkosi module and set the entrypoint # manually instead of directly at the mkosi package, otherwise we get ModuleNotFoundError when @@ -4218,17 +4218,15 @@ def run_box(args: Args, config: Config) -> None: resource_path(sys.modules[__package__ or __name__]) as module, ): copy_tree(module, Path(tmp) / module.name, sandbox=config.sandbox) - d, r = detect_distribution(config.tools()) - interpreter = "python3.12" if d == Distribution.centos and r == "9" else "python3" zipapp.create_archive( source=tmp, - target=Path(path) / "mkosi", + target=Path(d) / "mkosi", main="mkosi.__main__:main", - interpreter=f"/usr/bin/env {interpreter}", + interpreter="/usr/bin/env python3", ) - make_executable(Path(path) / "mkosi") - mounts += ["--ro-bind", path, "/mkosi"] + make_executable(Path(d) / "mkosi") + mounts += ["--ro-bind", d, "/mkosi"] stack.enter_context(scopedenv({"PATH": f"/mkosi:{os.environ['PATH']}"})) run( diff --git a/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf b/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf index 64f8fd041..47a5551a3 100644 --- a/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf +++ b/mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf @@ -13,4 +13,3 @@ Repositories=epel Packages= dnf dnf-plugins-core - python3.12