Bug 1484915 - Throw instead of keep going if cbindgen fails. r=boris

I think this should do. This still prints out stderr when it fails pointing to
the solution, and doesn't fail the build.

Differential Revision: https://phabricator.services.mozilla.com/D15784

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2019-01-05 15:42:47 +00:00
Родитель 8115a1830e
Коммит cc3bfeef51
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -24,10 +24,10 @@ def generate(output, cbindgen_toml_path):
], env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
if p.returncode == 0:
output.write(stdout)
else:
print("cbindgen failed: %s" % stderr)
if p.returncode != 0:
raise TypeError("cbindgen failed: %s" % stderr)
output.write(stdout)
deps = set()
deps.add(CARGO_LOCK)
@ -35,4 +35,5 @@ def generate(output, cbindgen_toml_path):
for file in files:
if os.path.splitext(file)[1] == ".rs":
deps.add(mozpath.join(path, file))
return deps