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

View File

@ -52,7 +52,18 @@ class AutotoolsProject(MakeProject):
'--enable-silent-rules', '--enable-silent-rules',
] + self.configure_args ] + self.configure_args
try:
subprocess.check_call(configure, cwd=build, env=toolchain.env) 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 return build
def _build(self, toolchain): def _build(self, toolchain):