# \#buildin-the-compiler

**URL:** https://forums.swift.org/tag/buildin-the-compiler/823.md

[Latest](https://forums.swift.org/latest.md) · [Categories](https://forums.swift.org/categories.md) · [Tags](https://forums.swift.org/tags.md)

---

## [Build fails to find swiftrt.o in Swiftly's lib directory](https://forums.swift.org/t/build-fails-to-find-swiftrt-o-in-swiftlys-lib-directory/79491)

<div class="topic-metadata">

**Author:** [@rgba](https://forums.swift.org/u/rgba)\
**Replies:** 6\
**Last updated:** [April 29, 2025, 9:10am UTC](https://forums.swift.org/t/build-fails-to-find-swiftrt-o-in-swiftlys-lib-directory/79491 "2025-04-29T09:10:03Z")

</div>

I am following the recommended guide (swift/docs/HowToGuides/GettingStarted.md at main · swiftlang/swift · GitHub) to compile Swift on my local machine (Ubuntu 24.04 LTS). I installed a prebuilt Swift release toolchain u…

---

## [How do I enable sccache in the docker image?](https://forums.swift.org/t/how-do-i-enable-sccache-in-the-docker-image/79493)

<div class="topic-metadata">

**Author:** [@rgba](https://forums.swift.org/u/rgba)\
**Replies:** 0\
**Last updated:** [April 24, 2025, 3:58pm UTC](https://forums.swift.org/t/how-do-i-enable-sccache-in-the-docker-image/79493 "2025-04-24T15:58:15Z")

</div>

At this point I don't have a clear understanding of Docker and its concepts so probably I am not getting something that is obvious: how do I enable sccache in the Docker image? I picked this block of steps from the "gett…

---

## [Swift-frontend crash when building 5.8.1 on CentOS-Stream 10 under aarch64](https://forums.swift.org/t/swift-frontend-crash-when-building-5-8-1-on-centos-stream-10-under-aarch64/76741)

<div class="topic-metadata">

**Author:** [@Ron\_Olson](https://forums.swift.org/u/Ron_Olson)\
**Replies:** 4\
**Last updated:** [February 20, 2025, 9:38pm UTC](https://forums.swift.org/t/swift-frontend-crash-when-building-5-8-1-on-centos-stream-10-under-aarch64/76741 "2025-02-20T21:38:04Z")

</div>

Hi all- I'm trying to build Swift 5.8.1 for CentOS-Stream 10 as the base version that will allow me to eventually get to 6.x. Because all Fedora-related software (Fedora being upstream of CentOS-Stream) requires the sof…

---

## [Missing \`lit\` config file after swift compiler build](https://forums.swift.org/t/missing-lit-config-file-after-swift-compiler-build/76019)

<div class="topic-metadata">

**Author:** [@janjan](https://forums.swift.org/u/janjan)\
**Replies:** 16\
**Last updated:** [November 19, 2024, 9:33pm UTC](https://forums.swift.org/t/missing-lit-config-file-after-swift-compiler-build/76019 "2024-11-19T21:33:11Z")

</div>

I've been able to run lit tests in the past successfully, however, this time after rebuilding the compiler (macOS) and invoking lit I'm stuck wtih an error. lit.py: /Users/jan/Downloads/Dev/swift-project/llvm-project/ll…

---

## [Help Request: WSL Docker Build Errors](https://forums.swift.org/t/help-request-wsl-docker-build-errors/74140)

<div class="topic-metadata">

**Author:** [@janjan](https://forums.swift.org/u/janjan)\
**Replies:** 10\
**Last updated:** [August 26, 2024, 1:22am UTC](https://forums.swift.org/t/help-request-wsl-docker-build-errors/74140 "2024-08-26T01:22:30Z")

</div>

Hey all, Currently trying to build the swift compiler (debug mode) within a docker container on WSL (Ubuntu 22.04) but am experiening some errors. After running ./swift/utils/build-script --debug-swift --bootstrapping=…

---

## [Linker crashes when building tools](https://forums.swift.org/t/linker-crashes-when-building-tools/68332)

<div class="topic-metadata">

**Author:** [@Karl](https://forums.swift.org/u/Karl)\
**Replies:** 5\
**Last updated:** [May 19, 2024, 11:53pm UTC](https://forums.swift.org/t/linker-crashes-when-building-tools/68332 "2024-05-19T23:53:42Z")

</div>

I think the linker is crashing when attempting to build some of the compiler repository tools. I just rebased to the latest commit on main, so it's at 36a15ceaf4230e658a9453d2f14532bb99fd5dd4, and I ran update-checkout …

---

## [Building swift in Ubuntu saying clang isn't installed (even though it is)](https://forums.swift.org/t/building-swift-in-ubuntu-saying-clang-isnt-installed-even-though-it-is/34422)

<div class="topic-metadata">

**Author:** [@augusto2112](https://forums.swift.org/u/augusto2112)\
**Replies:** 1\
**Last updated:** [April 14, 2023, 5:54pm UTC](https://forums.swift.org/t/building-swift-in-ubuntu-saying-clang-isnt-installed-even-though-it-is/34422 "2023-04-14T17:54:23Z")

</div>

I'm trying to build Swift from source using clang I also built, but the build script fails with the message: ERROR: can't find clang (please install clang-3.5 or a later version) Even though the build script correctly …

---

## [Swift Build Failure](https://forums.swift.org/t/swift-build-failure/63966)

<div class="topic-metadata">

**Author:** [@Rajveer100](https://forums.swift.org/u/Rajveer100)\
**Replies:** 9\
**Last updated:** [March 27, 2023, 10:23am UTC](https://forums.swift.org/t/swift-build-failure/63966 "2023-03-27T10:23:57Z")

</div>

Hey Everyone! I am facing issues with the initial build (i.e. utils/build-script --skip-build-benchmarks \\ --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" \\ --sccache --release-deb…

---

## [\[Resolved\] Build-script failing with 'Environment variable CMAKE must be specified'](https://forums.swift.org/t/resolved-build-script-failing-with-environment-variable-cmake-must-be-specified/62926)

<div class="topic-metadata">

**Author:** [@anthonylatsis](https://forums.swift.org/u/anthonylatsis)\
**Replies:** 1\
**Last updated:** [February 3, 2023, 4:43am UTC](https://forums.swift.org/t/resolved-build-script-failing-with-environment-variable-cmake-must-be-specified/62926 "2023-02-03T04:43:17Z")

</div>

The command is utils/build-script --skip-build-benchmarks --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs="$(uname -m)" --release-debuginfo --sccache --swift-disable-dead-stripping --skip-early-swift…

---

## [Build fails due to missing file (stdalign.h)](https://forums.swift.org/t/build-fails-due-to-missing-file-stdalign-h/60143)

<div class="topic-metadata">

**Author:** [@mtennes](https://forums.swift.org/u/mtennes)\
**Replies:** 3\
**Last updated:** [September 9, 2022, 4:04am UTC](https://forums.swift.org/t/build-fails-due-to-missing-file-stdalign-h/60143 "2022-09-09T04:04:52Z")

</div>

Hello, Real newbie here, since I haven't even successfully built Swift. After executing the build script for about 9 hours, it fails because it can't find stdalign.h I am trying to build swift on the following. Any help…

---

## [\[Stuck Newbie Needs Help\] Can't run bin/swiftc](https://forums.swift.org/t/stuck-newbie-needs-help-cant-run-bin-swiftc/59280)

<div class="topic-metadata">

**Author:** [@danielfalbo](https://forums.swift.org/u/danielfalbo)\
**Replies:** 4\
**Last updated:** [August 2, 2022, 8:05pm UTC](https://forums.swift.org/t/stuck-newbie-needs-help-cant-run-bin-swiftc/59280 "2022-08-02T20:05:21Z")

</div>

I tried to play around with the code in Version.cpp to see if the changes I was making to the codebase were actually working on the build (by running swift --version). I found that the binaries built by Xcode are in the …

---

## [\[Stuck Newbie Needs Help\] Can't generate Xcode project](https://forums.swift.org/t/stuck-newbie-needs-help-cant-generate-xcode-project/58971)

<div class="topic-metadata">

**Author:** [@danielfalbo](https://forums.swift.org/u/danielfalbo)\
**Replies:** 2\
**Last updated:** [July 21, 2022, 5:36pm UTC](https://forums.swift.org/t/stuck-newbie-needs-help-cant-generate-xcode-project/58971 "2022-07-21T17:36:13Z")

</div>

Newbie here, trying to compile @apple/swift and play around with it using Xcode. I'm stuck. With ninja, everything builds successfully, and all the tests succeed. But every time I try to generate the Xcode project wit…

---

## [How to use Xcode together with the ninja build system](https://forums.swift.org/t/how-to-use-xcode-together-with-the-ninja-build-system/57523)

<div class="topic-metadata">

**Author:** [@Erik\_Eckstein](https://forums.swift.org/u/Erik_Eckstein)\
**Replies:** 2\
**Last updated:** [May 23, 2022, 2:08pm UTC](https://forums.swift.org/t/how-to-use-xcode-together-with-the-ninja-build-system/57523 "2022-05-23T14:08:02Z")

</div>

Hi compiler developers! Because several people asked me (and because build-script --xcode is broken sometimes), I added some documentation on how to use Xcode together with the ninja build system: swift/DevelopmentTips.…

---

## [Unable to build on linux, problems with \`-fblocks\` and libblocksruntime](https://forums.swift.org/t/unable-to-build-on-linux-problems-with-fblocks-and-libblocksruntime/53888)

<div class="topic-metadata">

**Author:** [@redsun82](https://forums.swift.org/u/redsun82)\
**Replies:** 2\
**Last updated:** [December 8, 2021, 1:07pm UTC](https://forums.swift.org/t/unable-to-build-on-linux-problems-with-fblocks-and-libblocksruntime/53888 "2021-12-08T13:07:11Z")

</div>

Hi! I'm having a hard time compiling swift on linux. I have fired up the ubuntu container, checked out the 5.5.1 release, called update-checkout, and then called build-script --release-debuginfo --test. After quite som…

---

## [Is anyone else getting this error when building the compiler from \`master\` on macOS?](https://forums.swift.org/t/is-anyone-else-getting-this-error-when-building-the-compiler-from-master-on-macos/36113)

<div class="topic-metadata">

**Author:** [@Max\_Desiatov](https://forums.swift.org/u/Max_Desiatov)\
**Replies:** 16\
**Last updated:** [October 20, 2020, 3:49am UTC](https://forums.swift.org/t/is-anyone-else-getting-this-error-when-building-the-compiler-from-master-on-macos/36113 "2020-10-20T03:49:30Z")

</div>

When building the compiler on macOS locally (I was able to reproduce this on Catalina 10.15.4 and Mojave 10.14.6, both with Xcode 11.4.1), I started getting this error a couple of weeks ago, which only pops up when buil…

---

## [Unable to build Swift](https://forums.swift.org/t/unable-to-build-swift/38826)

<div class="topic-metadata">

**Author:** [@ADev12358](https://forums.swift.org/u/ADev12358)\
**Replies:** 3\
**Last updated:** [July 28, 2020, 7:40pm UTC](https://forums.swift.org/t/unable-to-build-swift/38826 "2020-07-28T19:40:50Z")

</div>

Hey everyone, I've been trying to build Swift from source for several days now without much luck. Any help or suggestions would be greatly appreciated. Thanks! I have tried building on MacOS 10.15.5 with Xcode and with …

---

## [Swiftc built from source fails to compile anything on Ubuntu](https://forums.swift.org/t/swiftc-built-from-source-fails-to-compile-anything-on-ubuntu/34749)

<div class="topic-metadata">

**Author:** [@augusto2112](https://forums.swift.org/u/augusto2112)\
**Replies:** 5\
**Last updated:** [March 26, 2020, 7:46pm UTC](https://forums.swift.org/t/swiftc-built-from-source-fails-to-compile-anything-on-ubuntu/34749 "2020-03-26T19:46:21Z")

</div>

I apologize if this is the wrong category. I've built Swift from source, and was using only the REPL. Only now I found out swiftc fails to compile any program at all with message: \<unknown\>:0: error: unable to execute …

---

## [Failure building swift lib](https://forums.swift.org/t/failure-building-swift-lib/34467)

<div class="topic-metadata">

**Author:** [@denis631](https://forums.swift.org/u/denis631)\
**Replies:** 3\
**Last updated:** [March 12, 2020, 12:10pm UTC](https://forums.swift.org/t/failure-building-swift-lib/34467 "2020-03-12T12:10:07Z")

</div>

Trying to build swift using the basic command: ./utils/build-script --release-debuginfo Unfortunately getting this error: FAILED: stdlib/public/runtime/CMakeFiles/swiftRuntime-macosx-x86\_64.dir/\_\_/\_\_/\_\_/lib/Demangling/…

---

## [Build issues](https://forums.swift.org/t/build-issues/33685)

<div class="topic-metadata">

**Author:** [@suyashsrijan](https://forums.swift.org/u/suyashsrijan)\
**Replies:** 2\
**Last updated:** [February 10, 2020, 9:26pm UTC](https://forums.swift.org/t/build-issues/33685 "2020-02-10T21:26:24Z")

</div>

Edit: It seems like upgrading CMake to the latest stable version seems to have fixed the problem. SummaryI am not sure if I am the only one, but there's seems to be an issue when building swift (fresh checkout). I …

---

## [Error running build-script: "No architectures to compile for"](https://forums.swift.org/t/error-running-build-script-no-architectures-to-compile-for/31050)

<div class="topic-metadata">

**Author:** [@Vinicius\_Vendramini](https://forums.swift.org/u/Vinicius_Vendramini)\
**Replies:** 12\
**Last updated:** [December 2, 2019, 5:08pm UTC](https://forums.swift.org/t/error-running-build-script-no-architectures-to-compile-for/31050 "2019-12-02T17:08:16Z")

</div>

Hi all, I'm having problems building the compiler from the master branch. I started running ./swift/utils/update-checkout --clone-with-ssh, which worked fine. Then tried building using ./utils/build-script --xcode --r…

---

## [Building recent snapshot fails on Arch Linux](https://forums.swift.org/t/building-recent-snapshot-fails-on-arch-linux/25388)

<div class="topic-metadata">

**Author:** [@Gabor\_Sebestyen](https://forums.swift.org/u/Gabor_Sebestyen)\
**Replies:** 41\
**Last updated:** [July 31, 2019, 8:27am UTC](https://forums.swift.org/t/building-recent-snapshot-fails-on-arch-linux/25388 "2019-07-31T08:27:43Z")

</div>

I'm trying to build snapshot swift-DEVELOPMENT-SNAPSHOT-2019-06-02-a on my Arch Linux desktop but it fails compiling CoreFoundation stuff. Here are the last few lines of build output: \[14/103\]\[ 13%\]\[0.222s\] Building C …

---

## [Build failing on macOS 10.14.5, Xcode 10.2.1](https://forums.swift.org/t/build-failing-on-macos-10-14-5-xcode-10-2-1/25973)

<div class="topic-metadata">

**Author:** [@palimondo](https://forums.swift.org/u/palimondo)\
**Replies:** 7\
**Last updated:** [June 27, 2019, 11:03pm UTC](https://forums.swift.org/t/build-failing-on-macos-10-14-5-xcode-10-2-1/25973 "2019-06-27T23:03:29Z")

</div>

I'm having trouble with local build of Swift for the last week or so... I started getting crashes during compilations, so I tried clean builds to no avail. It now dies building swift (llvm builds fine) with error: Swift …

---

## [Survey: How do you build Swift?](https://forums.swift.org/t/survey-how-do-you-build-swift/24826)

<div class="topic-metadata">

**Author:** [@beccadax](https://forums.swift.org/u/beccadax)\
**Replies:** 28\
**Last updated:** [May 30, 2019, 2:26pm UTC](https://forums.swift.org/t/survey-how-do-you-build-swift/24826 "2019-05-30T14:26:12Z")

</div>

I'm preparing a talk for potential new contributors to Swift and I found myself wondering: What build configurations does everyone use? If you'd like to describe your workflow, post something like what I've put below the…

---

## [Problem in building swift](https://forums.swift.org/t/problem-in-building-swift/22040)

<div class="topic-metadata">

**Author:** [@abdullahmughal](https://forums.swift.org/u/abdullahmughal)\
**Replies:** 2\
**Last updated:** [March 25, 2019, 5:12pm UTC](https://forums.swift.org/t/problem-in-building-swift/22040 "2019-03-25T17:12:27Z")

</div>

I was build swift on Mac OS and got error "llvm/utils/llvm-build/llvm-build: \[Error 2\] no such file or directory ". Then I cloned utils folder from llvm (Github). Now, I am getting an error "llvm-build: error: unable to…

---

## [Having some trouble building the compiler](https://forums.swift.org/t/having-some-trouble-building-the-compiler/20746)

<div class="topic-metadata">

**Author:** [@suyashsrijan](https://forums.swift.org/u/suyashsrijan)\
**Replies:** 1\
**Last updated:** [February 21, 2019, 4:36am UTC](https://forums.swift.org/t/having-some-trouble-building-the-compiler/20746 "2019-02-21T04:36:02Z")

</div>

I checked out master and updated my Xcode to 10.2 beta 3 (10P99q), however when doing a clean build, I get the following error: :0: error: error opening '/Users/suyashsrijan/Documents/swift-src/build/Xcode-RelWithDebIn…

---

## [Troubles building LLVM and swift (release) after OS upgrade](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170)

<div class="topic-metadata">

**Author:** [@palimondo](https://forums.swift.org/u/palimondo)\
**Replies:** 3\
**Last updated:** [February 6, 2019, 6:02am UTC](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170 "2019-02-06T06:02:56Z")

</div>

Yesterday I've dragged my feet to upgrading my machine to Mojave after master started to require Xcode 10.2-beta. OS and Xcode updates went without any issue. I've switched the default compiler to the latest: xcode-sele…

---

## [Error compiling the Swift compiler; Swift does not support the SDK 'MacOSX10.13.sdk'](https://forums.swift.org/t/error-compiling-the-swift-compiler-swift-does-not-support-the-sdk-macosx10-13-sdk/13512)

<div class="topic-metadata">

**Author:** [@Vercantez](https://forums.swift.org/u/Vercantez)\
**Replies:** 6\
**Last updated:** [September 12, 2018, 9:21pm UTC](https://forums.swift.org/t/error-compiling-the-swift-compiler-swift-does-not-support-the-sdk-macosx10-13-sdk/13512 "2018-09-12T21:21:39Z")

</div>

I'm getting an error compiling the Swift compiler after almost 2 hours on my 2014 MacBook Pro. This is the only meaningful line I can find. :0: error: Swift does not support the SDK 'MacOSX10.13.sdk' Is there something…

---

## [No spaces allowed during building?](https://forums.swift.org/t/no-spaces-allowed-during-building/15599)

<div class="topic-metadata">

**Author:** [@CTMacUser](https://forums.swift.org/u/CTMacUser)\
**Replies:** 2\
**Last updated:** [August 28, 2018, 4:32pm UTC](https://forums.swift.org/t/no-spaces-allowed-during-building/15599 "2018-08-28T16:32:54Z")

</div>

Part of a line in the build script output while trying to build Swift from my fork: /Volumes/Extreme SSD/Swift fork/build/Ninja-RelWithDebInfoAssert+stdlib-DebugAssert/llvm-macosx-x86\_64/lib/Transforms/Hello/LLVMHello.e…

---

## [Master build fails macOS due to error: Build input file cannot be found: SwiftNativeNSXXXBase.mm](https://forums.swift.org/t/master-build-fails-macos-due-to-error-build-input-file-cannot-be-found-swiftnativensxxxbase-mm/13474)

<div class="topic-metadata">

**Author:** [@GLanza](https://forums.swift.org/u/GLanza)\
**Replies:** 11\
**Last updated:** [June 22, 2018, 7:45pm UTC](https://forums.swift.org/t/master-build-fails-macos-due-to-error-build-input-file-cannot-be-found-swiftnativensxxxbase-mm/13474 "2018-06-22T19:45:52Z")

</div>

Hi, I'm trying to build swift for the first time, but I fail with the following error: Error: Build input file cannot be found: SwiftNativeNSXXXBase.mm My OS: High Sierra 10.13.4 (17E202) My xCode version: $ xcodeb…
