Remove/Deprecate —xcode option from build script

Hey everyone,

Although what the title says, the point of this thread is not say we should remove the option completely, but to open the discussion about developer experience with that building option and gather thoughts about the need for that to continue to be maintained and for we to document a new more stable option for people trying to work in the compiler with Xcode.

For context on why this is an important discussion is that given new comers to the project are often familiar with Xcode and that is the first option they try when first setting up things to build the compiler for the first time and start digging into the code. But given that —xcode is not as stable as ninja build it is very common people hit all kinds of issues when trying out that option which for beginners it becomes a first barrier get a first contribution in. We can see that over the last few years lot of threads of this forums from people having issues with building the compiler with —Xcode. Some examples:

In my personal experience and also from talking to others as well, using the Xcode build was always unstable and often either some thing would make it not work anymore.
Even recently we could see some threads from people from the Swift Mentorship Program trying to build the compiler and hitting those issues on the Xcode build.

So with that said it is fair to state that the --xcode build option doesn't offer a good developer experience, which is the goal we are aiming for.
And aiming for a better developer experience, recently Erik shared a way to use Xcode with ninja which seems to work pretty well and we actually have the stability of the ninja build and the nice IDE experience from Xcode. Which is the first option we have, and the idea would be documenting that in the started guides and remove mentions of the --Xcode so that becomes the "recommended way" for people to use.
So we want to hear your thoughts about that!

Questions about --xcode option

  • If that becomes the new recommended way for developers to use Xcode, would that option still be useful? There is a lot of code(including work arounds) in build script and cmake files to maintain this option so deprecate that option would be a clean up on that area.
  • How many people actually rely on --xcode build? And for people that rely on it, what is the aspect that you rely on that we can't achieve with using Xcode with ninja?
  • What do you think would be the impact of deprecating or removing that option completely?

I think those are the most important questions I could remember, but feel free to raise more.

Before we wrap up, it is important to note that the goal of this discussion is not to say we should remove this flag, but to propose a new recommended way to use Xcode in development for new contributors that improves developer experience and if that makes --xcode not useful anymore, and if that is the case if is still worth the work of maintaining it.

So the actual first action steps for now would be just update the GettingStarted Guides to not recommend that option anymore.

Let us know your thoughts and concerns about that topic.
With Best Regards,
Luciano

8 Likes

I still rely on --xcode working to create an Xcode project that can index, navigate, and edit, but not build, the compiler, since I use a separate ninja configuration for that. So I'd be fine with --xcode being relegated to creating an edit-only project. Erik's instructions for integrating Ninja builds with Xcode still rely on --xcode working to create the initial Xcode project, so his approach wouldn't be viable if we completely remove the --xcode option IIUC.

For a long time, a lot of the problems with the Xcode build have come from the way we set up the build system to cross-build components for the target architectures, such as the runtime, standard library, and other bundled Swift libraries. Longer-term it would be great if we could move those out of the compiler build system so they can be developed and built separately. However, in the short term, what if we make it so that --xcode only sets up build targets for the compiler itself, and maybe the runtime C++ code targeting the same host as the compiler? My primary concern using Xcode is getting good C++ navigation support; I haven't found another IDE that does as well with the LLVM or Swift codebases.

3 Likes