Skip to content

Commit 48e6c95

Browse files
committed
docs: add uapi walkthrough and DCO checklist
Signed-off-by: SupananWC <[email protected]>
1 parent 07a3d1b commit 48e6c95

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

.github/copilot-instructions.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,50 @@ for (int i = 1; i < argc; ++i) {
106106
```
107107

108108
Keep changes small and follow existing formatting and error handling patterns.
109+
110+
## Walkthrough — Add a `uapi/<platform>/` header
111+
112+
Use this when you need to add platform-specific kernel/user API headers
113+
that the `src/` build will include via `-isystem uapi/$(PLATFORM)`.
114+
115+
- Files to edit: create `uapi/<platform>/linux/wireguard.h` (or matching
116+
platform path) and keep contents aligned with kernel headers.
117+
- Typical steps:
118+
1. Duplicate the closest existing platform header under `uapi/` and
119+
adapt only the necessary differences. The project expects these
120+
headers to match the kernel WireGuard API.
121+
2. Update `src/Makefile` only if you need to add a new install step
122+
for the header; usually `-isystem uapi/$(PLATFORM)` is sufficient.
123+
3. Build locally: `cd src && make V=1` and ensure the compiler uses
124+
the `uapi/` header (compiler include paths appear with `V=1`).
125+
4. Add tests or mention kernel version differences in the PR description
126+
when the header intentionally diverges from upstream kernel headers.
127+
128+
## Commit & DCO checklist
129+
130+
Before pushing, ensure commits are signed off to satisfy the DCO bot:
131+
132+
- Set git identity (one-time):
133+
134+
```bash
135+
git config user.name "Your Name"
136+
git config user.email "[email protected]"
137+
```
138+
139+
- Make a commit and sign-off:
140+
141+
```bash
142+
git add <files>
143+
git commit -s -m "docs: update copilot instructions (concise)"
144+
```
145+
146+
- If DCO fails on the PR, amend the offending commit with a sign-off and force-push:
147+
148+
```bash
149+
git commit --amend --no-edit --signoff
150+
git push --force-with-lease
151+
```
152+
153+
- Use `gh` to open the PR or post follow-up comments if you fix DCO or CI.
154+
155+
This checklist is intentionally minimal — use it to avoid common DCO issues.

0 commit comments

Comments
 (0)