# Troubles building LLVM and swift (release) after OS upgrade

**URL:** <https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170>\
**Category:** Compiler\
**Tags:** build-script, help-needed, buildin-the-compiler\
**Created:** [February 5, 2019, 1:49pm UTC](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170 "2019-02-05T13:49:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [February 5, 2019, 1:49pm UTC](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170/1 "2019-02-05T13:49:04Z")

</div>

Yesterday I've dragged my feet to upgrading my machine to Mojave after `master` started to [require Xcode 10.2-beta](https://forums.swift.org/t/swift-ci-updated-to-xcode-10-2-beta/20138). OS and Xcode updates went without any issue. I've switched the default compiler to the latest:  
`xcode-select -s /Applications/Xcode-beta.app`  
… but then my usual  
`swift-source$ ./swift/utils/build-script -R --no-assertions`  
failed with  
`fatal error: 'libxml/parser.h' file not found`  
An old post in the forums ([libxml/parser.h not found?](https://forums.swift.org/t/libxml-parser-h-not-found/4432)) suggested I needed to add **`--reconfigure`** to my usual invocation and it did help with unsticking the build…

My issue now is that the build has now ran out of disk space. It looks like the `llvm` build in release mode is now **17.4 GB**. Previously it did only take about 1.5 GB… So I'm guessing some of the defaults have changed since last time I generated full configuration. I've been staring at `build-script --help` in despair — there's nothing about LLVM architectures...

How do I make it build only minimal x86-64 libs and tools required to working on swift locally on Mac?

Update: after getting through the LLVM, I still got stuck on the same error:

```swift
swift-source/swift/tools/swift-ide-test/XMLValidator.cpp:22:10: fatal error: 'libxml/parser.h' file not found
#include <libxml/parser.h>
         ^ ~~~~~~~~~~~~~~~~
1 error generated.

```

---

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [February 5, 2019, 5:34pm UTC](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170/2 "2019-02-05T17:34:03Z")

</div>

@blangmuir Can you help?

In the meantime, I've deleted the `build` directory and I am trying again with `./swift/utils/build-script -R --no-assertions --reconfigure --darwin-deployment-version-osx 10.14`

---

<div class="post-metadata">

**Author:** ![blangmuir](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/blangmuir/32/277_2.png) [@blangmuir](https://forums.swift.org/u/blangmuir)\
**Post date:** [February 5, 2019, 6:05pm UTC](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170/3 "2019-02-05T18:05:22Z")

</div>

> [@palimondo](#):
>
> It looks like the `llvm` build in release mode is now **17.4 GB**. Previously it did only take about 1.5 GB…

I have no idea if that is normal or not; I only ever build with debug info. My RelWithDebInfo build of llvm is ~18 GB.

> [@palimondo](#):
>
> XMLValidator.cpp:22:10: fatal error: 'libxml/parser.h' file not found #include \<libxml/parser.h\>

This sounds like a configuration issue to me. What SDK is being used during the build? The header should exist at `<sdk>/usr/include/libxml2/libxml/parser.h`.

---

<div class="post-metadata">

**Author:** ![palimondo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/palimondo/32/1144_2.png) [@palimondo](https://forums.swift.org/u/palimondo)\
**Post date:** [February 6, 2019, 6:02am UTC](https://forums.swift.org/t/troubles-building-llvm-and-swift-release-after-os-upgrade/20170/4 "2019-02-06T06:02:56Z")

</div>

This invocation did make it work in the end:

> [@palimondo](#):
>
> `./swift/utils/build-script -R --no-assertions --reconfigure --darwin-deployment-version-osx 10.14`

… and the resulting `llvm-macosx-x86_64` is 1.56 GB 👍

I guess this implies that some of the original defaults are failing with the latest `build-script`. On cursory look through the implementation I see some efforts to autodetect target from the platform, but my experience says it incorrectly(?) defaults to building **`all`** instead? Should I file a bug or is this new intended behavior?
