tuist / XcodeProj

📝 Read, update and write your Xcode projects
https://xcodeproj.tuist.io
MIT License
2.04k stars 313 forks source link

XcodeGen: error: ambiguous use of 'arc4random_uniform' on Linux distros #845

Closed Howler4695 closed 1 month ago

Howler4695 commented 3 months ago

Context 🕵️‍♀️

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))

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 distros

Proposal 🎉

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.

github-actions[bot] commented 2 months ago

Hola 👋,

We want to inform you that the issue has been marked as stale. This means that there hasn't been any activity or updates on it for quite some time, and it's possible that it may no longer be relevant or actionable. If you still believe that this issue is valid and requires attention, please provide an update or any additional information that can help us address it. Otherwise, we may consider closing it in the near future. Thank you for your understanding.

github-actions[bot] commented 1 month ago

Hola 👋,

We want to inform you that we have decided to close this stale issue as there hasn't been any activity or response regarding it after marking it as stale.

We understand that circumstances may have changed or priorities may have shifted, and that's completely understandable. If you still believe that this issue needs to be addressed, please feel free to reopen it and provide any necessary updates or additional information.

We appreciate your understanding and look forward to your continued contributions to the project.

Thank you.