yonaskolb / yonaskolb/XcodeGen
Stack Overflow with createIntermediateGroups: true and source with path in /usr/bin
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 8.8k
- Forks
- 908
- Avg merge
- 17d 14h
- Merged PRs (30d)
- 2
Description
Hey, thanks for working on this project, it really saved me some headaches when trying to generate xcode project files! I just ran into a weird issue. I am generating the project.json from the various json files created by my build system. That is how /usr/bin/xcrun wound up in "sources". For now I can just exclude all paths in /usr/bin but I thought it would be good to make an issue for it!
minimal project.json:
{
"name": "Test",
"options": {
"createIntermediateGroups": true
},
"targets": {
"Sources": {
"platform": "auto",
"sources": [
{
"path": "/usr/bin/xcrun"
}
]
}
}
}
Trace:
(lldb) r
Process 32067 launched: '/Users/lattis/src/XcodeGen/.build/apple/Products/Debug/xcodegen' (arm64)
⚙️ Generating plists...
⚙️ Generating project...
No "auto" settings found
Process 32067 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x16f603f70)
frame #0: 0x00000001000cbfc0 xcodegen`PBXFileElement.sourceTree.getter at <compiler-generated>:0
Note: this address is compiler-generated code in function XcodeProj.PBXFileElement.sourceTree.getter : Swift.Optional<XcodeProj.PBXSourceTree> that has no source code associated with it.
Target 0: (xcodegen) stopped.
(lldb) bt
^C* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0x16f603f70)
* frame #0: 0x00000001000cbfc0 xcodegen`PBXFileElement.sourceTree.getter at <compiler-generated>:0
frame #1: 0x00000001001193f0 xcodegen`PBXFileElement.isEqual(rhs=0x00006000016f8320) at Equality.generated.swift:86:12
frame #2: 0x000000010011ab08 xcodegen`PBXGroup.isEqual(rhs=0x00006000016f8320) at Equality.generated.swift:124:22
frame #3: 0x00000001000d7864 xcodegen`PBXGroup.isEqual(object=0x00006000016f8320) at PBXGroup.swift:86:16
frame #4: 0x00000001000e0e30 xcodegen`static PBXObject.== infix(lhs=0x00006000016f8320, rhs=0x00006000016f8320) at PBXObject.swift:60:13
frame #5: 0x00000001000e1344 xcodegen`protocol witness for static Equatable.== infix(_:_:) in conformance PBXObject at <compiler-generated>:0
frame #6: 0x0000000100119d28 xcodegen`PBXFileElement.isEqual(rhs=0x00006000016f8320) at Equality.generated.swift:94:19
frame #7: 0x000000010011ab08 xcodegen`PBXGroup.isEqual(rhs=0x00006000016f8320) at Equality.generated.swift:124:22
frame #8: 0x00000001000d7864 xcodegen`PBXGroup.isEqual(object=0x00006000016f8320) at PBXGroup.swift:86:16
frame #9: 0x00000001000e0e30 xcodegen`static PBXObject.== infix(lhs=0x00006000016f8320, rhs=0x00006000016f8320) at PBXObject.swift:60:13
frame #10: 0x00000001000e1344 xcodegen`protocol witness for static Equatable.== infix(_:_:) in conformance PBXObject at <compiler-generated>:0
frame #11: 0x0000000100119d28 xcodegen`PBXFileElement.isEqual(rhs=0x00006000016f8320) at Equality.generated.swift:94:19
frame #12: 0x000000010011ab08 xcodegen`PBXGroup.isEqual(rhs=0x00006000016f8320) at Equality.generated.swift:124:22
frame #13: 0x00000001000d7864 xcodegen`PBXGroup.isEqual(object=0x00006000016f8320) at PBXGroup.swift:86:16
frame #14: 0x00000001000e0e30 xcodegen`static PBXObject.== infix(lhs=0x00006000016f8320, rhs=0x00006000016f8320) at PBXObject.swift:60:13
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the crash with the minimal project.json using createIntermediateGroups and /usr/bin/xcrun, then inspect the PBXFileElement sourceTree and equality frames named in the trace. Done means the same input no longer crashes and XcodeGen generates the project successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- build-system, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100