Skip to content

Commit 649a55a

Browse files
authored
Add docs for debugging swift-build (#3136)
This should aid others looking to finding a way to use swift-build with rules_xcodeproj Signed-off-by: Maxwell Elliott <maxwell@elliott.now>
1 parent 64f8161 commit 649a55a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Debugging Swift Build Locally
2+
3+
During the investigation into supporting Build With Proxy (BwP) for rules_xcodeproj
4+
there will be a need to debug [swift-build](https://github.com/swiftlang/swift-build) locally.
5+
Below are steps to help assist developers when trying to debug swift-build.
6+
7+
## Setup
8+
9+
First create a test project or find an existing project you wish to test with, copy the path
10+
to its xcodeproj file, we will refer to this as `LOCAL_TEST_XCODEPROJ_PATH`.
11+
12+
```terminal
13+
git clone git@github.com:swiftlang/swift-build.git
14+
cd swift-build
15+
open Package.swift
16+
```
17+
18+
Once the project is opened select the `swbuild` scheme and then select `Edit Scheme`
19+
20+
Set `Arguments Passed on Launch` like so:
21+
22+
* `build`
23+
* `LOCAL_TEST_XCODEPROJ_PATH` (using the real path of course)
24+
25+
Then under `Environment Variables` set the following:
26+
27+
* `XCBUILD_LAUNCH_IN_PROCESS=1`
28+
29+
## Testing
30+
31+
Now that that is all set up you can run the `swbuild` executable from Xcode and add breakpoints to the project. When you run this binary it is the same as if you built it using swift-build's `launch-xcode` plugin but it is in the current Xcode project.

0 commit comments

Comments
 (0)