QuickStart contribution

Configure the system

Requirements

Install Xcode

mv ~/Downloads/Xcode-beta.app /Applications/
xcode-select -s /Applications/Xcode-beta.app

Install CMake and Ninja

brew install cmake ninja
port install cmake ninja

Setup Swift Repositories

git clone git@github.com:swiftlang/swift.git
./swift/utils/update-checkout --clone --scheme main

Build Swift Compiler


Build Swift compiler without additional tools

./swift/utils/build-script --build-ninja --release-debuginfo

Build Swift Compiler with Sccache

brew install sccache
export SCCACHE_REDIS=${SCCACHE_REDIS}
sccache  --start-server
./swift/utils/build-script \
    --cmake-c-launcher `which sccache` \
    --cmake-cxx-launcher `which sccache` \
    --preset=buildbot_incremental,tools=RA,stdlib=RD,build
sccache  --stop-server

Build Swift stdlib against a downloadable toolchain

mkdir workspace
cd workspace
curl -O https://download.swift.org/development/xcode/swift-DEVELOPMENT-SNAPSHOT-2019-06-06-a/swift-DEVELOPMENT-SNAPSHOT-2019-06-06-a-osx.pkg
mkdir toolchain
xar -C toolchain -x -f swift-DEVELOPMENT-SNAPSHOT-2019-06-06-a-osx.pkg
tar -C toolchain -xzf toolchain/swift-DEVELOPMENT-SNAPSHOT-2019-06-06-a-osx-package.pkg/Payload
TOOLCHAIN_BIN_DIR=$PWD/toolchain/usr/bin
git clone git@github.com:swiftlang/swift.git
./swift/utils/update-checkout --clone --scheme=stdlib_standalone
Preset $PRESET_NAME Build Type Test Debug Info
stdlib_DA_standalone,build Debug No Yes
stdlib_DA_standalone,build,test Debug Yes Yes
stdlib_RA_standalone,build Release No No
stdlib_RA_standalone,build,test Release Yes No
stdlib_RDA_standalone,build Release No Yes
stdlib_RDA_standalone,build,test Release Yes Yes

Build swift-corelibs-foundation


build swift-corelibs-foundation against a downloadable toolchain

git clone git@github.com:swiftlang/swift.git
./swift/utils/update-checkout --clone --scheme main

[1] Manually install CMake

mkdir -p $HOME/bin
tar xfz cmake-3.14.4-Darwin-x86_64.tar.gz -C $HOME/bin
export PATH=$HOME/bin/cmake-3.14.4-Darwin-x86_64/CMake.app/Contents/bin:$PATH

[2] Manually Install Sccache:

mkdir -p $HOME/bin
tar xfz sccache-0.2.8-x86_64-apple-darwin.tar.gz -C $HOME/bin
export PATH=$HOME/bin/sccache-0.2.8-x86_64-apple-darwin:$PATH

Good first issues

The Swift project uses GitHub Issues for tracking bugs, ideas, and tasks. For example, the issues for the Swift compiler repository can be found on its issues dashboard. Beginner-friendly issues are decorated with the good first issue label and can be found by visiting https://github.com/apple/<repository>/contribute.