Skip to content

Commit ccbe065

Browse files
committed
fix: use full qualified name for xlings install target
When deps are declared with bare short names (e.g. tinyhttps = "0.2.2"), the map key is just "tinyhttps" but xlings needs the full qualified name "mcpplibs.tinyhttps" to find the package in its index. Construct the fqname from (ns, shortName) for the install target.
1 parent 38fcd9e commit ccbe065

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/cli.cppm

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1257,10 +1257,13 @@ prepare_build(bool print_fingerprint,
12571257

12581258
auto installed = fetcher.install_path(ns, shortName, version);
12591259
if (!installed) {
1260-
mcpp::ui::info("Downloading", std::format("{} v{}", depName, version));
1261-
// install() target uses the map key (depName) which xlings
1262-
// knows how to resolve via its own index lookup.
1263-
std::vector<std::string> targets{ std::format("{}@{}", depName, version) };
1260+
// xlings resolves packages by the full qualified name (ns.shortName)
1261+
// as it appears in the index's name field. Use fqname, not the
1262+
// map key (which may be a bare short name for default-ns deps).
1263+
auto fqname = ns.empty() ? shortName
1264+
: std::format("{}.{}", ns, shortName);
1265+
mcpp::ui::info("Downloading", std::format("{} v{}", fqname, version));
1266+
std::vector<std::string> targets{ std::format("{}@{}", fqname, version) };
12641267
CliInstallProgress progress;
12651268
auto r = fetcher.install(targets, &progress);
12661269
if (!r) return std::unexpected(std::format(

0 commit comments

Comments
 (0)