build-script: Don't automatically clear the module cache. #5186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Background
Since PR4779 LLVM builds with with -DLLVM_ENABLE_MODULES=1. On Darwin, this turns on -gmodules which causes debug info for the types defined by the LLVM modules is stored alongside the modules in the module cache.
This makes building LLVM several minutes faster and shaves off several gigabytes of redundant debug info from the build directory.
http://llvm.org/devmtg/2015-10/slides/Prantl-ExonSmith-DebugInfoMetadataToModules.pdf
The Problem
The swift/utils/build-script has the nasty habit of unconditionally deleting the module cache on every invocation. Deleting the module cache on every invocation of build-script without re-building the LLVM and clang modules will erase the debug info and thus render any LLVM types undebuggable.
The Solution
This patch removes this functionality. When a clean build is desired, such as on build bots or after master-next merges, the module cache will still be removed since it is located in the build.
Risks
Incremental buildbots will probably still want to clear the module cache to avoid glitches when clang is advanced. I am not sure what the cleanest way to guarantee this is.
rdar://problem/28655564