tuist / tuist/XcodeProj

Crash when calling the project.write function

Open
#1,154 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
2.2k
Forks
355
Avg merge
5h 48m
Merged PRs (30d)
13

Description

If one xcodeproj references another, a crash occurs when calling the project.write function.
This happens in the PBXProjEncoder.sortProjectReferences function because lFile.name is nil, yet a forced unwrap is performed.

Image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at PBXProjEncoder.sortProjectReferences, the function identified as crashing when lFile.name is nil, and reproduce the failure with two referencing xcodeproj files. Trace the referenced-file sorting path and verify that project.write completes without crashing when the name is absent; add coverage for that case if the existing test layout supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.