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
> If you are using Xcode, you will need to temporarily modify `Package.swift` instead of using `swift package edit`, using a path dependency in place of the versioned `container` dependency:
69
+
> If you are using Xcode, do**not** run `swift package edit`. Instead, temporarily modify `Package.swift` to replace the versioned `containerization` dependency:
>**Note:** If you have already run `swift package edit`, whether intentionally or by accident, follow the steps in the next section to restore the normal `containerization` dependency. Otherwise, the modified `Package.swift` file will not work, and the project may fail to build.
74
82
75
83
5. If you want `container` to use any changes you made in the `vminit` subproject of Containerization, update the system property to use the locally built init filesystem image:
76
84
@@ -119,6 +127,42 @@ To revert to using the Containerization dependency from your `Package.swift`:
119
127
bin/container system start
120
128
```
121
129
130
+
## Debug XPC Helpers
131
+
132
+
Attach debugger to the XPC helpers using their launchd service labels:
133
+
134
+
1. Find launchd service labels:
135
+
136
+
```console
137
+
% container system start
138
+
% container run -d --name test debian:bookworm sleep infinity
2. Stop container and start again after setting the environment variable `CONTAINER_DEBUG_LAUNCHD_LABEL` to the label of service to attach debugger. Services whose label starts with the `CONTAINER_DEBUG_LAUNCHD_LABEL` will wait the debugger:
% container system start # Every service starting with `com.apple.container.container-runtime-linux` waits debugger
157
+
```
158
+
159
+
3. Run the command to launch the service, and attach debugger:
160
+
161
+
```console
162
+
% container run -it --name test debian:bookworm
163
+
⠧ [6/6] Starting container [0s] # It hangs as the service is waiting for debugger
164
+
```
165
+
122
166
## Pre-commit hook
123
167
124
168
Run `make pre-commit` to install a pre-commit hook that ensures that your changes have correct formatting and license headers when you run `git commit`.
0 commit comments