Repository navigation
fix(export): keep zips written to --zip-dest-dir out of backend.zip - #8042
Conversation
When --zip-dest-dir points inside the app, backend.zip archived the frontend.zip just written there, and on a second export it archived itself while being written, growing until the disk filled up. Exclude the zips in zip_dest_dir as well as the ones in the app directory, and create zip_dest_dir when it is missing instead of crashing. The .web/backend files added by glob were checked by name against a set of paths, which never matched, so they get the same identity check as the rest of the walk.
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; no actionable issues remain. SummaryKeeps archives written to
No new actionable issues found. The previously reported helper docstring is now present. Tests were not run during this review. Reviews (4) · Last reviewed commit: "Check for an empty exclusion set inside ..." · Reviewed by Greptile |
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
View guided diff | Re-trigger cubic
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
Also document the test helper that builds the exportable app.
The directory walk skipped the identity stat when nothing was excluded, but the .web/backend glob did not. Move the check into the helper so all three callers behave the same.
All Submissions:
Type of change
Changes To Core Features:
Description
Exporting to a folder inside the app puts
frontend.zipinbackend.zip, and a second export there makesbackend.ziparchive itself:I stopped the second export after 20 s, at 525 MB. It keeps going until the disk is full. Without the
mkdir, the export fails at the end with aFileNotFoundErrorfordist/frontend.zip. 0.11.0 behaves the same.zip_apponly left out the zips in the current directory. It now also leaves out the ones inzip_dest_dir, by file identity like the rest of the walk, and creates that folder if it's missing. The.web/backendfiles were checked by name against a set of paths, which never matched, so they get the same check, and--exclude-from-backendnow works for them.I didn't skip every zip in the app: old zips in
dist/still go into an export toout/, like any other file.Without the fix, 7 of the new test cases fail. A plain
reflex exportwrites byte-identical zips with and without it.