diff --git a/uv/private/sdist_build/build_helper.py b/uv/private/sdist_build/build_helper.py index d92c0cae..a6449006 100644 --- a/uv/private/sdist_build/build_helper.py +++ b/uv/private/sdist_build/build_helper.py @@ -4,7 +4,7 @@ import shutil import sys from os import getenv, listdir, path -from subprocess import call +from subprocess import check_call # Under Bazel, the source dir of a sdist to build is immutable. `build` and # other tools however are constitutionally incapable of not writing to the @@ -29,12 +29,17 @@ outdir = path.abspath(opts.outdir) -call([ - sys.executable, - "-m", "build", - "--wheel", - "--no-isolation", - "--outdir", outdir, -], cwd=t) - -print(listdir(outdir), file=sys.stderr) +try: + check_call([ + sys.executable, + "-m", "build", + "--wheel", + "--no-isolation", + "--outdir", outdir, + ], cwd=t) +finally: + print(listdir(outdir), file=sys.stderr) + +if not listdir(outdir): + print("Failed to build!", file=sys.stderr) + exit(1)