Factoring out a new repo for shared code between llbuild & SwiftPM

This effort got sidelined for a long while, but @benjamin_herzog's recent work in llbuild ([WIP] Create a basic tooling infrastructure for build analysis tools. by BenchR267 · Pull Request #542 · apple/swift-llbuild · GitHub) is causing it to be revived.

@Aciid have agreed on the following plan to unblock the efforts here, so that Ben's llbuild work can avoid introducing unnecessary duplication.

Here is the concrete proposal for the next steps we plan to follow:

  1. (In swift-package-manager) We will factor out the TSC libraries (Basic & Utility) into TSC prefixed module names. We will also keep the SPMUtility module for things we believe are SwiftPM specific.
  2. (in swift-tools-support-core) We will make an initial commit of all of the SwiftPM TSC code. The TSC repository will now be the authoritative source for this code, even though it is duplicated in SwiftPM.
  3. (in swift-package-manager) We will make a script to import the code from TSC, to be used in the short term until we have updated the build scripts to allow the decomposition.
  4. At this point, llbuild's SwiftPM package can adopt TSC, even though its CMake build won't.
  5. We will add Swift CI support for TSC. (cc @mishal_shah)
  6. In line with @compnerd's plans, the Swift project will adopt CMake 3.15 or later (which has Swift build support). See Bumping CMake minimum to 3.15
  7. We will make TSC buildable with CMake.
  8. We will make SwiftPM buildable with CMake.
  9. We will delete SwiftPM's duplicate copy of the TSC code, and instead use the TSC CMake build (including integration into Swift's build-script).
  10. Rejoicing in the streets.
9 Likes