XcodeProj icon indicating copy to clipboard operation
XcodeProj copied to clipboard

Compilation errors for iOS platform

Open nmcc24 opened this issue 4 weeks ago • 3 comments

Currently, XcodeProj is not compilable on iOS platform. This is an issue when attempting to compile products that have XcodeProj as a (transitive) dependency (ex: CuckooGenerator from https://github.com/Brightify/Cuckoo)

Image

nmcc24 avatar Nov 25 '25 11:11 nmcc24

Hi @nmcc24! I'm Dosu and I’m helping the XcodeProj team.

The iOS compilation errors stem from two main issues:

  1. In Path+Extras.swift, the code uses #if os(macOS) to select Darwin.glob for macOS, but the #else branch calls Glibc.glob for all other platforms—including iOS, where Glibc does not exist. To fix this, change the conditional to #if os(macOS) / #elseif os(Linux) / #else (error or stub), so Glibc is only referenced on Linux. This will prevent the missing import error on iOS. See the relevant code here.

  2. In String+md5.swift, the code uses CryptoKit's Insecure.MD5.hash(data:) with a #available(OSX 10.15, *) check, but does not check for iOS deployment targets. This causes build errors if the deployment target is below iOS 13. To resolve this, update the check to #available(iOS 13, OSX 10.15, *), or ensure your deployment target is iOS 13+. See the code here.

There is ongoing discussion in the Tuist community about modularizing code to avoid these platform-specific issues and make dependencies like XcodeProj more reusable across platforms. For now, patching the conditional compilation as described above is the most direct workaround. More info on the modularization discussion is here.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Nov 25 '25 11:11 dosubot[bot]

@dosu that is correct and https://github.com/tuist/XcodeProj/pull/1016 proposes a similar solution

nmcc24 avatar Nov 25 '25 11:11 nmcc24

That's right—PR #1016 proposes platform-specific compiler flags and iOS version checks to resolve the same iOS compilation issues you described. As of the latest code snapshot, these changes have not yet been merged; the main branch still references Glibc on all non-macOS platforms and only checks for macOS availability in the CryptoKit usage, which matches the errors you encountered. No other threads or PRs provide further context beyond this. The broader Tuist community is also discussing modularization to make cross-platform support like this more sustainable going forward.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other

Chat with Dosu Open in Cursor Join Discord Share on X

dosubot[bot] avatar Nov 25 '25 11:11 dosubot[bot]