Repository navigation
Conversation
`install --skip-binary --yes` announced "Skipping binary placement" and then replaced a different binary already at the install target: the "A different binary already exists ... Replace it?" prompt set do_copy = true again after #1566 had gated do_copy on !skip_binary, and --yes answered that prompt. An externally managed binary (#1566/#2722), for which install promises to leave the binary and PATH untouched, took the same path. On macOS an existing target was also re-signed and republished under either flag. Skip the replace prompt and the macOS re-sign of an existing target whenever skip_binary is set (explicit or inferred), so a --skip-binary install that resets no index publishes nothing. Tests (cli suite), fake HOME whose ~/.local/bin already holds a different binary; each asserts the target byte-identical, the same file (inode unchanged) and nothing staged beside it: - cli_install_skip_binary_keeps_a_different_existing_binary - cli_install_managed_binary_keeps_a_different_existing_binary_issue2722 Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
4 tasks done
4 tasks done
This branch has not been deployed
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.
What
codebase-memory-mcp install --skip-binary --yesprinted "Skipping binary placement (--skip-binary); configuring agents only." and then, when a different binary already sat at the install target, asked "A different binary already exists at: ... Replace it with the binary you ran install from?".--yesanswered that prompt, so the file the flag promised to leave alone was replaced.The same happened when install infers an externally managed binary (mise, Homebrew, nix, asdf, cargo; #1566 / #2722): it says "Leaving it and your PATH untouched; configuring agents only." and then replaced an older copy in
~/.local/binthe same way. That path matters in practice: whenupdaterefuses to touch a managed binary, it tells the user to runinstall --skip-binary.On macOS there was a second way in: an existing target was always re-signed and republished (
sign_binary = do_copy || target_exists), even under--skip-binary.Why
#1566 (0e89ef8) gated the copy decision (
do_copy) on!skip_binary, but the "different binary" prompt further down can setdo_copy = trueagain, and the macOS signing step keys ontarget_existsalone. Both now respectskip_binary(explicit, or inferred for a managed binary). A--skip-binaryinstall that resets no index now publishes nothing, which is what the activation-scope change (013e1f7) already assumed when it stopped quiescing sessions for that case.Changes
src/cli/cli.c: skip the replace prompt whenskip_binaryis set, and skip the macOS re-sign/republish of an existing target in the same case.--force-binarystill places a copy as before.tests/test_cli.c(clisuite), two tests with a fake HOME whose~/.local/bin/codebase-memory-mcpalready holds a different file:cli_install_skip_binary_keeps_a_different_existing_binary:install --skip-binary --skip-config --yescli_install_managed_binary_keeps_a_different_existing_binary_issue2722: mise-shaped running-binary path,install --skip-config --yesEach asserts exit code 0, the target byte-identical, the same file (inode unchanged; a republish renames a new file into place even when the bytes match), and nothing staged beside it.
Verification (macOS arm64, ASan/UBSan test-runner)
y (auto),Installed binary -> ..., and fail on byte identity.cli,activation_transaction,agent_clientsandagent_profilesgive 488 passed, 1 skipped (Windows-only), 1 failed. The failure iscli_vscode_only_installs_copilot_durable_context, and it fails the same way on an unmodified main build on that machine: the test expects a "VS Code-only" host, and that machine has a Copilot CLI on PATH. It does not touch the code changed here.src/cli/cli.c, and the memory-core linter passes.Other placement paths checked
updatehas no--skip-binary. It refuses outright for an externally managed binary, and release builds hand off to the install script.install.sh/install.ps1callinstall -y --force --dir=..., so they are unaffected.scripts/smoke-test.shrunsinstall --skip-binary ... -yagainst a HOME whose~/.local/binholds a byte-identicalcpof the binary. Before this fix those runs re-copied that file. Now they leave it alone, and no smoke assertion depends on the copy.