Repository navigation
Conversation
erneestoc
force-pushed
the
ec/assemble-pbxproj-xcode-layout
branch
from
October 9, 2026 16:51
3a25e8b to
803f7ee
Compare
This was referenced Oct 9, 2026
Contributor
|
Before even looking at the PR, I have concerns. We chose the |
The `PBXProject` object was split across four partials: `pbxproj_prefix` wrote its start with `attributes` last, and the `TargetAttributes`, `knownRegions`, and `targets` partials were concatenated after it. This put `attributes` after `projectRoot` and `knownRegions` after `attributes`, which isn't the order Xcode writes. `pbxproj_prefix` already runs after `pbxtargetdependencies` and `files_and_groups`, so it now takes those three partials as inputs and writes the whole object in Xcode's order. The final `cat` no longer needs them. Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
The partials were concatenated as is, so objects were in generator order, without the `/* Begin <isa> section */` blocks Xcode writes. Xcode rewrites the whole file the next time it saves the project. `cat` can't do this: markers are only written for non-empty sections, and objects of the same `isa` come from different generators with interleaved identifiers. The new `project_pbxproj` generator replaces `cat`: it finds each object's bounds and `isa`, stable sorts the objects by `isa` and identifier, and writes them with the section markers. Each object is copied as is, since the generators already write attributes in Xcode's order. Depends on `pbxproj_prefix` writing the whole `PBXProject` (previous commit), as it's the only object that was split across partials. On a 102 MB `project.pbxproj` it takes 0.07 s (`cat`: 0.02 s), so about 0.3 s for 417 MB. It is still a separate `no-cache` action with the same inputs, so only this step reruns on regeneration. Signed-off-by: Ernesto Cambuston <e.cambuston@gmail.com>
erneestoc
force-pushed
the
ec/assemble-pbxproj-xcode-layout
branch
from
October 9, 2026 21:50
803f7ee to
d1c962b
Compare
project.pbxproj in Xcode's layout
Contributor
Author
|
Agreed, the script was far too slow. I've reworked it:
On a 102 MB |
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.
Depends on #3381, which makes
pbxproj_prefixwrite the wholePBXProject.The partials are concatenated with
cat, so objects come in generator order without the/* Begin <isa> section */blocks Xcode writes, and Xcode rewrites the whole file the next time it saves the project.catcan't produce those: markers are only written for non-empty sections, and objects of the sameisacome from several generators with interleaved identifiers. A smallproject_pbxprojgenerator replacescat. It finds each object's bounds andisa, stable sorts the objects by (isa, identifier), and writes them with the section markers, copying each object as is (the generators already write attributes in Xcode's order). Malformed partials (noobjects = {line, an object without anisa, or an unterminated object) are an error.On a 102 MB
project.pbxproj(median of 11 runs):catproject_pbxprojThat's about 0.3 s for a 417 MB project. The action is still
no-cache/no-remote/no-sandboxwith the same inputs, so only this step reruns on regeneration.The output matches Xcode byte for byte: a test project generated with this on top of the synchronized folders PRs (#3376–#3378) is identical to the file Xcode saved for it, and rules_xcodeproj's own project is unchanged from the previous version of this PR.