Skip to main content
← Back to list
01Issue
BugIn ProgressSwamp CLIPublic
Assigneesstack72

Relationships

#3817 swamp update suggests sudo for a binary in ~/.local/bin, and following it breaks every later update

Opened by kagarmoe · 10/23/2026

Description

When swamp update can't write its binary, it tells you to use sudo, even when the binary lives in the user's home directory (~/.local/bin/swamp). Following that advice leaves a root-owned binary in a user-owned directory, and every later non-sudo swamp update fails the same way. So the hint causes the problem it then reports.

Observed on macOS (Apple Silicon), updating 20261022.200604.0 → 20261022.211048.0:

Error: Cannot update /Users/[REDACTED]/.local/bin/swamp: permission denied. Re-run with: sudo swamp update

State at the time:

  • ~/.local/bin/swamp was root:wheel, left by an earlier sudo swamp update.
  • ~/.local/bin itself was owned by the user.

Steps to reproduce

  1. Install swamp to ~/.local/bin/swamp as a normal user.
  2. Run sudo swamp update once. The binary is now root-owned.
  3. After the next release, run swamp update as the user → the permission-denied error and sudo hint above.

(I couldn't force a fresh repro today because swamp update has no option to reinstall the current version.)

Workaround

Because the directory is user-writable, a rename works without sudo:

cd ~/.local/bin && cp swamp swamp.new && mv -f swamp.new swamp

Expected

  • Replace by rename: swamp update should write the new binary next to the old one and rename() it into place. That needs write access to the directory, not the file, so it works here, and it's also atomic.
  • Better hint: when the binary is under $HOME, don't suggest sudo. Explain that the binary is owned by another user and how to fix the ownership.
  • Warn under sudo: consider warning when swamp update runs as root on a binary in a non-root user's home.

Environment

swamp 20261022.200604.0 → 20261022.211048.0, macOS 27

02Bog Flow
✓OPEN✓TRIAGED◉IN PROGRESS○SHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 1 MOREIMPLEMENTATION

In Progress

10/23/2026, 12:04:15 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack7210/23/2026, 11:53:56 AM

Sign in to post a ripple.