Repository navigation
Sort TargetAttributes by identifier - #3380
Merged
brentleyjones merged 1 commit intoOct 13, 2026
Merged
brentleyjones merged 1 commit into
brentleyjones merged 1 commit into
Conversation
Xcode rewrites `project.pbxproj` when it saves a project whose file differs from how it would serialize it. It writes dictionary keys sorted, but we wrote `TargetAttributes` with `BazelDependencies` first and then the targets in generation order. Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
brentleyjones
pushed a commit
that referenced
this pull request
Oct 13, 2026
For files with extensions Xcode doesn't know (e.g. `.graphql`, `LICENSE`), Xcode sniffs the contents and writes `lastKnownFileType = text` for text files. We wrote `file`, so Xcode rewrote `project.pbxproj` the next time it saved the project. Unknown files in source trees are overwhelmingly text, so we now write `text`. The group comment, project name and `TargetAttributes` ordering changes that were here are now in #3379 and #3380. Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
brentleyjones
approved these changes
Oct 13, 2026
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.
Split out of #3374, per review.
Xcode writes dictionary keys sorted. We wrote
TargetAttributeswithBazelDependencies(FF01…) first and then the targets in generation order, so Xcode rewroteproject.pbxprojthe next time it saved the project.TargetAttributesis a dictionary nested in thePBXProjectobject thatpbxtargetdependencieswrites as a whole, so the final assembly doesn't reorder it.CreateTargetAttributesObjectsnow returns the objects sorted by identifier.CalculateTargetAttributesPartialstill expects a pre-sorted list.