Repository navigation
Write lastKnownFileType = text for unknown file types - #3374
Merged
brentleyjones merged 1 commit intoOct 13, 2026
Merged
Conversation
erneestoc
force-pushed
the
ec/match-xcode-comments
branch
from
October 9, 2026 16:51
2a63ec7 to
3a05716
Compare
This was referenced Oct 9, 2026
Xcode rewrites `project.pbxproj` when it saves a project whose file differs from how it would serialize it. For files with extensions it doesn't know (e.g. `.graphql`, `LICENSE`), Xcode sniffs the contents and writes `text` for text files, while we wrote `file`. Unknown files in source trees are overwhelmingly text, so write `text` instead. Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
erneestoc
force-pushed
the
ec/match-xcode-comments
branch
from
October 9, 2026 21:23
3a05716 to
ec3207e
Compare
This was referenced Oct 9, 2026
lastKnownFileType = text for unknown file types
brentleyjones
approved these changes
Oct 13, 2026
brentleyjones
pushed a commit
that referenced
this pull request
Oct 13, 2026
Split out of #3374, per review. Xcode writes dictionary keys sorted. We wrote `TargetAttributes` with `BazelDependencies` (`FF01…`) first and then the targets in generation order, so Xcode rewrote `project.pbxproj` the next time it saved the project. `TargetAttributes` is a dictionary nested in the `PBXProject` object that `pbxtargetdependencies` writes as a whole, so the final assembly doesn't reorder it. `CreateTargetAttributesObjects` now returns the objects sorted by identifier. `CalculateTargetAttributesPartial` still expects a pre-sorted list. Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
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.
For files with extensions Xcode doesn't know (e.g.
.graphql,LICENSE), Xcode sniffs the contents and writeslastKnownFileType = textfor text files. We wrotefile, so Xcode rewroteproject.pbxprojthe next time it saved the project. Unknown files in source trees are overwhelmingly text, so we now writetext.The group comment, project name and
TargetAttributesordering changes that were here are now in #3379 and #3380.