Repository navigation
fix(builder): copies from a read-only install stay writable - #1104
Merged
Merged
Conversation
make_game copied hot_funcs.txt, hot_order.txt, the profile, hookshot.res and work/image/chunks.txt from the tools folder with shutil.copy2, which takes the source's mode along. From a read-only install (the Linux AppImage unpacked into a Nix store on NixOS, or any packaged read-only tools folder) the copies were read-only, and lift.py then stopped with "PermissionError: ... image/chunks.txt"; every later build failed on the same file. copy_writable copies the bytes only and makes an existing read-only copy writable first. Tested on NixOS with the AppImage's tools in the Nix store: the build that failed before completes. tests/test_copy_writable.py checks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013mj4MgED5gai2jdByd6ztp
A second build of the same game folder stopped with PermissionError on hookshot.png: copy2 had made it read-only from a read-only install, and copy2 cannot overwrite it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #680, which was closed for a conflict with main: rebased onto current main, plus the window icon (below).
What
make_game.pycopiedhot_funcs.txt,hot_order.txt,hookshot_pieces.prof,hookshot.resandwork/image/chunks.txtfrom the tools folder withshutil.copy2, which takes the source's mode along. A newcopy_writable()copies the bytes only (also used for the window iconhookshot.png, whichcopy2copied into the game folder the same way), and first makes an existing read-only copy writable again (so a work folder broken by an earlier build recovers by itself).Why
From a read-only install the copies in the work folder were read-only too, and
lift.pythen stopped withon that build and every later one. The second build of a game folder stopped the same way on its read-only
hookshot.png:This happens with the Linux AppImage unpacked into the Nix store on NixOS (everything there is
r--r--r--), and would with any packaged read-only tools folder (a distro package, a Flatpak). Thefilecmpcheck before the copy compares contents, so copy2's timestamps were never needed.Tested
NixOS, the v2.0.1 / honest-eta AppImage's tools in the Nix store: the build that stopped at
lift.pybefore now completes, and the game runs. On v2.0.7 a rebuild of an existing game folder stopped athookshot.pngand completes with the change.tests/test_copy_writable.pycopies a read-only source over a read-only leftover and appends to the result aslift.pydoes (fails onmain, passes here);tests/run_all.pypicks it up; it also checks that the icon is no longer copied withcopy2.tests/test_make_game_cache.pystill passes.🤖 Generated with Claude Code