You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: Make sure the directory for llbuild is called "llbuild" and not
58
61
"swift-llbuild".
59
-
60
-
4. Building the Swift Package Manager.
61
-
62
-
```sh
63
-
$ cd swiftpm
64
-
$ Utilities/bootstrap
65
-
```
66
-
67
-
This command will build the Package Manager inside `.build/` directory.
62
+
63
+
4. Build the Swift Package Manager.
64
+
65
+
```sh
66
+
$ cd swiftpm
67
+
$ Utilities/bootstrap
68
+
```
69
+
70
+
Note: The bootstrap script requires having [CMake](https://cmake.org/) and [Ninja](https://ninja-build.org/) installed. Please refer to the [Swift project repo](https://github.com/apple/swift/blob/master/README.md#macos) for installation instructions.
71
+
72
+
This command builds the Package Manager inside the `.build/` directory.
68
73
Run the bootstrap script to rebuild after making a change to the source
69
74
code.
70
-
71
-
You can also use the built binaries: `swift-build`, `swift-package`,
75
+
76
+
You can also use the built binaries: `swift-build`, `swift-package`,
Use this command to run the tests. All tests must pass before a patch can be accepted.
94
+
95
+
## Self Hosting a Swift Package
89
96
90
97
It is possible to build SwiftPM with itself using a special script that is
91
98
emitted during bootstrapping. This is useful when you want to rebuild just the
@@ -98,44 +105,44 @@ $ cd swiftpm
98
105
$ .build/x86_64-apple-macosx/debug/spm build
99
106
100
107
# Run a single test.
101
-
$ .build/x86_64-apple-macosx/debug/spm test --filter BasicTests.GraphAlgorithmsTests/testCycleDetection
108
+
$ .build/x86_64-apple-macosx/debug/spm test --filter PackageGraphTests.DependencyResolverTests/testBasics
102
109
```
103
110
104
-
Note: If you make any changes to `PackageDescription` runtime-related targets,
111
+
Note: If you make any changes to the `PackageDescription` runtime-related targets,
105
112
you **will** need to rebuild using the bootstrap script.
106
113
107
114
## Developing using Xcode
108
115
109
-
Run the following command to generate a Xcode project.
116
+
Run the following commands to generate and open an Xcode project.
110
117
111
118
```sh
112
119
$ Utilities/bootstrap --generate-xcodeproj
113
120
generated: ./SwiftPM.xcodeproj
114
121
$ open SwiftPM.xcodeproj
115
122
```
116
123
117
-
Note: If you make any changes to `PackageDescription` or `PackageDescription4`
118
-
target, you will need to regenerate the Xcode project using the above command.
124
+
Note: If you make any changes to the `PackageDescription` or `PackageDescription4`
125
+
targets, you will need to regenerate the Xcode project using the above command.
119
126
120
-
## Continuous Integration
127
+
## Using Continuous Integration
121
128
122
129
SwiftPM uses [swift-ci](https://ci.swift.org) infrastructure for its continuous integration testing. The
123
-
bots can be triggered on pull-requests if you have commit access, otherwise ask
130
+
bots can be triggered on pull-requests if you have commit access. Otherwise, ask
124
131
one of the code owners to trigger them for you. The following commands are supported:
125
132
126
-
### @swift-ci please smoke test
133
+
@swift-ci please smoke test
127
134
128
-
Run tests with trunk compiler and other projects. This is **required** before
135
+
Run tests with the trunk compiler and other projects. This is **required** before
129
136
a pull-request can be merged.
130
137
131
-
### @swift-ci test with toolchain
138
+
@swift-ci test with toolchain
132
139
133
-
Run tests with latest trunk snapshot. This has fast turnaround times so it can
140
+
Run tests with the latest trunk snapshot. This has fast turnaround times so it can
134
141
be used to get quick feedback.
135
142
136
-
Note: Smoke tests are still required for merging the pull-requests.
143
+
Note: Smoke tests are still required for merging pull-requests.
137
144
138
-
## Running the performance tests
145
+
## Running the Performance Tests
139
146
140
147
Running performance tests is a little awkward right now. First, generate the
141
148
Xcode project using this command:
@@ -152,38 +159,50 @@ For contributors on macOS who need to test on Linux, install Docker and use the
152
159
following commands:
153
160
154
161
```sh
155
-
$ Utilities/Docker/docker-utils build # will build an image with the latest swift snapshot
156
-
$ Utilities/Docker/docker-utils bootstrap # will bootstrap SwiftPM on the linux container
157
-
$ Utilities/Docker/docker-utils run bash # to run an interactive bash shell in the container
162
+
$ Utilities/Docker/docker-utils build # will build an image with the latest Swift snapshot
163
+
$ Utilities/Docker/docker-utils bootstrap # will bootstrap SwiftPM on the Linux container
164
+
$ Utilities/Docker/docker-utils run bash # to run an interactive Bash shell in the container
158
165
$ Utilities/Docker/docker-utils swift-build # to run swift-build in the container
159
166
$ Utilities/Docker/docker-utils swift-test # to run swift-test in the container
160
167
$ Utilities/Docker/docker-utils swift-run # to run swift-run in the container
161
168
```
162
169
163
-
## Using custom Swift compilers
170
+
## Using Custom Swift Compilers
164
171
165
-
SwiftPM needs Swift compiler to parse Package.swift manifest files and to
166
-
compile Swift source files. You can use `SWIFT_EXEC` and `SWIFT_EXEC_MANIFEST`
172
+
SwiftPM needs the Swift compiler to parse `Package.swift` manifest files and to
173
+
compile Swift source files. You can use the `SWIFT_EXEC` and `SWIFT_EXEC_MANIFEST`
167
174
environment variables to control which compiler to use for these operations.
168
175
169
176
`SWIFT_EXEC_MANIFEST`: This variable controls which compiler to use for parsing
170
-
Package.swift manifest files. The lookup order for the manifest compiler is:
171
-
SWIFT_EXEC_MANIFEST, swiftc adjacent to swiftpm binaries, SWIFT_EXEC
177
+
`Package.swift` manifest files. The lookup order for the manifest compiler is:
178
+
`SWIFT_EXEC_MANIFEST`, `swiftc` adjacent to the `swiftpm` binaries, then `SWIFT_EXEC`
172
179
173
180
`SWIFT_EXEC`: This variable controls which compiler to use for compiling Swift
174
-
sources. The lookup order for the sources compiler is: SWIFT_EXEC, swiftc adjacent
175
-
to swiftpm binaries. This is also useful for Swift compiler developers when they
181
+
sources. The lookup order for the sources' compiler is: `SWIFT_EXEC`, then `swiftc` adjacent
182
+
to `swiftpm` binaries. This is also useful for Swift compiler developers when they
176
183
want to use a debug compiler with SwiftPM.
177
184
178
185
```sh
179
186
$ SWIFT_EXEC=/path/to/my/built/swiftc swift build
180
187
```
181
188
182
-
## Overriding path to the runtime libraries
189
+
## Overriding the Path to the Runtime Libraries
183
190
184
-
SwiftPM computes the path of runtime libraries relative to where it is
191
+
SwiftPM computes the path of its runtime libraries relative to where it is
185
192
installed. This path can be overridden by setting the environment variable
186
-
`SWIFTPM_PD_LIBS` to a directory containing the libraries. This can be a list of
187
-
absolute search paths separated by colon (":"). SwiftPM will choose the first
188
-
path which exists on disk. If none of the path are present on disk, it will fall
193
+
`SWIFTPM_PD_LIBS` to a directory containing the libraries, or a colon-separated list of
194
+
absolute search paths. SwiftPM will choose the first
195
+
path which exists on disk. If none of the paths are present on disk, it will fall
189
196
back to built-in computation.
197
+
198
+
## Skipping SwiftPM tests
199
+
200
+
SwiftPM has a hidden env variable `_SWIFTPM_SKIP_TESTS_LIST` that can be used
201
+
to skip a list of tests. This value of the variable is either a file path that contains a
202
+
newline separated list of tests to skip, or a colon-separated list of tests.
203
+
204
+
This is only a development feature and should be considered _unsupported_.
205
+
206
+
## Making changes in TSC targets
207
+
208
+
All targets with the prefix TSC define the interface for the tools support core. Those APIs might be used in other projects as well and need to be updated in this repository by copying their sources directories to the TSC repository. The repository can be found [here](https://github.com/apple/swift-tools-support-core).
0 commit comments