Skip to content

Commit

Permalink
Add a check for return codes of executor.run so that we propagate e…
Browse files Browse the repository at this point in the history
…rror codes correctly

PiperOrigin-RevId: 700518396
  • Loading branch information
nitins17 authored and Google-ML-Automation committed Nov 27, 2024
1 parent afcef67 commit c6866d0
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,11 @@ async def main():
else:
requirements_command.append("//build:requirements.update")

await executor.run(requirements_command.get_command_as_string(), args.dry_run)
sys.exit(0)
result = await executor.run(requirements_command.get_command_as_string(), args.dry_run)
if result.return_code != 0:
raise RuntimeError(f"Command failed with return code {result.return_code}")
else:
sys.exit(0)

wheel_cpus = {
"darwin_arm64": "arm64",
Expand Down Expand Up @@ -594,7 +597,11 @@ async def main():

wheel_build_command.append(f"--jaxlib_git_hash={git_hash}")

await executor.run(wheel_build_command.get_command_as_string(), args.dry_run)
result = await executor.run(wheel_build_command.get_command_as_string(), args.dry_run)
if result.return_code != 0:
raise RuntimeError(f"Command failed with return code {result.return_code}")
else:
sys.exit(0)


if __name__ == "__main__":
Expand Down

0 comments on commit c6866d0

Please sign in to comment.