SwiftIcons icon indicating copy to clipboard operation
SwiftIcons copied to clipboard

Building SwiftIcons on Xcode 10.2.1 takes forever

Open Sompatbu opened this issue 5 years ago • 9 comments

I've update the Xcode into 10.2.1 after I've cleaned the project and build again. Xcode struck on building SwiftIcons like there's no ending to it. There is no error appears so far.

Xcode Version 10.2.1 (10E1001) SwiftIcons version 2.3.2 Swift Language Version 4.2

Sompatbu avatar Jun 06 '19 10:06 Sompatbu

I have the same problem while building production. Haven't compared it, but my subjective feeling is that building time wasn't that big before updating Xcode (and switching to Swift 5).

Screenshot 2019-06-06 14 25 18
Xcode Version 10.2.1 (10E1001)
SwiftIcons from my fork, which is 2.3.2 with a few fixes (https://github.com/vitalii-tym/SwiftIcons)
The whole project uses Swift 5

vitalii-tym avatar Jun 06 '19 11:06 vitalii-tym

I have the same problem

davidho720 avatar Jun 09 '19 05:06 davidho720

same for me

Mau04 avatar Jun 17 '19 16:06 Mau04

In Xcode 10.2 and higher the i386 compiler is very slow at processing unicode string literals (eg "\u{1234}" and this is why it takes so long to compile SwiftIcons.swift. I found that I could fix it by removing i386 from the valid architectures in my project.

dionc avatar Jun 17 '19 21:06 dionc

@dionc , good point! But in my project there is no i386 anywhere, as well as the library itself doesn't list i386 in its Valid Architectures. The only place where I can find i386 mentioned is in the Pods project, which is not used - the resolved values are taken from the lib's settings:

Screenshot 2019-06-19 12 52 57

vitalii-tym avatar Jun 19 '19 09:06 vitalii-tym

@vitalii-tym your fork doesn't seem to help. Maybe it is slightly faster. But I am still experiencing and extremely slow build purely because of SwiftIcons. The real problem is sadly compiler or configuration for it in XCode 10.

hammadzz avatar Jul 03 '19 15:07 hammadzz

@hammadzz, I never said my fork worked better. It is as slow as the main repo. However, the problem is only applicable to my Release configuration (which has optimization turned on). If you have troubles in your Debug config, which is a real pain I believe - make sure you have optimization turned off for it (Optimization Level: "-Onone")

vitalii-tym avatar Jul 04 '19 12:07 vitalii-tym

any update for production release with xCode 10.2 ?

MinaFSedrak avatar Oct 15 '19 10:10 MinaFSedrak

a quick workaround I currently use is to unlock the pod and remove all icons from the sets I don't use at all, leaving them almost empty. Like this:

public enum WeatherType: Int {
    public static var count: Int {
        return weatherIcons.count
    }

    public var text: String? {
        return weatherIcons[rawValue]
    }

    case alien
}

private let weatherIcons = ["\u{f075}"]

This speeds up build time dramatically. Haven't had time to fix it properly in the lib itself yet.

vitalii-tym avatar Oct 15 '19 14:10 vitalii-tym