Skip to content

fix(daemon): treat a Nix wrapper and its binary as one install - #435

Merged
devmobasa merged 1 commit into
mainfrom
fix/nix-wrapper-binary-conflict
Nov 3, 2026
Merged

devmobasa merged 1 commit into
mainfrom
fix/nix-wrapper-binary-conflict

Conversation

@devmobasa

Copy link
Copy Markdown
Owner

Summary

On Nix installs, the daemon logs this warning at every start:

Another wayscriber binary exists besides this daemon (/nix/store/…-wayscriber-0.9.29/bin/.wayscriber-wrapped). Overlay spawn follows this process file; inspecting a different path with --version or --about can disagree. Other copies: /nix/store/…-wayscriber-0.9.29/bin/wayscriber

Both paths belong to one install. wrapGAppsHook4 runs wrapProgram, which
moves the binary to bin/.wayscriber-wrapped and installs a wrapper under the
original name that execs it. The daemon's current_exe() is the moved file,
and PATH finds the wrapper, so the check counted them as two copies.

Changes

src/daemon/binary_conflict.rs now skips a candidate only when it is the
wrapper of the running binary. Both files must be in the same directory, and
the running file must be named .<candidate>-wrapped, plus any _ added by
further wraps. A wrapper from another build and system copies such as
/usr/bin/wayscriber are still reported.

New tests cover:

  • a wrapper and its binary
  • a profile symlink to the wrapper
  • a twice-wrapped binary
  • another Nix build and a system copy, which are still reported
  • a hidden binary with another name, which does not claim the wrapper

Validation

  • cargo test -p wayscriber --lib daemon::binary_conflict: the new tests fail
    without the change and pass with it.
  • ./tools/lint-and-test.sh passes.

PR #433 made the matching change in the process broker, which also has to
accept .wayscriber-wrapped when Wayscriber relaunches itself.

On Nix, wrapGAppsHook4 runs wrapProgram, which moves the binary to
`bin/.wayscriber-wrapped` and installs a wrapper under the original name
that execs it. The daemon's current_exe is the moved file and PATH finds
the wrapper, so every Nix daemon warned that "another wayscriber binary
exists" about its own install.

Skip a candidate only when it is the wrapper of the running binary: the
same directory, with the running file named `.<candidate>-wrapped` plus
any `_` that further wraps append. Another build's wrapper and system
copies are still reported.
@devmobasa
devmobasa merged commit 4414d05 into main Nov 3, 2026
5 checks passed
@devmobasa
devmobasa deleted the fix/nix-wrapper-binary-conflict branch November 4, 2026 06:14
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