Skip to content

Commit 0fc5e93

Browse files
committed
Add Linux docker for debugging info to README
This commit adds a short paragraph explaining how to create a quick and easy Docker for testing your changes in a Linux environment when you don't have an easy access to a Linux device.
1 parent 59f5dc3 commit 0fc5e93

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,28 @@ $ SWIFT_DRIVER_ENABLE_INTEGRATION_TESTS=1 \
6464
swift test --parallel
6565
```
6666

67+
#### Preparing a Linux docker for debug
68+
69+
When developing on macOS without quick access to a Linux machine, using a Linux Docker is often helpful when debugging.
70+
71+
To get a docker up and running to the following:
72+
- Install Docker for Mac.
73+
- Get the newest swift docker image `docker pull swift`.
74+
- Run the following command to start a docker
75+
```
76+
$ docker run -v /path/to/swift-driver:/home/swift-driver \
77+
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
78+
--security-opt apparmor=unconfined -it swift:latest bash
79+
```
80+
- Install dependencies by running
81+
```
82+
$ apt-get update
83+
$ apt-get install libsqlite3-dev
84+
$ apt-get install libncurses-dev
85+
```
86+
- You can now go to `/home/swift-driver` and run `swift test --parallel` to run your tests.
87+
88+
6789
### Rebuilding `Options.swift`
6890

6991
`Options.swift`, which contains the complete set of options that can be parsed by the driver, is automatically generated from the [option tables in the Swift compiler](https://github.com/apple/swift/tree/master/include/swift/Option). If you need to regenerate `Options.swift`, you will need to [build the Swift compiler](https://github.com/apple/swift#building-swift) and then build `makeOptions` program with a `-I` that allows the generated `Options.inc` to

0 commit comments

Comments
 (0)