Commit fabffe3
fix: route
The check probed `read_xpkg_lua(ns, shortName)` directly — the narrowest
lookup in the codebase — so it refused two classes of packages that resolve
perfectly well at build time:
* dotted selectors. `capi.lua` is a namespace path meaning
`(mcpplibs.capi, lua)`, then `(capi, lua)`; nothing in any index is
NAMED "capi.lua", because `package.name` is a single atomic segment
(SPEC-001 §3.2). The literal probe could never match one, and mcpp's own
mcpp.toml is written in that form.
* anything served by a project `[indices]` entry. The probe only ever read
the global registry, while dependency resolution dispatches across
local-path, project-clone and global transports.
That routing rule now lives in `mcpp.pm.index_route` and both callers go
through it, so `mcpp add` and `mcpp build` cannot drift apart again about
which packages are real. `[indices]` workspace inheritance likewise moves to
`mcpp.project` so the two readers share one copy.
The gate also only refuses when absence was PROVEN. A lazily-cloned git
index, or a namespace no readable index covers (xim descriptors declare no
`namespace` at all, so `(xim, nasm)` can never satisfy the identity gate),
now reports "unverified" instead of rejecting — the same fall-through
prepare already applies to lazy git indices.
Around that:
* refresh a stale registry once before refusing, and only when the
registry is the index that would have answered, so a package already on
disk costs zero network round-trips;
* report the identities tried plus a cross-namespace did-you-mean,
matching prepare's resolution error;
* warn — never fail — when the requested version isn't published for this
platform, listing what is. Version tables are per-OS, so "absent here"
is not "absent".
e2e 12 serves every package from a local `[indices] path`, so it covers the
dotted and project-index routes offline instead of depending on the state of
the shared registry, and drops its isolated MCPP_HOME, which would otherwise
force a full sandbox bootstrap (xlings, index fetch, patchelf, ninja) on a
test that is otherwise local file manipulation.
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>mcpp add's existence check through the real index resolution1 parent 5032fe6 commit fabffe3
6 files changed
Lines changed: 636 additions & 109 deletions
File tree
- src
- build
- pm
- tests
- e2e
- unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
694 | 695 | | |
695 | 696 | | |
696 | 697 | | |
697 | | - | |
698 | | - | |
699 | | - | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
711 | 702 | | |
712 | 703 | | |
713 | 704 | | |
| |||
730 | 721 | | |
731 | 722 | | |
732 | 723 | | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
| 724 | + | |
741 | 725 | | |
742 | 726 | | |
743 | 727 | | |
| |||
1455 | 1439 | | |
1456 | 1440 | | |
1457 | 1441 | | |
1458 | | - | |
1459 | | - | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
1460 | 1451 | | |
1461 | 1452 | | |
1462 | 1453 | | |
1463 | | - | |
1464 | | - | |
1465 | | - | |
1466 | | - | |
1467 | | - | |
1468 | | - | |
1469 | | - | |
1470 | | - | |
1471 | | - | |
1472 | | - | |
1473 | | - | |
1474 | | - | |
1475 | | - | |
1476 | | - | |
1477 | | - | |
1478 | | - | |
1479 | | - | |
| 1454 | + | |
1480 | 1455 | | |
1481 | 1456 | | |
1482 | 1457 | | |
| |||
1510 | 1485 | | |
1511 | 1486 | | |
1512 | 1487 | | |
1513 | | - | |
1514 | | - | |
1515 | | - | |
1516 | | - | |
1517 | | - | |
1518 | | - | |
1519 | | - | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
1523 | | - | |
1524 | | - | |
1525 | | - | |
| 1488 | + | |
1526 | 1489 | | |
1527 | 1490 | | |
1528 | 1491 | | |
| |||
1613 | 1576 | | |
1614 | 1577 | | |
1615 | 1578 | | |
1616 | | - | |
1617 | | - | |
1618 | | - | |
1619 | | - | |
1620 | | - | |
1621 | | - | |
1622 | | - | |
1623 | | - | |
| 1579 | + | |
| 1580 | + | |
| 1581 | + | |
| 1582 | + | |
1624 | 1583 | | |
1625 | 1584 | | |
1626 | 1585 | | |
| |||
1641 | 1600 | | |
1642 | 1601 | | |
1643 | 1602 | | |
1644 | | - | |
1645 | | - | |
1646 | | - | |
1647 | | - | |
1648 | | - | |
1649 | | - | |
1650 | | - | |
1651 | | - | |
1652 | | - | |
1653 | | - | |
1654 | | - | |
| 1603 | + | |
| 1604 | + | |
1655 | 1605 | | |
1656 | 1606 | | |
1657 | 1607 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | | - | |
| 10 | + | |
| 11 | + | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 17 | + | |
| 18 | + | |
21 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
24 | 28 | | |
25 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
26 | 72 | | |
27 | 73 | | |
28 | 74 | | |
| |||
71 | 117 | | |
72 | 118 | | |
73 | 119 | | |
74 | | - | |
75 | | - | |
76 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
77 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
78 | 144 | | |
79 | 145 | | |
80 | 146 | | |
81 | 147 | | |
82 | 148 | | |
83 | 149 | | |
84 | | - | |
85 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
86 | 193 | | |
87 | | - | |
| 194 | + | |
| 195 | + | |
88 | 196 | | |
89 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
90 | 205 | | |
91 | 206 | | |
92 | 207 | | |
| |||
0 commit comments