KISS 🇺🇦

Stop the war!

Stop the war in Ukraine! Fuck putin!

More information is at: https://war.ukraine.ua/.

There is a fund to support the Ukrainian Army: https://savelife.in.ua/en/donate/, and there is a special bank account that accepts funds in multiple currencies: https://bank.gov.ua/en/about/support-the-armed-forces. I donated to them. Please donate if you can!

Killer putin

Killer putin. Source: politico.eu.

Arrested putin

"It hasn't happened yet, but it will happen sooner or later. Beautiful photo, isn't it?" Source: twitter.

Note about building CocoaPods-powered iOS projects

| comments

TL;DR: If a CocoaPods-injected project won’t build with some weird errors, check that the symlinks are correct. Explanation follows.

Here is the situation. A guy from the client’s side zipped the sources of the iOS project on windows to copy them onto a Mac to build the app for AppStore. But the following errors would stop the build:

1
2
3
4
5
6
7
8
9
10
11
12
13
ProcessPCH /Users/user/Library/Developer/Xcode/DerivedData/app-crnirrohurquhvboorfniwcympij/Build/Intermediates/PrecompiledHeaders/app-Prefix-gywwereqpuslribpfrncsiseshvd/app-Prefix.pch.pth app/app-Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
In file included from /Users/user/Desktop/source_b/src/app/app-Prefix.pch:15:
/Users/user/Desktop/source_b/src/Pods/Headers/CocoaLumberjack/DDLog.h:1:1: error: expected identifier or '('
../../CocoaLumberjack/Lumberjack/DDLog.h
^
1 error generated.

In file included from /Users/user/Desktop/source_b/src/app/app-Prefix.pch:15:
/Users/user/Desktop/source_b/src/Pods/Headers/CocoaLumberjack/DDLog.h:1:1: error: expected unqualified-id
../../CocoaLumberjack/Lumberjack/DDLog.h
^
1 error generated.

The only very similar issue I found was this: http://stackoverflow.com/questions/12607203/unqualified-id-in-file-included-from-zxbinarizer-mm, but it had no proper solution.

So I got the zipped sources and used DiffMerge to compare the two directory hierarchies to figure out the difference. Here’s the catch: CocoaPods creates softlinks (a.k.a. symlinks) for the used headers (like Pods/Headers/CocoaLumberjack/DDLog.h pointing to Pods/CocoaLumberjack/Lumberjack/DDLog.h), and when the project was checked out on windows, it created the softlinks as regular text files with the path to the original file. Look:

1
2
3
➜  ~/Desktop  ll -P ./source_{b,my}/src/Pods/Headers/CocoaLumberjack/DDLog.h
-rwxr-xr-x@ 1 user  staff  40 Jan  1 13:39 ./source_b/src/Pods/Headers/CocoaLumberjack/DDLog.h
lrwxr-xr-x  1 user  staff  40 Jan  1 15:22 ./source_my/src/Pods/Headers/CocoaLumberjack/DDLog.h -> ../../CocoaLumberjack/Lumberjack/DDLog.h

That is, both files are 40 bytes long, but the wrong one is just a usual file with this text:

1
../../CocoaLumberjack/Lumberjack/DDLog.h

which obviously fails to compile with the errors you can see above. It hadn’t been so easy to figure out on my mac, because OS X properly displays the contents of the files beyond the softlink. Zipping the sources on OS X solved the issue.

Leave a comment ⬇ if you have something to say.

Comments