Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building XcodeGen #1495

Open
jpx40 opened this issue Aug 15, 2024 · 5 comments
Open

Error building XcodeGen #1495

jpx40 opened this issue Aug 15, 2024 · 5 comments

Comments

@jpx40
Copy link

jpx40 commented Aug 15, 2024

Creating working copy for https://github.com/jpsim/Yams.git
Working copy of https://github.com/jpsim/Yams.git resolved at 5.0.1
/home/jonas/repo/XcodeGen/.build/checkouts/ArtifactBundleGen/Plugins/ArtifactBundleGenPluginCommand/Symbolic Links/ArtifactBundleGen/Utils/LipoRunnner.swift:11:14: warning: 'launchPath' is deprecated: renamed to 'executableURL'
task.launchPath = "/bin/zsh"
^
/home/jonas/repo/XcodeGen/.build/checkouts/ArtifactBundleGen/Plugins/ArtifactBundleGenPluginCommand/Symbolic Links/ArtifactBundleGen/Utils/LipoRunnner.swift:11:14: note: use 'executableURL' instead
task.launchPath = "/bin/zsh"
^~~~~~~~~~
executableURL
/home/jonas/repo/XcodeGen/.build/checkouts/ArtifactBundleGen/Plugins/ArtifactBundleGenPluginCommand/Symbolic Links/ArtifactBundleGen/Utils/ZipComposer.swift:7:29: warning: result of call to 'run(:arguments:terminationHandler:)' is unused
try Process.run(URL(fileURLWithPath: "/usr/bin/zip"), arguments: ["-r", "(bundlePath.relativePath).zip", "(bundlePath.relativePath)"]) { _ in
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Building for production...
/home/jonas/repo/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))
^
/home/jonas/repo/XcodeGen/.build/checkouts/XcodeProj/Sources/XcodeProj/Extensions/String+Utils.swift:6:17: note: found this candidate
public func arc4random_uniform(
max: UInt32) -> Int32 {
^
SwiftGlibc.arc4random_uniform:1:13: note: found this candidate
public func arc4random_uniform(_ __upper_bound: __uint32_t) -> __uint32_t
^
error: fatalError
[32/35] Compiling XcodeProj Errors.swift
make: *** [Makefile:23: build] Error 1

@giginet
Copy link
Collaborator

giginet commented Aug 15, 2024

Did you try to build this product on Linux?
Could you explain your environment

@jpx40
Copy link
Author

jpx40 commented Aug 16, 2024

Did you try to build this product on Linux? Could you explain your environment

yes i did i use Fedora 40 currently

@Howler4695
Copy link

Howler4695 commented Aug 20, 2024

I'm having the same issue trying to build on Ubuntu 24.04 with swift 5.10.1 installed

Working copy of https://github.com/yonaskolb/JSONUtilities.git resolved at 4.2.0
/path/XcodeGen/.build/checkouts/ArtifactBundleGen/Plugins/ArtifactBundleGenPluginCommand/Symbolic Links/ArtifactBundleGen/Utils/LipoRunnner.swift:11:14: warning: 'launchPath' is deprecated: renamed to 'executableURL'
        task.launchPath = "/bin/zsh"
             ^
/path/XcodeGen/.build/checkouts/ArtifactBundleGen/Plugins/ArtifactBundleGenPluginCommand/Symbolic Links/ArtifactBundleGen/Utils/LipoRunnner.swift:11:14: note: use 'executableURL' instead
        task.launchPath = "/bin/zsh"
             ^~~~~~~~~~
             executableURL
/path/XcodeGen/.build/checkouts/ArtifactBundleGen/Plugins/ArtifactBundleGenPluginCommand/Symbolic Links/ArtifactBundleGen/Utils/ZipComposer.swift:7:29: warning: result of call to 'run(_:arguments:terminationHandler:)' is unused
                try Process.run(URL(fileURLWithPath: "/usr/bin/zip"), arguments: ["-r", "\(bundlePath.relativePath).zip", "\(bundlePath.relativePath)"]) { _ in
                            ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[1/1] Compiling plugin ArtifactBundleGenPluginCommand
Building for production...
[1/26] Write sources
[3/26] Copying SettingPresets
[3/26] Write sources
[16/26] Compiling writer.c
[17/26] Write swift-version--470A62AB4DA177DF.txt
[18/26] Compiling reader.c
[19/27] Compiling parser.c
[20/28] Compiling emitter.c
[21/29] Compiling scanner.c
[23/30] Compiling Version Version+Codable.swift
[24/31] Compiling Spectre Case.swift
[25/32] Compiling PathKit PathKit.swift
[26/32] Compiling Rainbow BackgroundColor.swift
[26/32] Write sources
[27/33] Compiling api.c
[29/34] Compiling JSONUtilities DecodingError.swift
[30/34] Compiling AEXML Document.swift
[31/35] Compiling SwiftCLI ArgumentList.swift
[32/35] Compiling XcodeProj Errors.swift
/path/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))
                              ^
/path/builds/mdaas/active/cantina/pipeline/XcodeGen/.build/checkouts/XcodeProj/Sources/XcodeProj/Extensions/String+Utils.swift:6:17: note: found this candidate
    public func arc4random_uniform(_ max: UInt32) -> Int32 {
                ^
SwiftGlibc.arc4random_uniform:1:13: note: found this candidate
public func arc4random_uniform(_ __upper_bound: __uint32_t) -> __uint32_t
            ^
error: fatalError
make: *** [Makefile:23: build] Error 1
Cleaning up project directory and file based variables
00:01
ERROR: Job failed: exit code 2

@Howler4695
Copy link

Fixed the issue locally, it looks like an extension for xcodeproj is using some outdated syntax to try and fix a random number generation bug on Linux. I updated the the random number syntax to a more modern standard and deleted the linux if conditional and am having no more problems. going to do some more testing then try and get the fix pulled into xcodeproj and then update the xcodeproj version for xcodegen

@Howler4695
Copy link

tuist/XcodeProj#845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants