MacPaw Tech Blog — Hackathon Edition

Decisions you regret no more

Announcement by: Mary Fedirko

Sometimes you make decisions you regret. And I, like any other human, have some of those. Today I want to tell you about one of them.

November 2020 Apple released the M1 chip with arm64 architecture, and we in Setapp wanted our library (we give all our vendors) to support it. Cause if one of your dependencies doesn't support the new architecture - your whole project cant support it. That's how Setapp library could become a blocker for our vendors.

At that point, we have two ways to deal with the problem:

There was no need in the old library at that moment cause the "fat" format contained both versions, and Xcode (IDE for macOS & iOS devs) could easily handle it, so even apps with x86_64 (Intel CPU) architecture could be linked with the "fat" library. In this case, Xcode just stripped away unneeded arm64 symbols.

Our team decided to move with the second variant. @vitaiy, @tilda, @lderkach spent several weeks on that task being led by @haidamak. I need to mention that they worked on this problem for three weeks, and two of them, during Setapp Run working on another main goal at the same time, which was not supposed to happen.

Just hours after release, besides some excitement, we've got this:

Additionally, we doubled the load on our CI. With that, we had problems and to even once.

And we discussed with @vitaliy several times the ability to let it go and have one "fat" lib after all.

The thought about the not optimal decision was with me the whole year. Not always, but when there were problems with the library - this question usually arose in my head. And the more I thought about it, the more I regretted it.

And last week, @pugsy notified me that some vendor has issues integrating our lib using the old Xcode version. And I thought: what the heck? We have our minimum OS target in the lib, and if we compile it here - it should work everywhere and be backward compatible. You can find things that don't work in an old Xcode released one year ago, and I was facing the difference in 5 years and five major versions.

It took me several days to figure it out, but the library we make is still Xcode-backward compatible, but not so far as we all think. With the new macOS versioning (when they went from 10.15 to 11), some changes were made that don't allow integrating lib using older Xcode. Additionally, we had some extra test-related binary leftovers in the library that I successfully removed. And it still wasn't working.

Change, build, check - fail. Undefined symbols for architecture x86_64. Dozens of fails. You know how frustrating it is when you want to get things done.

And then, I looked into the logs and noticed that I was testing the "fat" version. At first, I thought, so what - it's "fat," and Xcode will strip everything else? But then I realized - I'm stuck, and this at least a chance. Additionally, five years differences can make a difference. And finally, there was a "Build Success ✅" message. That's how I managed to befriend Setapp library built with a modern Xcode 13.1 and a project built with an old Xcode 8.3.3.

I still think about this decision, but I will never regret it anymore.

PS. Probably we will remove the "thin" framework with x86_64 architecture someday.