From 3feefc80ac3a24e0aba9d3730dd1fa4ea1bf121a Mon Sep 17 00:00:00 2001 From: Dmitry Kozlyuk Date: Tue, 26 Jan 2021 01:12:50 +0300 Subject: [PATCH] buildtools: use build directory for temporary files Use current build directory as base for temporary directories, so that all build files are isolated there. Fixes: e6e9730c7066 ("buildtools: support object file extraction for Windows") Signed-off-by: Dmitry Kozlyuk --- buildtools/gen-pmdinfo-cfile.py | 4 ++-- buildtools/meson.build | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildtools/gen-pmdinfo-cfile.py b/buildtools/gen-pmdinfo-cfile.py index c60ecd7f6a..a4e0801991 100644 --- a/buildtools/gen-pmdinfo-cfile.py +++ b/buildtools/gen-pmdinfo-cfile.py @@ -7,8 +7,8 @@ import subprocess import sys import tempfile -_, ar, archive, output, *pmdinfogen = sys.argv -with tempfile.TemporaryDirectory() as temp: +_, tmp_root, ar, archive, output, *pmdinfogen = sys.argv +with tempfile.TemporaryDirectory(dir=tmp_root) as temp: proc = subprocess.run( # Don't use "ar p", because its output is corrupted on Windows. [ar, "xv", os.path.abspath(archive)], stdout=subprocess.PIPE, check=True, cwd=temp diff --git a/buildtools/meson.build b/buildtools/meson.build index 0a2e91a7b9..9c9347457a 100644 --- a/buildtools/meson.build +++ b/buildtools/meson.build @@ -18,7 +18,7 @@ map_to_win_cmd = py3 + files('map_to_win.py') sphinx_wrapper = py3 + files('call-sphinx-build.py') # select library and object file format -pmdinfo = py3 + files('gen-pmdinfo-cfile.py') +pmdinfo = py3 + files('gen-pmdinfo-cfile.py') + [meson.current_build_dir()] pmdinfogen = py3 + files('pmdinfogen.py') if host_machine.system() == 'windows' if cc.get_id() == 'gcc' -- 2.20.1