Bug 1484915 - Throw instead of keep going if cbindgen fails. r=boris
authorEmilio Cobos Álvarez <emilio@crisal.io>
Sat, 05 Jan 2019 15:42:47 +0000
changeset 509743 599de612de7f822ef74d5ebc10c58942666585ef
parent 509742 61bc6ebb639b73924654f8399d38ef75ace23a1b
child 509744 e54046e15abef84a2cd6ec0fc4825a6cf15878ac
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersboris
bugs1484915
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
layout/style/GenerateServoStyleConsts.py
--- a/layout/style/GenerateServoStyleConsts.py
+++ b/layout/style/GenerateServoStyleConsts.py
@@ -19,20 +19,21 @@ def generate(output, cbindgen_toml_path)
         mozpath.join(buildconfig.topsrcdir, "toolkit", "library", "rust"),
         "--lockfile",
         CARGO_LOCK,
         "--crate",
         "style"
     ], 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)
     for path, dirs, files in os.walk(STYLE):
         for file in files:
             if os.path.splitext(file)[1] == ".rs":
                 deps.add(mozpath.join(path, file))
+
     return deps