When compiling XcodeGen on Linux distros using Swift 5.10.1 the compile will fail with the error:
/root/XcodeGen/.build/checkouts/XcodeProj/Sources/XcodeProj/Extensions/String+Utils.swift:25:31: error: ambiguous use of 'arc4random_uniform'
let randomValue = arc4random_uniform(UInt32(base.count))
I've tested it on my linux distros and it's fixed my issue and I haven't found any others arising from it. I'm not familiar with swift though so this fix could cause problems with older swift versions or something.
Context 🕵️♀️
When compiling XcodeGen on Linux distros using Swift 5.10.1 the compile will fail with the error:
Related XcodeGen issue: https://github.com/yonaskolb/XcodeGen/issues/1495
What
I believe this error is being caused by the random number generator
arc4random_uniform
and the pattern that overwrites it for linux distrosProposal 🎉
I propose the following fix: https://github.com/Howler4695/XcodeProj/blob/main/Sources/XcodeProj/Extensions/String%2BUtils.swift
I've tested it on my linux distros and it's fixed my issue and I haven't found any others arising from it. I'm not familiar with swift though so this fix could cause problems with older swift versions or something.