Configure Copilot instructions for CRIU#2884
Configure Copilot instructions for CRIU#2884YATIN072007 wants to merge 2 commits intocheckpoint-restore:criu-devfrom
Conversation
Follow the 'Best practices for Copilot coding agent in your repository' document: 1. Updated .github/copilot-instructions.md with build and verification steps (make build, make lint, make indent). 2. Added .github/instructions/pie.instructions.md for path-specific instructions targeting PIE code (Compel/PIE) to enforce strict constraints (no external libs, system calls only). Fixes: checkpoint-restore#2730 Signed-off-by: YATIN JAMWAL <yatinjamwal07@gmail.com>
| @@ -0,0 +1,30 @@ | |||
| --- | |||
| applyTo: "**/{pie,compel}/**/*.{c,h}" | |||
There was a problem hiding this comment.
compel/ contains non-pie code. you need to specify exact paths in compel/.
| * The code must be completely self-contained. | ||
|
|
||
| 2. **No Global State**: | ||
| * Avoid global variables that require relocation or initialization by the dynamic linker. |
There was a problem hiding this comment.
I am not sure about that. If you look at criu/pie/restorer.c, you will find some global variables...
| 4. **System Calls**: | ||
| * Use raw system calls for all OS interactions. | ||
| * Do not rely on glibc wrappers. | ||
| * Use the provided syscall wrappers (e.g., `sys_write`, `sys_mmap`) if available in the headers. |
There was a problem hiding this comment.
you need to describe where to find all available wrappers and how to add new ones when they are required.
Narrow applyTo patterns to strictly target PIE/parasite code. Clarify global state rules to allow simple POD globals. Add concrete guidance for using and adding system calls. Update cross-references in copilot-instructions.md. Signed-off-by: YATIN JAMWAL <yatinjamwal07@gmail.com>
|
@avagin |
I can see that you ignored some of my comments. Overall, it seems to me that the entire PR was generated by an AI agent, and you has not verified the output. I am skeptical that one can contribute meaningful documentation for this code without hands-on experience with it. Please correct me if I am wrong. If this is for your GSoC application, please find a task that requires working directly with the code. You need to demonstrate a clear understanding of your changes. |
Yes ... , actually it was getting quite complicated for me to completely understand and resolve the issue that's why I had to drop off with some of you suggestions and contribute with what I coud ... I also took help of AI to an extent of understanding and some of the issue solving part... I apricate your suggestion for me working on some other issue within my reach ; Thanks for your guidance... Any other issues which you recommend and I can work upon... |
Updated
.github/copilot-instructions.md**: Added explicit Build & Verification steps. This ensures that Copilot knows how to validate its changes by using the standard project tools.
Added
.github/instructions/pie.instructions.md**: Created path-specific instructions targeting Position Independent Executable (PIE) code in compel/ and
pie/directories. This clearly instructs Copilot to avoid external libraries likelibcand global state, and to use raw system calls, enforcing critical constraints for parasite code.Fixes: #2730