From: Daan De Meyer Date: Wed, 24 Jan 2024 08:58:26 +0000 (+0100) Subject: Use a subdirectory of the workspace as TMPDIR X-Git-Tag: v21~90^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d94ae85d858b332961283de504525587c1f6feb4;p=thirdparty%2Fmkosi.git Use a subdirectory of the workspace as TMPDIR Let's properly distinguish temporary files from workspace files by putting the temporary files in a subdirectory of the workspace. --- diff --git a/mkosi/__init__.py b/mkosi/__init__.py index 6c64610b7..21f09a86e 100644 --- a/mkosi/__init__.py +++ b/mkosi/__init__.py @@ -2844,8 +2844,9 @@ def setup_workspace(args: Args, config: Config) -> Iterator[Path]: options=["--bind", config.workspace_dir_or_default(), config.workspace_dir_or_default()], ) stack.callback(lambda: rmtree(workspace, sandbox=sandbox)) + (workspace / "tmp").mkdir(mode=0o1777) - with scopedenv({"TMPDIR" : os.fspath(workspace)}): + with scopedenv({"TMPDIR" : os.fspath(workspace / "tmp")}): try: yield Path(workspace) except BaseException: