Skip to content

Commit c6866d0

Browse files
nitins17Google-ML-Automation
authored andcommitted
Add a check for return codes of executor.run so that we propagate error codes correctly
PiperOrigin-RevId: 700518396
1 parent afcef67 commit c6866d0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

build/build.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,11 @@ async def main():
399399
else:
400400
requirements_command.append("//build:requirements.update")
401401

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

405408
wheel_cpus = {
406409
"darwin_arm64": "arm64",
@@ -594,7 +597,11 @@ async def main():
594597

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

597-
await executor.run(wheel_build_command.get_command_as_string(), args.dry_run)
600+
result = await executor.run(wheel_build_command.get_command_as_string(), args.dry_run)
601+
if result.return_code != 0:
602+
raise RuntimeError(f"Command failed with return code {result.return_code}")
603+
else:
604+
sys.exit(0)
598605

599606

600607
if __name__ == "__main__":

0 commit comments

Comments
 (0)