docs: add AGENTS.md with custom-image dependency install rule
CI / lint (push) Successful in 8s
CI / build-and-test (push) Successful in 52s
CI / sanitizers (address) (push) Successful in 13s
CI / lint (pull_request) Successful in 7s
CI / build-and-test (pull_request) Successful in 53s
CI / sanitizers (address) (pull_request) Successful in 14s
CI / lint (push) Successful in 8s
CI / build-and-test (push) Successful in 52s
CI / sanitizers (address) (push) Successful in 13s
CI / lint (pull_request) Successful in 7s
CI / build-and-test (pull_request) Successful in 53s
CI / sanitizers (address) (pull_request) Successful in 14s
This commit is contained in:
@@ -9,6 +9,8 @@ You are a system architect for the FastSync project — a high-performance file
|
|||||||
|
|
||||||
Make high-level design decisions. Evaluate trade-offs, plan module interactions, design data flow, and ensure architectural coherence across the codebase.
|
Make high-level design decisions. Evaluate trade-offs, plan module interactions, design data flow, and ensure architectural coherence across the codebase.
|
||||||
|
|
||||||
|
> **Environment rule:** dependency installation must always use the project's custom Docker image (repo-root `Dockerfile`, same as CI) — never ad-hoc host package installs. See `AGENTS.md`.
|
||||||
|
|
||||||
## Project Architecture
|
## Project Architecture
|
||||||
|
|
||||||
### Module Map
|
### Module Map
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ tests/ — test sources (globbed as TEST_SRCS)
|
|||||||
- Include directories: `src/shared`, `src/server`, `src/client`, `tests` (for test target).
|
- Include directories: `src/shared`, `src/server`, `src/client`, `tests` (for test target).
|
||||||
- Sanitizer support is commented out but present (`-fsanitize=address`).
|
- Sanitizer support is commented out but present (`-fsanitize=address`).
|
||||||
- Build with `cmake -B build -S . && cmake --build build -j$(nproc)`.
|
- Build with `cmake -B build -S . && cmake --build build -j$(nproc)`.
|
||||||
|
- Install dependencies only via the project's custom Docker image (repo-root `Dockerfile`, same image CI uses) — never via host package installs; see `AGENTS.md`.
|
||||||
|
|
||||||
## When Making Changes
|
## When Making Changes
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# AGENTS.md
|
||||||
|
|
||||||
|
FastSync is a high-performance file synchronization system written in C11. It supports TCP and SSH transports, TLS encryption (OpenSSL), streaming zstd compression, multithreaded transfers, and incremental sync. The build uses CMake; CI runs on Gitea Actions (`.gitea/workflows/ci.yaml`).
|
||||||
|
|
||||||
|
## Dependency installation
|
||||||
|
|
||||||
|
**Rule: always install dependencies using the project's custom Docker image — never via ad-hoc system package installs on the host** (no `apt-get install` / `pip install` on the host machine).
|
||||||
|
|
||||||
|
The image is built from the repo-root `Dockerfile` and is the same image CI uses: `gitea.tap-tap.win/taptap/fastsync-ci:v7`. It contains the full toolchain: gcc/g++, CMake, libzstd-dev, libssl-dev, make, git, cppcheck, clang-format, python3 + pytest, openssh-client, and Node.js.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Build the image from the repo-root Dockerfile
|
||||||
|
docker build -t fastsync-ci:local .
|
||||||
|
|
||||||
|
# Provision dependencies and build inside the container (repo mounted at /workspace)
|
||||||
|
docker run --rm -v "$PWD:/workspace" -w /workspace fastsync-ci:local \
|
||||||
|
sh -c 'cmake -B build -S . && cmake --build build -j$(nproc)'
|
||||||
|
```
|
||||||
|
|
||||||
|
If a dependency is missing from the image, add it to the `Dockerfile` (and rebuild) rather than installing it on the host.
|
||||||
|
|
||||||
|
## Build
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cmake -B build -S . && cmake --build build -j$(nproc)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Test
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./build/tests # unit tests
|
||||||
|
python3 -m pytest tests/ # integration tests
|
||||||
|
```
|
||||||
Reference in New Issue
Block a user