duckinator / bork

A Python build and release management tool.
https://bork.readthedocs.io
MIT License
12 stars 2 forks source link

bork build fails on zipapps if `build/` doesn't already exist #338

Closed nbraud closed 9 months ago

nbraud commented 9 months ago

builder._prepare_zipapp attems to create a directory whose parent does not exist:

  File "/nix/store/fn114cqjyz8fcqa9n3agb1mw8nfbg82w-python3-3.11.5-env/lib/python3.11/site-packages/bork/api.py", line 33, in build
    builder.zipapp()
  File "/nix/store/fn114cqjyz8fcqa9n3agb1mw8nfbg82w-python3-3.11.5-env/lib/python3.11/site-packages/bork/builder.py", line 91, in zipapp
    _prepare_zipapp(dest, _bdist_file())
  File "/nix/store/fn114cqjyz8fcqa9n3agb1mw8nfbg82w-python3-3.11.5-env/lib/python3.11/site-packages/bork/builder.py", line 54, in _prepare_zipapp
    Path(dest).mkdir()
  File "/nix/store/ffll6glz3gwx342z0ch8wx30p5cnqz1z-python3-3.11.5/lib/python3.11/pathlib.py", line 1116, in mkdir
    os.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: 'build/zipapp'
duckinator commented 9 months ago

I believe there's a comment somewhere stating that the code assumes the wheel/bdist is built before the zipapp. This requirement should either be removed (if possible), or enforced.

duckinator commented 9 months ago

Poking at it a bit more, it looks like zipapps are made by installing the bdist into a specific directory, so the bdist being built first should be enforced.

duckinator commented 9 months ago

I misunderstood the context here — I didn't realize this was happening just from bork build. That's a bug, and I'm not sure how it's even possible given that Bork builds and releases itself. 🙃

duckinator commented 9 months ago

I'm not sure why this is only breaking now. As best I can tell, the relevant parts of the codebase haven't been touched in 2-4 years aside from a change I know did not cause this.

Either way, it's been fixed. 🤷‍♀️