Repository navigation
fix(daemon): treat a Nix wrapper and its binary as one install - #435
Merged
Merged
Conversation
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.
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.
Summary
On Nix installs, the daemon logs this warning at every start:
Both paths belong to one install.
wrapGAppsHook4runswrapProgram, whichmoves the binary to
bin/.wayscriber-wrappedand installs a wrapper under theoriginal name that execs it. The daemon's
current_exe()is the moved file,and
PATHfinds the wrapper, so the check counted them as two copies.Changes
src/daemon/binary_conflict.rsnow skips a candidate only when it is thewrapper of the running binary. Both files must be in the same directory, and
the running file must be named
.<candidate>-wrapped, plus any_added byfurther wraps. A wrapper from another build and system copies such as
/usr/bin/wayscriberare still reported.New tests cover:
Validation
cargo test -p wayscriber --lib daemon::binary_conflict: the new tests failwithout the change and pass with it.
./tools/lint-and-test.shpasses.PR #433 made the matching change in the process broker, which also has to
accept
.wayscriber-wrappedwhen Wayscriber relaunches itself.