Skip to content

Commit 421b149

Browse files
committed
fix: remove autoInstall=false copy fallback (round-8 cleanup)
The autoInstall=false branch was performing copy_xpkg_from_global recovery without a "this session's xlings install reported success" witness, falling outside the safety boundary established in round-7. Currently no caller passes autoInstall=false, so this is a no-op cleanup that removes a future foot-gun: anyone adding such a caller would inadvertently re-introduce the "half-extracted residue marked as complete" window. Semantic: when the caller explicitly disables auto-install, do not perform any implicit recovery — return "payload missing" so the caller (and the user) sees the truth instead of a silently-recovered possibly-broken package.
1 parent d5b631b commit 421b149

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

src/pm/package_fetcher.cppm

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -721,18 +721,13 @@ Fetcher::resolve_xpkg_path(std::string_view target,
721721
"{}\n hint: check network and retry, or `mcpp self init --force`",
722722
installError)});
723723
}
724-
} else {
725-
// autoInstall=false: still allow XLINGS_HOME-propagation copy
726-
// recovery (verdir is missing but a previous xlings install may
727-
// have populated the global location).
728-
bool copyOk = mcpp::fallback::copy_xpkg_from_global(verdir);
729-
if (copyOk && mcpp::fallback::looks_complete_legacy(verdir)) {
730-
mcpp::fallback::mark_install_complete(verdir);
731-
mcpp::log::verbose("fetcher", "resolved via copy fallback");
732-
return make_payload();
733-
}
734-
mcpp::fallback::clean_incomplete_install(verdir);
735724
}
725+
// No autoInstall fallback: when the caller explicitly disables
726+
// auto-install, do NOT perform any implicit recovery from the global
727+
// ~/.xlings/ location. Without "this session's xlings install
728+
// reported success" as a witness, we can't tell a complete legacy
729+
// package apart from interrupted residue, and silently marking the
730+
// latter as complete would mask the underlying problem.
736731

737732
// 4. All paths exhausted.
738733
return std::unexpected(CallError{

0 commit comments

Comments
 (0)