python/build/autotools.py: dump config.log on configure error

For better error logs on CI.
This commit is contained in:
Max Kellermann 2021-08-13 18:52:00 +02:00
parent 70d0fbd715
commit d32ed194e8
1 changed files with 12 additions and 1 deletions

View File

@ -52,7 +52,18 @@ class AutotoolsProject(MakeProject):
'--enable-silent-rules',
] + self.configure_args
subprocess.check_call(configure, cwd=build, env=toolchain.env)
try:
subprocess.check_call(configure, cwd=build, env=toolchain.env)
except subprocess.CalledProcessError:
# dump config.log after a failed configure run
try:
with open(os.path.join(build, 'config.log')) as f:
sys.stdout.write(f.read())
except:
pass
# re-raise the exception
raise
return build
def _build(self, toolchain):