hatch icon indicating copy to clipboard operation
hatch copied to clipboard

`hatch build` fails with no indication as to why

Open Aran-Fey opened this issue 3 months ago • 9 comments

Running hatch build crashes with status code 103, but there's no output indicating what the problem is and I also can't find any documentation about what exit code 103 means.

Aran-Fey@desktop-1bkul1e /d/U/A/D/f/c/p/rio (main)> py -m hatch --verbose build -t wheel
──────────────────────────────────────────── wheel ────────────────────────────────────────────
Aran-Fey@desktop-1bkul1e /d/U/A/D/f/c/p/rio (main) [103]>

How on earth am I supposed to debug this??

Aran-Fey avatar Sep 25 '25 13:09 Aran-Fey

Can you provide more information, what OS are you running from? Do you see the same when running hatch from the binary rather than as a python module? Can you try running py -m hatch -vvv build and providing the output from that

cjames23 avatar Sep 27 '25 20:09 cjames23

I'm on Windows 11. Using the binary makes no difference. -vvv also doesn't make a difference.

That said, I can successfully build a wheel via uv build.

Aran-Fey avatar Sep 28 '25 13:09 Aran-Fey

Also, to be clear, I'm not asking for help debugging my specific issue. I'm asking for more useful stderr output and/or documentation about exit codes.

Aran-Fey avatar Sep 28 '25 13:09 Aran-Fey

The goal is not to help you debug but to get some form of minimal reproducible example from which to start to determine why there is not enough output in stderr, as I cannot reproduce this locally. I get the correct outputs and level of verbosity.

cjames23 avatar Sep 28 '25 19:09 cjames23

I had the same issue with a project set up to use "hatch build -t pyinstaller" that suddenly stopped working

(.venv) λ hatch build -t pyinstaller ───────────────────────────────────────────────────────────────────────── pyinstaller ──────────────────────────────────────────────────────────────────────────

and then nothing. After debugging for the afternoon, I discovered the problem was a '-' in the [project] of pyproject.toml

[project] name = "My-App" <<< this breaks the build

Updating to a name without a "-" makes the build work again. [project] name = "MyApp"

How is there any exit w/o an error!?

all-your-bases avatar Sep 30 '25 19:09 all-your-bases

There is indeed a "-" character in my project's name as well. Can't wait to find out why that causes an issue.

Aran-Fey avatar Sep 30 '25 20:09 Aran-Fey

Does your package root folder name also contain a hyphen?

cjames23 avatar Oct 03 '25 23:10 cjames23

Yes

Aran-Fey avatar Oct 04 '25 05:10 Aran-Fey

I'm asking for more useful stderr output and/or documentation about exit codes.

💯 I've encountered this situation many times in various scenarios (not exclusive to hatch build). Whatever I asked hatch to do, when it exits with non-zero exit code then -vvv did not provide any extra output whatsoever. If you are lucky then the problem produces a traceback, like with the click situation few weeks ago but that is rare.

axel-kah avatar Oct 08 '25 11:10 axel-kah