Commit c105182
Docs: qualify deinit's byte-identical promise for a promoted setting
`spm add` promotes an array build setting that is already present as a scalar
(`HEADER_SEARCH_PATHS`, `OTHER_LDFLAGS`, `FRAMEWORK_SEARCH_PATHS`,
`LD_RUNPATH_SEARCH_PATHS`), and reversing that promotion rewrites the whole
field, because the injected members and the user's own are indistinguishable
once folded together. Members hand-added to such an array afterwards are lost
on `deinit`, and on `update`, which reverts to the recorded baseline before
re-injecting. The docs claimed the pre-`add` restore was byte-identical with
no qualification.
- Follow a stock Xcode app target being an instance of this (the template
writes `LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";`
as a target-level scalar), so the caveat reads as concrete rather than
theoretical, and note that an existing array keeps the shape it was written
in — including the one-line form hand edits and other generators emit.
- The `.spm-injected.json` row of "What to commit" described the marker as a
record of injected edits only; it also pins the pre-injection value of a
build setting `add` rewrote.
Docs only; no behavior change.
[Internal] - SwiftPM: document that `deinit` cannot preserve members added by
hand to a promoted array build setting
Prose review of `packages/react-native/scripts/spm/__doc__/spm-scripts.md`.
Every claim traced to this PR's code: the recorded marker key
(`promotedArrayScalars` on `BuildSettingChange`), the settings merged as arrays
(`INJECTED_ARRAY_SETTINGS` + `frameworkArrayBuildSettings`), the whole-field
rewrite in `removeRecordedBuildSettings`, and `update` re-applying from
`removeRecordedBuildSettings(original, prevMarker…)`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>1 parent 7b1718c commit c105182
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
198 | | - | |
| 198 | + | |
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
210 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
211 | 226 | | |
212 | 227 | | |
213 | 228 | | |
| |||
0 commit comments