Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

The Swift Programming Language

License

NotificationsYou must be signed in to change notification settings

swiftlang/swift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Swift logo
ArchitectureBuild
macOSx86_64Build Status
Ubuntu 20.04x86_64Build Status
Ubuntu 20.04AArch64Build Status
Ubuntu 22.04x86_64Build Status
Ubuntu 22.04AArch64Build Status
Ubuntu 24.04x86_64Build Status
Ubuntu 24.04AArch64Build Status
Amazon Linux 2x86_64Build Status
Amazon Linux 2AArch64Build Status
Universal Base Image 9x86_64Build Status
Debian 12x86_64Build Status
Debian 12AArch64Build Status
Fedora 39x86_64Build Status
Fedora 39AArch64Build Status
Windows 10x86_64Build Status
Windows 10ARM64Build Status

Cross-Compilation Targets

TargetBuild
wasm32-unknown-wasiBuild Status

Swift Community-Hosted CI Platforms

OSArchitectureBuild
AndroidX86_64Build Status
AndroidAArch64Build Status
Windows 2019 (VS 2019)x86_64Build Status

Welcome to Swift

Swift is a high-performance system programming language. It has a cleanand modern syntax, offers seamless access to existing C and Objective-C codeand frameworks, and is memory-safe by default.

Although inspired by Objective-C and many other languages, Swift is not itself aC-derived language. As a complete and independent language, Swift packages corefeatures like flow control, data structures, and functions, with high-levelconstructs like objects, protocols, closures, and generics. Swift embracesmodules, eliminating the need for headers and the code duplication they entail.

To learn more about the programming language, visitswift.org.

Contributing to Swift

Contributions to Swift are welcomed and encouraged! Please see theContributing to Swift guide.

Before submitting the pull request, please make sure you havetested yourchangesand that they follow the Swift projectguidelines for contributingcode.

To be a truly great community,Swift.org needs to welcomedevelopers from all walks of life, with different backgrounds, and with a widerange of experience. A diverse and friendly community will have more greatideas, more unique perspectives, and produce more great code. We will workdiligently to make the Swift community welcoming to everyone.

To give clarity of what is expected of our members, Swift has adopted thecode of conduct defined by the Contributor Covenant. This document is usedacross many open source communities, and we think it articulates our valueswell. For more, see theCode of Conduct.

Getting Started

If you are interested in:

We also have anFAQ that answers common questions.

Swift Toolchains

Building

Swift toolchains are created using the scriptbuild-toolchain. Thisscript is used by swift.org's CI to produce snapshots and can allow for one tolocally reproduce such builds for development or distribution purposes. A typicalinvocation looks like the following:

  $ ./swift/utils/build-toolchain$BUNDLE_PREFIX

where$BUNDLE_PREFIX is a string that will be prepended to the builddate to give the bundle identifier of the toolchain'sInfo.plist. Forinstance, if$BUNDLE_PREFIX wascom.example, the toolchainproduced will have the bundle identifiercom.example.YYYYMMDD. Itwill be created in the directory you run the script with a filenameof the form:swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz.

Beyond building the toolchain,build-toolchain also supports thefollowing (non-exhaustive) set of useful options:

  • --dry-run: Perform a dry run build. This is off by default.
  • --test: Test the toolchain after it has been compiled. This is off by default.
  • --distcc: Use distcc to speed up the build by distributing the C++ part ofthe swift build. This is off by default.
  • --sccache: Use sccache to speed up subsequent builds of the compiler bycaching more C++ build artifacts. This is off by default.

More options may be added over time. Please pass--help tobuild-toolchain to see the full set of options.

Installing into Xcode

On macOS if one wants to install such a toolchain into Xcode:

  1. Untar and copy the toolchain to one of/Library/Developer/Toolchains/ or~/Library/Developer/Toolchains/. E.g.:
  $ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C /  $ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx.tar.gz -C~/

The script also generates an archive containing debug symbols whichcan be installed over the main archive allowing symbolication of anycompiler crashes.

  $ sudo tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C /  $ tar -xzf swift-LOCAL-YYYY-MM-DD-a-osx-symbols.tar.gz -C~/
  1. Specify the local toolchain for Xcode's use viaXcode->Toolchains.

Build Failures

Try the suggestions inTroubleshooting build issues.

Make sure you are using thecorrect releaseof Xcode.

If you have changed Xcode versions but still encounter errors that appear tobe related to the Xcode version, try passing--clean tobuild-script.

When a new version of Xcode is released, you can update your build withoutrecompiling the entire project by passing--reconfigure tobuild-script.

Learning More

Be sure to look at thedocumentation index for a bird's eyeview of the available documentation. In particular, the documents titledDebugging the Swift Compiler andContinuous Integration for Swift are veryhelpful to understand before submitting your first PR.


[8]ページ先頭

©2009-2025 Movatter.jp