Skip to content

Swift for Windows build helper tool. Also Swift Toolchain and SDK snapshots.

License

Notifications You must be signed in to change notification settings

readdle/swift-windows-gha

Repository files navigation

Swift Toolchain and SDK Build Tool

Swift on Windows Based on //swift/build project

Project Goals

Swift is a large project consisting of many parts. When it comes to changing or investigating the project, it is crucial to have a comfortable way to tweak the build process.

The goals of this project are to:

  • Provide a tool to build and experiment with Swift (Toolchain and SDK) on Windows in a convenient way on a local developer machine.
  • Provide binary snapshots of dev and release versions of vanilla Swift, as well as customized versions by Readdle.
  • Provide convenient code/script blocks to integrate Swift's build process in an arbitrary CI/CD flow.

Requirements

Getting Started

  1. Run elevated Command Prompt. Elevation is required to install clang modules into Visual Studio directory. If you somehow omit this step (e.g. by commenting corresponding script line), elevation is not needed, but make sure you have modues installed already (either manually, or by previous build tool run).
  2. Clone this repository (e.g. to C:\swift-windows-gha) and CD into it. Note: don't put it deeply into directory structure, or you will probably get build errors due to file path length restrictions. Or use subst command to create a virtual drive from the build directory.
  3. Run scripts\configure.cmd.
  4. Answer to all questions with defaults by pressing Enter. Except the Python path - please specify the full path to Python installation directory, without quotes.
  5. Run scripts\build.cmd.

Just toolchain alone contains more than 5000 sources to build, so be patient. Build takes about 40 minutes on 3.2GHz 8-core CPU, more than a hour on VM under MacBook Pro 2017, and about 6 hours on GitHub Actions cloud agent.

In the end you will get Library folder at the default output path, which contains all built products as well as some intermediates.