|
| 1 | +# Contributing |
| 2 | + |
| 3 | +Contributions are welcome — bug reports, feature requests, docs, and pull |
| 4 | +requests. Here's how to get involved. |
| 5 | + |
| 6 | +## Development |
| 7 | + |
| 8 | +```bash |
| 9 | +make build # debug build |
| 10 | +make test # unit tests (needs full Xcode) |
| 11 | +make release # release build |
| 12 | +make lint # swift-format (if installed) |
| 13 | +make guest-agent # cross-compile the hot-reload agent |
| 14 | +make clean # remove build artifacts |
| 15 | +``` |
| 16 | + |
| 17 | +Tests run in CI on macOS with full Xcode (XCTest is not shipped with |
| 18 | +CommandLineTools). The XPC protocol is not a stable public API — client and |
| 19 | +`container-apiserver` ship in lockstep; bump `containerVersion` in |
| 20 | +`Package.swift` when updating the runtime. |
| 21 | + |
| 22 | +## Development setup |
| 23 | + |
| 24 | +In short: |
| 25 | + |
| 26 | +```bash |
| 27 | +make build # debug build |
| 28 | +make test # unit tests (needs full Xcode) |
| 29 | +make lint # swift-format |
| 30 | +make run ARGS="docker ps" # run the CLI headless |
| 31 | +``` |
| 32 | + |
| 33 | +Requirements: |
| 34 | + |
| 35 | +- **macOS 15+** on **Apple Silicon** (arm64). |
| 36 | +- **Full Xcode** — XCTest is not shipped with CommandLineTools, so `make test` |
| 37 | + and the test targets require Xcode. |
| 38 | +- [apple/container](https://github.com/apple/container) installed and running |
| 39 | + (`container-apiserver`). The XPC protocol is pinned to **1.2.2** in |
| 40 | + `Package.swift` — client and runtime ship in lockstep. |
| 41 | + |
| 42 | +## Reporting issues |
| 43 | + |
| 44 | +Open an [issue](https://github.com/djpfs/Macker/issues) with: |
| 45 | + |
| 46 | +- A clear title and description of the problem. |
| 47 | +- Steps to reproduce, including your macOS version and `apple/container` |
| 48 | + version. |
| 49 | +- The output of `docker version` and `docker selftest` if relevant. |
| 50 | + |
| 51 | +## Branch strategy |
| 52 | + |
| 53 | +- `main` — stable releases. Each successful push builds the `.pkg` and |
| 54 | + publishes it as a GitHub Release. |
| 55 | +- `develop` — integration branch. **Open pull requests against `develop`.** |
| 56 | + |
| 57 | +## Code style |
| 58 | + |
| 59 | +- Run `make lint` (swift-format) before committing; CI enforces it. |
| 60 | +- Match the surrounding code — same naming, comment density, and structure. |
| 61 | +- Keep changes focused: one logical change per pull request. |
| 62 | + |
| 63 | +## Testing |
| 64 | + |
| 65 | +- Add or update tests for the code you change. Test targets live in `Tests/`. |
| 66 | +- Make sure `make test` passes locally (requires Xcode). CI runs the full |
| 67 | + suite (build, test, lint, CodeQL) on every push and pull request. |
| 68 | + |
| 69 | +## Commit messages |
| 70 | + |
| 71 | +- Write clear, imperative commit messages that describe the change. |
| 72 | +- Keep the history clean — amend or rebase locally before pushing. |
| 73 | + |
| 74 | +## Releasing |
| 75 | + |
| 76 | +Releases are cut from `main` by the CI: a push to `main` builds the `.pkg` and |
| 77 | +publishes it as a stable GitHub Release (`v1.0.0.<run>`). After a release, |
| 78 | +refresh the Homebrew cask with: |
| 79 | + |
| 80 | +```bash |
| 81 | +./Scripts/update-cask.sh v1.0.0.<run> |
| 82 | +``` |
0 commit comments