ranesr / SwiftIcons

🎢Swift Library for Font Icons - ★ this library

Home Page:https://ranesr.github.io/SwiftIcons/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building SwiftIcons on Xcode 10.2.1 takes forever

Sompatbu opened this issue · 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

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

I have the same problem

same for me

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

any update for production release with xCode 10.2 ?

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.