Commit e0402d2
committed
feat(index): miss-triggered refresh — fetch once when a dep isn't local
Refine the offline-first gate per review: fully offline is too strict. Keep
the common case zero-network (dependency present in the local index), but
when a requested dependency is NOT in the local index, refresh once to fetch
it — instead of failing offline.
- Announce it: the build path now calls with quiet=false, printing
'Refreshing package index — `<pkg>` not found locally (one-time)' so a
rare one-time network pause doesn't look like a silent hang. Steady-state
builds (deps present) still print nothing.
- Guard against thrash: if the index was refreshed <120s ago and the package
is still missing, upstream genuinely lacks it — don't re-run the heavy
`xlings update` per missing package in one build.
src/xlings.cppm: rework ensure_official_package_index_fresh.
src/pm/package_fetcher.cppm: quiet=false at the call site.
docs: correct the '稳态不再联网' wording to 'present→offline, missing→refresh once'.1 parent 3162152 commit e0402d2
3 files changed
Lines changed: 38 additions & 13 deletions
File tree
- .agents/docs
- src
- pm
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
118 | | - | |
119 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
120 | 126 | | |
121 | 127 | | |
122 | 128 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
728 | 733 | | |
729 | | - | |
| 734 | + | |
730 | 735 | | |
731 | 736 | | |
732 | 737 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1248 | 1248 | | |
1249 | 1249 | | |
1250 | 1250 | | |
1251 | | - | |
1252 | | - | |
1253 | | - | |
1254 | | - | |
1255 | | - | |
1256 | | - | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
1257 | 1261 | | |
1258 | 1262 | | |
1259 | 1263 | | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
1260 | 1273 | | |
1261 | | - | |
1262 | | - | |
1263 | | - | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
1264 | 1278 | | |
1265 | 1279 | | |
1266 | 1280 | | |
0 commit comments