Commit 7f8d3e4
authored
fix:
Root cause: on a fresh MCPP_HOME, write_default_xlings_json seeds
.xlings.json with the hardcoded `"CN"` default, regardless of --mirror.
Then load_or_init's xlings sandbox bootstrap (ensure_init / patchelf /
ninja install) reads that mirror and downloads via CN. Only after the
bootstrap finishes does cmd_self_config invoke xlings::config_set_mirror
to update the file — too late: the user's --mirror choice never reached
the very network roundtrip they were trying to redirect.
For an overseas user the CN mirror is slow or unreachable, so the
"download" phase hangs.
Fix (~15 lines): plumb the user's mirror choice through to the seed.
- `config::write_default_xlings_json` grows `mirror_override` param.
- `config::load_or_init` grows `initial_mirror` param (default empty;
all existing callers unchanged). Passed straight through to
write_default_xlings_json, so when set it overrides the "CN" default
for the FRESH seed.
- `cmd_self_config` parses --mirror first, validates, then forwards it
as load_or_init's initial_mirror. The subsequent
xlings::config_set_mirror still runs (idempotent on fresh, required
for the already-initialized case where seed was skipped).
- TODO comment at seed_xlings_json's `"CN"` default about the long-term
direction (flip default to GLOBAL, or auto-detect).
For an already-initialized MCPP_HOME (`.xlings.json` already exists),
the seed is skipped — no behavior change there. config_set_mirror
handles that case as before.
Test: tests/e2e/46_self_config_mirror_no_bootstrap.sh asserts that
after a fresh `mcpp self config --mirror GLOBAL`, the seeded
.xlings.json has `mirror: GLOBAL` (not the default CN). Then
round-trips back to CN to exercise the post-init path.
Existing 38_self_config_mirror.sh still passes: it always calls
`mcpp self env` first, which doesn't pass an initial_mirror, so the
"default seed is CN" invariant is preserved.mcpp self config --mirror X hangs on fresh MCPP_HOME (#76)1 parent a349d71 commit 7f8d3e4
4 files changed
Lines changed: 107 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4355 | 4355 | | |
4356 | 4356 | | |
4357 | 4357 | | |
4358 | | - | |
| 4358 | + | |
| 4359 | + | |
| 4360 | + | |
| 4361 | + | |
| 4362 | + | |
| 4363 | + | |
| 4364 | + | |
| 4365 | + | |
| 4366 | + | |
| 4367 | + | |
| 4368 | + | |
| 4369 | + | |
| 4370 | + | |
| 4371 | + | |
| 4372 | + | |
| 4373 | + | |
| 4374 | + | |
| 4375 | + | |
| 4376 | + | |
| 4377 | + | |
| 4378 | + | |
| 4379 | + | |
| 4380 | + | |
4359 | 4381 | | |
4360 | 4382 | | |
4361 | 4383 | | |
4362 | 4384 | | |
4363 | 4385 | | |
4364 | 4386 | | |
4365 | | - | |
4366 | 4387 | | |
4367 | 4388 | | |
4368 | 4389 | | |
4369 | 4390 | | |
4370 | 4391 | | |
4371 | | - | |
4372 | | - | |
4373 | | - | |
4374 | | - | |
4375 | | - | |
4376 | | - | |
4377 | | - | |
4378 | 4392 | | |
4379 | 4393 | | |
4380 | 4394 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
189 | 196 | | |
190 | 197 | | |
191 | | - | |
| 198 | + | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
310 | 318 | | |
311 | 319 | | |
312 | 320 | | |
313 | | - | |
| 321 | + | |
| 322 | + | |
314 | 323 | | |
315 | 324 | | |
316 | 325 | | |
| |||
320 | 329 | | |
321 | 330 | | |
322 | 331 | | |
323 | | - | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
324 | 336 | | |
325 | 337 | | |
326 | 338 | | |
| |||
385 | 397 | | |
386 | 398 | | |
387 | 399 | | |
388 | | - | |
| 400 | + | |
| 401 | + | |
389 | 402 | | |
390 | 403 | | |
391 | 404 | | |
| |||
507 | 520 | | |
508 | 521 | | |
509 | 522 | | |
510 | | - | |
| 523 | + | |
511 | 524 | | |
512 | 525 | | |
513 | 526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
200 | 214 | | |
201 | 215 | | |
202 | 216 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments