Skip to content

Commit

Permalink
Increase logging for Rust CI failures.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Jun 21, 2019
1 parent 2cabda8 commit d1dd6df
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions mesonbuild/compilers/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,18 @@ def sanity_check(self, work_dir, environment):
ofile.write('''fn main() {
}
''')
pc = subprocess.Popen(self.exelist + ['-o', output_name, source_name], cwd=work_dir)
pc.wait()
pc = subprocess.Popen(self.exelist + ['-o', output_name, source_name],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=work_dir)
stdo, stde = pc.communicate()
stdo = stdo.decode('utf-8', errors='replace')
stde = stde.decode('utf-8', errors='replace')
if pc.returncode != 0:
raise EnvironmentException('Rust compiler %s can not compile programs.' % self.name_string())
raise EnvironmentException('Rust compiler %s can not compile programs.\n%s\n%s' % (
self.name_string(),
stdo,
stde))
if self.is_cross:
if self.exe_wrapper is None:
# Can't check if the binaries run so we have to assume they do
Expand Down

0 comments on commit d1dd6df

Please sign in to comment.