Skip to content

fix(builder): copies from a read-only install stay writable - #680

Closed
t0masz407 wants to merge 1 commit into
NotRexed:mainfrom
t0masz407:fix/builder-readonly-source
Closed

t0masz407 wants to merge 1 commit into
NotRexed:mainfrom
t0masz407:fix/builder-readonly-source

Conversation

@t0masz407

Copy link
Copy Markdown
Contributor

What

make_game.py copied hot_funcs.txt, hot_order.txt, hookshot_pieces.prof, hookshot.res and work/image/chunks.txt from the tools folder with shutil.copy2, which takes the source's mode along. A new copy_writable() copies the bytes only, 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.py then stopped with

PermissionError: [Errno 13] Permission denied: '/home/<user>/.cache/hookshot-builder/image/chunks.txt'

on that build and every later one. 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). The filecmp check 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.py before now completes, and the game runs. tests/test_copy_writable.py copies a read-only source over a read-only leftover and appends to the result as lift.py does (fails on main, passes here); wired into source-regressions.yml. tests/test_make_game_cache.py still passes.

🤖 Generated with Claude Code

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
@NotRexed

NotRexed commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Thanks! This conflicts with main now (nx2/make_game.py moved a lot); could you rebase it onto main?

@NotRexed

NotRexed commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Closing to keep the queue clear — please rebase on current main and reopen; thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants