Skip to content

fix(update): make downloaded binaries executable (self-update apply on Unix)#452

Merged
githubrobbi merged 1 commit into
mainfrom
fix/self-update-chmod-executable
Jun 17, 2026
Merged

fix(update): make downloaded binaries executable (self-update apply on Unix)#452
githubrobbi merged 1 commit into
mainfrom
fix/self-update-chmod-executable

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

uffs --update apply fails on macOS/Linux with "smoke test failed for uffs; rolled back" — and it has never worked on Unix.

Root cause

Apply does backup → swap → smoke → commit, where the smoke test runs the just-swapped binary (<bin> --version, SMOKE_ARG) to prove it works before committing. But acquired binaries are written by the HTTP download (github::download_toFile::create) at the default 0644 — not executable. So uffs --version gets permission denied, smoke fails, and the whole apply rolls back.

It was masked until now: the earlier quiesce failure (daemon stop) aborted before the smoke phase ever ran. With no daemon to stop, apply reached smoke and exposed it. (just use is unaffected — its release tarball preserves +x.)

Fix

chmod 0755 on each staged binary immediately after its SHA-256 verifies, in the acquire loop. Unix-only; Windows ignores file mode (no-op const fn stub mirroring the signature so the ? call site compiles everywhere). Split into a make_executable helper with a unit test that seeds a 0644 file and asserts the exec bit is set.

Verification

  • Host + Windows-MSVC clippy clean; full pre-push gate green; uffs-update tests pass (46) incl. the new make_executable_sets_the_exec_bits.

Note: because the broken helper ships in every release so far (incl. 0.6.7), Unix users must just use (tarball) to update until a release carries this fix — after which uffs --update / apply work on macOS/Linux too.

🤖 Generated with Claude Code

…n Unix)

`uffs --update apply` failed on macOS/Linux with "smoke test failed for uffs;
rolled back": apply swaps each binary in, then runs `<bin> --version` to verify
it before committing — but acquired binaries were written by the HTTP download
at the default 0644 (not executable), so `uffs --version` got permission-denied
and the apply rolled back. (Previously masked by the quiesce failure that
aborted before smoke; with no daemon to stop, apply reached smoke and exposed
it. `just use` is unaffected — its tarball keeps +x.)

Fix: chmod the staged binary to 0755 right after its SHA-256 verifies, in the
acquire loop. Unix-only; Windows ignores file mode (no-op stub). `make_executable`
helper + unit test asserting a seeded-0644 file gains the exec bit.

Host + Windows-MSVC clippy clean; uffs-update tests pass (46).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi githubrobbi enabled auto-merge (squash) June 17, 2026 21:12
@githubrobbi githubrobbi merged commit 62031d7 into main Jun 17, 2026
21 checks passed
@githubrobbi githubrobbi deleted the fix/self-update-chmod-executable branch June 17, 2026 21:27
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.

1 participant