Remove redundant check in `make_build`. NFC (#1746)
The code here seemed to be confused about `call` vs `check_call` When
manually checking the return code we use much use `call` rather than
`check_call` (the later will throw rather then return non-zero code).
With `call` the only exception that can be thrown would be if the
executable (cmake) is not found, but `find_cmake` would already have
hard-exited above if it was not found.
diff --git a/emsdk.py b/emsdk.py
index 8858ab9..5083785 100644
--- a/emsdk.py
+++ b/emsdk.py
@@ -962,17 +962,11 @@
make += ['--', '-j', str(CPU_CORES)]
# Build
- try:
- print('Running build: ' + str(make))
- ret = subprocess.check_call(make, cwd=build_root, env=build_env())
- if ret != 0:
- errlog(f'Build failed with exit code {ret}!')
- errlog('Working directory: ' + build_root)
- return False
- except Exception as e:
- errlog('Build failed due to exception!')
+ print('Running build: ' + str(make))
+ ret = subprocess.call(make, cwd=build_root, env=build_env())
+ if ret != 0:
+ errlog(f'Build failed with exit code {ret}!')
errlog('Working directory: ' + build_root)
- errlog(str(e))
return False
return True