Skip to content

Commit a6ccc99

Browse files
committed
fix: install_dir_candidates missing namespace-prefixed dirs for default ns
xlings creates package directories using the namespace as prefix (e.g. mcpplibs-x-mcpplibs.tinyhttps), not the index name. The install_dir_candidates function was only generating namespace-prefixed candidates for non-default namespaces, so packages in the default namespace (mcpplibs) were not found after xlings installation. Fix: generate <ns>-x-<fqname> and <ns>-x-<shortName> candidates for ALL namespaces, including the default.
1 parent 49c160e commit a6ccc99

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/pm/compat.cppm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,13 @@ inline std::vector<std::string> install_dir_candidates(std::string_view ns,
195195

196196
// ── Fallback candidates (COMPAT, remove in 1.0.0) ──────────────
197197

198-
// Namespace-prefixed dir without index
199-
// e.g. "compat-x-mbedtls" (new-style ns-aware layout)
200-
if (!ns.empty() && ns != mcpp::pm::kDefaultNamespace) {
201-
candidates.push_back(std::format("{}-x-{}", ns, shortName));
198+
// Namespace-prefixed dir (xlings uses namespace as prefix, not index name)
199+
// e.g. "compat-x-mbedtls", "mcpplibs-x-mcpplibs.tinyhttps"
200+
if (!ns.empty()) {
201+
candidates.push_back(std::format("{}-x-{}", ns, fqname));
202+
if (std::string(shortName) != fqname) {
203+
candidates.push_back(std::format("{}-x-{}", ns, shortName));
204+
}
202205
}
203206

204207
// Index-prefixed with bare short name

0 commit comments

Comments
 (0)