Optimizing Binaries - Build Pipeline Jargon
To understand this post, I highly recommend everyone to watch the WWDC 2022 - Link fast: Improve build and launch times and WWDC 2018 - Behind the Scenes of the Xcode Build Process. They’re of the best talks I’ve ever seen. This post covers some of the jargon and how it all comes together. And even though I love making puzzles, I’ll justify why I picked it as my cover. Files .c: A source code file written in C programming language. .swift: A source code file written in Swift programming language. .o: A machine code interpretation of the source code. An intermediate file. Also known as an object file. Named as such, because it’s the object/goal of our source code. .h: A file that doesn’t contain implementation. But only the interface. .a: An archive file. Made up from multiple .o files. Also known as a Static Library or Archive. .dylib: A separate binary, from the main executable. Gets linked with the app’s executable at runtime. Gets copied into the app wrapper. As a result, the main executable is smaller and, because the code is loaded only when it is needed, the build time is typically faster. Also known as Dynamic Library. Often they also have an empty file type. : (commonly with empty file types). A binary. For the scope of our discussions our focus is mostly on dylibs or app executables. Binaries in the Apple world (OSX and iOS) usually don’t have a file type. They’re the end product, the program that gets ran/executed. As the name suggests it’s just 0s and 1s. It’s the lowest possible language level. You can’t get any lower than that. Some examples of an executable are: An iOS app’s main executable: An app you open on your iPhone, ends up calling the app’s executable. Example the Safari app on your iPhone has a Safari executable. Other Examples - macOS binaries: Some examples that you use in the command line are: ls, cp, mkdir, pwd . Every time you do ls, you’re calling a binary somewhere in your macos. Executables are also known as binaries. See docs on /bin. Also see the /bin directory below: If you do `which ls` then you'll get to see the path to the binary that is used .dSYM: In short, it’s a debug information file. For more see here ‘main app executable’: An app may have multiple executables. Examples of this happening: An iOS app that has app extensions. App extensions are also executable. But aren’t the main executable. A command line interface that has. Users won’t have to call your other executables. But your main app will likely call the other executables. ...