]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Revert "Use python3.12 as interpreter in CentOS Stream 9 zipapp"
authorDaan De Meyer <daan@amutable.com>
Sat, 14 Feb 2026 12:36:48 +0000 (13:36 +0100)
committerDaan De Meyer <daan@amutable.com>
Sat, 14 Feb 2026 12:36:48 +0000 (13:36 +0100)
This reverts commit d6ddc66acb05d3d761d3f600c6b029319db9ae95.

mkosi/__init__.py
mkosi/resources/mkosi-tools/mkosi.conf.d/centos/mkosi.conf

index ca3965bcb5a468c4061129acc86591df4067acc6..f92ec1b5ec8294178cee07b4f0152bfbd6d483a9 100644 (file)
@@ -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(
index 64f8fd041ca6b3c3a23fa5bb252aae6b24bce697..47a5551a38f96984094f5cb27931b8f536a6a113 100644 (file)
@@ -13,4 +13,3 @@ Repositories=epel
 Packages=
         dnf
         dnf-plugins-core
-        python3.12