[3/3] buildtools: use build subdirectory for temporary files
Checks
Commit Message
Use current build directory as base for temporary directories,
so that all build files are isolated there.
Fixes: caaca1ec6a8e ("buildtools: support object file extraction for Windows")
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
---
Thomas asked to send this as a follow-up before regression has been
noticed, may be squashed with commit mentioned above or applied on its own.
buildtools/gen-pmdinfo-cfile.py | 4 ++--
buildtools/meson.build | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
@@ -7,8 +7,8 @@
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
@@ -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'