Libswift is enabled in the compiler build by default

Heads up: libswift is now enabled by default and built with bootstrapping (build: enable libswift bootstrapping by default by eeckstein · Pull Request #40029 · apple/swift · GitHub). This has an impact on the development workflow on your local machine because the build time increases by a few minutes (e.g. libswiftCore is built 2 additional times). For details see swift/ at main · apple/swift · GitHub.

For local development I recommend to add the build-script option -libswift=hosttools to avoid longer build times. With this option libswift is built with the installed Xcode toolchain (requires swift >= 5.5). On linux, you have to install a swift toolchain ( - Download Swift) and set the PATH to its bin directory.

Currently libswift does not contain any “mandatory” code yet. Therefore you can also turn it off in your local builds with -libswift=off.

Note that this option is in the cmake cache and you’ll need to reconfigure or delete CMakeCache.txt after changing the libswift build setting.

If you have any questions or run into any problems, just let me know.


@Erik_Eckstein If you are suggesting that people on macOS always pass -libswift=hosttools for local development, we should make that the default for macOS where we always have a toolchain. I agree that doesn't make sense for Linux b/c we don't always have the toolchain.


IOW, why should I have to type that all the time if that is the workflow that you are recommending to me.

If we are making bootstrapping the default, then we should be suggesting people use bootstrap for their local workflow.

The default we want people to use for local development should be what build-script assumes. It is not user friendly to require everyone who works on Swift to have to type --libswift=hosttools all the time to build-script.

1 Like

Bootstrapping is the safe default. It is in fact more "user friendly" because it guarantees that a local build succeeds without having any requirements on what needs to be installed on the system. That is even more important on Linux (we should not have different defaults for macOS and Linux).
You don't have to type this option every time because it's cached by cmake. Also, there are other build-script options which I believe developers are using for every build, e.g. --skip-build-benchmarks.

But what we could do is to change the default on Mac to "bootstrapping-with-hostlibs". This is almost the same as "bootstrapping" and only adds ~30 seconds of additional build time.

We should get rid of skip-build-benchmarks.

I am fine with bootstrapping by default. Lets just make sure if we say in the README that the default we want people to use locally is to bootstrap (or where-ever we documented this) and I am fine.

I changed it to "bootstrapping-with-hostlibs"

Terms of Service

Privacy Policy

Cookie Policy