New Xcode Build System and BuildSettingExtractor

Last week at WWDC 2017, Apple announced a new build system for Xcode, with an opt-in preview in Xcode 9. The new system is written in Swift and promises to be a significant advance in a number of areas including performance and dependency management. The new system is built on top of the open source llbuild project and lays the foundation for integrating the Xcode build system with the Swift Package Manager.

You opt in to the new build system per project or workspace. To do so in the Xcode 9 beta, open a project file and then go to File > Project Settings… and in the sheet that appears, choose New Build System (Preview) from the Build System popup menu. Note that the menu item will be File > Workspace Settings… if you are working with a workspace.

Project settings sheet with popup menu to select build system

Opt-in to the new build system for a project in File > Project Settings…
(For a workspace use File > Workspace Settings…)

The big news of a new build system made me curious to see if there were any changes I would need to make to BuildSettingExtractor.

Icon for the app BuildSettingExtractor

BuildSettingExtractor helps you move to xcconfig files.

If you are not familiar with it, BuildSettingExtractor is an open source utility that helps you move to using xcconfig files. It reads the build settings embedded in an Xcode project file and extracts the settings into xcconfig files. It can also extract the Xcode help for each build setting to produce automatically documented configuration files. (Read my prior post Generating Xcode Build Configuration Files with BuildSettingExtractor for more about the benefits of using xcconfig files.)

My investigation led me to look more closely at what was changing and what was staying the same when it came to the new build system and build settings in Xcode 9.

When it comes to build settings, there are two big operations: Defining build settings and using build settings.

As developers, we spend our time on the first part, defining build settings1. In a complex project or workspace, this can be an involved process. Defining build settings includes all of the following:

  • Build settings defined for each target and for the project itself
  • Variable substitution to define derived build settings using ${} or $()
  • Conditional build settings based on build configuration, architecture, and SDK
  • Optionally using xcconfig files to define build settings
  • Understanding the well-defined hierarchy of how build settings are inherited and used

In the end, these intricate and flexible mechanisms for defining build settings resolve into a big dictionary of key-value pairs that is passed to the build system.

The build system is what uses the build settings to help direct how it builds a target. The build system coordinates the various tools required, such as the compiler and linker. It uses a target’s build phases and build settings to generate a build product (e.g. app, extension, framework, library). It understands all of a target’s dependencies and builds them as well. The build system is a complicated beastie with a lot of responsibilities and it is what is being modernized beginning in Xcode 9.

Logo of new Xcode build system

New build system.
Same build settings.

On a number of my projects, I’ve switched from the current build system to the new build system in Xcode 9 to investigate. It appears that everything about defining build settings remains unchanged. Moving between the old and new build systems did not cause any build setting changes or recommended changes. The mechanisms for generating that giant bucket of key-value pairs known as build settings seem to be just the same as before.

This is great news. As developers, we don’t need to learn a new complex system for defining build settings. We get to enjoy the benefits of a new, faster, modern build system with our existing build settings left intact.

As the developer of BuildSettingExtractor, this is also great news—no big changes required. After doing some testing and a tweak here and there, BuildSettingExtractor is now updated to work with the Xcode 9 beta. I invite you to check out BuildSettingExtractor and the new build system in Xcode 9. •

1And debugging them.

WWDC in San Jose: Full Circle

Next week’s James Dempsey and the Breakpoints concert is especially meaningful to me. It circles back to the literal spot where it all began.

I’ve now been writing and performing these funny, nerdy songs about software development for sixteen years.

LIVE near WWDC 2017 Poster

It started in 2001. WWDC was held in San Jose and I was working at Apple. AirPods, iPhones, iPads, Apple TV, and Apple Watch did not exist. Event the first iPod would not be released until later that year. It was a different world.

The previous year, I had given my first WWDC presentation ever. The presentation went well, but speaking to a cavernous convention center room, it also felt a little dry.

While leaving the parking garage that night, a thought occurred to me: Wouldn’t it be funny if someone pulled out a guitar at the end of a session and played a little song to sum things up?

The thought stuck with me and over the next year I wrote a song1. The track manager thought it would be a fun way to close the session I was giving, so performing the song was a go.

I was expecting I’d be performing this song in a convention center room.

I could not have been more wrong.

That year, there were so many WWDC sessions that some were held across the street at the City National Civic theater. The CNC can seat thousands of people. Legends like Bob Dylan, The Rolling Stones, The Who and countless others have performed there.

As for me, I had never performed an original song for an audience before.

I had never even played guitar in public before.

Some people might have some friends come out to a coffee shop for an acoustic open mic night to make their performance debut. Somehow, I ended up making my debut in a 3,700 seat auditorium in front of a few hundred colleagues and developers.

I was a nervous wreck.

As I was wrapping up the session, I pulled out a guitar2 and told the audience, “I’ve never played guitar in front of an audience before, so it might just suck to be you.”

Fortunately the crowd kindly overlooked my musical errors and the song met with an enthusiastic response. From there, a song at WWDC became a yearly tradition until I left Apple in 2011. Since then, we’ve gotten to play more than one song in a row at the yearly LIVE near WWDC show. And it all started on the stage of that big hall in San Jose.

It is hard to convey how much it means to me to be performing at the City National Civic again.

Sixteen years ago, I faced my fears and stepped onto the stage alone to play a song as a humorous closing of a technical talk.

Next week, I’ll be returning to the exact same spot, backed by a full band, to perform a full concert of songs to raise money for a great cause.

If you are in town for WWDC week or if you live in the area, I invite you to come out for the show next Wednesday night, June 7th. No WWDC ticket is required, and it’s an all-ages show, so folks under 21 are welcome. The show is located directly across the street from the San Jose convention center.

The show is shaping up to be a lot of fun. I hope you can make it out to benefit App Camp For Girls and also to help celebrate this full-circle homecoming concert—for me it is very special and I’d love to see you there. •

James Dempsey and The Breakpoints, LIVE near WWDC
A Women@WWDC benefit for App Camp For Girls
presented by Capital One
Wednesday, June 7th, 7:00 – 11:00.
Event information and tickets

Can’t make the show but still want to support App Camp For Girls?
Click the Make A Donation button in the Buy Tickets section of the event page.

It was The Fetch Spec Song, about technologies now faded into to the mists of history: WebObjects and its object persistence framework, the Enterprise Objects Framework (aka EOF).

It wasn’t even my guitar, it was an indefinitely borrowed guitar