Generate secrets into each target's DERIVED_FILE_DIR#25768
Draft
mokagio wants to merge 4 commits into
Draft
Conversation
Collaborator
Generated by 🚫 Danger |
Contributor
|
| App Name | Jetpack | |
| Configuration | Release-Alpha | |
| Build Number | 33096 | |
| Version | PR #25768 | |
| Bundle ID | com.jetpack.alpha | |
| Commit | 45b10e2 | |
| Installation URL | 2ca2r5ofp80n0 |
Contributor
|
| App Name | WordPress | |
| Configuration | Release-Alpha | |
| Build Number | 33096 | |
| Version | PR #25768 | |
| Bundle ID | org.wordpress.alpha | |
| Commit | 45b10e2 | |
| Installation URL | 2nne78lajmj6o |
A `sourceTree` the script does not know makes the whole project file undecodable, failing the `[Lint] Check AppLocalizedString usage` phase after the Swift compile has already succeeded. Failing there is right — an unresolvable reference means a file silently goes unlinted — but the report was `The data couldn't be read because it isn't in the correct format`, naming neither the setting nor the value. `localizedDescription` was throwing that detail away. Interpolating the error itself yields `Cannot initialize SourceTree from invalid String value SOME_FUTURE_DIR`, with the offending object's UUID and key path. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
`WordPress`, `Jetpack` and `Reader` each wrote a different secrets file to the same `$(BUILD_DIR)/Secrets/Secrets.swift`. Building one of them left its secrets at a path the next build of another would see as newer than its inputs, skip regenerating, and compile as its own. `DERIVED_FILE_DIR` is per-target and per-configuration, so each target now owns its copy, and the hand-maintained `Secrets-<Target>.swift` names the extensions needed to dodge the same collision are no longer necessary. This is the arrangement `doapple` and `wcios` already use. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The declared input was `ApplyConfiguration.sh`, which no longer exists. Xcode cannot stat a missing input, so the phase re-ran on every build and editing `GenerateCredentials.sh` never invalidated it — the opposite of what the comment above the line promises. Safe to fix only now that each target writes to its own `DERIVED_FILE_DIR`. While the three app targets shared one output path, the perpetual re-run was what kept them from compiling each other's secrets. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The reference points into `$(DERIVED_FILE_DIR)`, so Xcode draws it red and `Open Quickly` cannot find it — it reads as a dead reference someone should clean up, and deleting it stops the apps compiling. The `Derived Sources` group is repointed from `Classes` to a new `Generated` directory to give the README somewhere to live. Its `path` was vestigial: the only child overrides it with `sourceTree = DERIVED_FILE_DIR`, so nothing resolved through it, and a README added under the old path would have landed loose in the app's main source directory. --- Generated with the help of Claude Code, https://claude.com/claude-code Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
c915a78 to
45b10e2
Compare
mokagio
commented
Jul 10, 2026
| # Add the script that uses this file as a source, so that, if the script | ||
| # changes, Xcode will run it again on the next build. | ||
| ${SRCROOT}/../Scripts/BuildPhases/ApplyConfiguration.sh | ||
| ${SRCROOT}/../Scripts/BuildPhases/GenerateCredentials.sh |
Contributor
Author
There was a problem hiding this comment.
This was a leftover update that we never noticed. Thanks Claude!
mokagio
commented
Jul 10, 2026
| ); | ||
| outputPaths = ( | ||
| "$(BUILD_DIR)/Secrets/Secrets.swift", | ||
| "$(DERIVED_FILE_DIR)/DerivedSecrets.swift", |
Contributor
Author
There was a problem hiding this comment.
I considered switching to an xcfilelist here but given there's only one output path (so moving to it would have required updating these lines and adding the file, net negative) and that using the file list would have required updating the generation script, I decided against it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


No description provided.