Commit 9379eb3
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.
## Summary:
- 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.
## Changelog:
[Internal] - SwiftPM: document that `deinit` cannot preserve members added by
hand to a promoted array build setting
## Test Plan:
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 f4c790d commit 9379eb3
1 file changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
| |||
173 | 173 | | |
174 | 174 | | |
175 | 175 | | |
176 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
177 | 192 | | |
178 | 193 | | |
179 | 194 | | |
| |||
0 commit comments