Commit 07530b2
fix(spm): invalidate Swift explicit-module + build-description caches on flavor hard-fail
The deliberate flavor-flip red build has already planned against the
pre-flip graph, precompiling Swift explicit modules from the old flavor's
interfaces (a debug graph's -Onone interfaces depend on SwiftOnoneSupport,
unavailable in a Release rebuild — Expo hit this as `missing required
module 'SwiftOnoneSupport'` in Swift source packages importing precompiled
Swift modules). The converge rebuild reused that cache, which is not keyed
by anything the flip changes.
The hard-fail path now clears $OBJROOT/{ExplicitPrecompiledModules,
SwiftExplicitPrecompiledModules,XCBuildData} before exiting. All three go
together: the pcm dirs hold the stale modules, and XCBuildData holds the
dependency-scan state referencing them by absolute path — deleting either
without the other strands the rebuild (both directions empirically
proven). Best-effort, gated on $OBJROOT, and confined to the already-
failing red build, so green paths never pay it.
E2E on a real app: matched Debug green; flip Release red with the
invalidation logged; converge rebuild green with a release-flavored,
signature-valid embedded framework.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent d189c94 commit 07530b2
2 files changed
Lines changed: 96 additions & 9 deletions
File tree
- packages/react-native/scripts/spm
- __tests__
Lines changed: 79 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
499 | 499 | | |
500 | 500 | | |
501 | 501 | | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
502 | 530 | | |
503 | 531 | | |
504 | 532 | | |
| |||
559 | 587 | | |
560 | 588 | | |
561 | 589 | | |
562 | | - | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
563 | 605 | | |
564 | 606 | | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
| 607 | + | |
573 | 608 | | |
574 | 609 | | |
575 | 610 | | |
| |||
600 | 635 | | |
601 | 636 | | |
602 | 637 | | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
603 | 673 | | |
Lines changed: 17 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
629 | 629 | | |
630 | 630 | | |
631 | 631 | | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
632 | 649 | | |
633 | 650 | | |
634 | 651 | | |
| |||
0 commit comments