Skip to content

Commit 4c3cd19

Browse files
gavinelderfntlnz
authored andcommitted
feat(ai): add claude code reviews & claude.md
1 parent d870a3e commit 4c3cd19

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

.github/workflows/claude.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Claude PR Assistant
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
issues:
9+
types: [opened, assigned]
10+
pull_request_review:
11+
types: [submitted]
12+
13+
jobs:
14+
claude-code-action:
15+
if: |
16+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19+
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
20+
runs-on: ubuntu-latest
21+
permissions:
22+
contents: read
23+
pull-requests: read
24+
issues: read
25+
id-token: write
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v4
29+
with:
30+
fetch-depth: 1
31+
32+
- name: Run Claude PR Action
33+
uses: anthropics/claude-code-action@beta
34+
with:
35+
anthropic_api_key: ${{ secrets.ENG_ANTHROPIC_API_KEY }}
36+
# Or use OAuth token instead:
37+
# claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38+
timeout_minutes: "60"
39+
# mode: tag # Default: responds to @claude mentions
40+
# Optional: Restrict network access to specific domains only
41+
# experimental_allowed_domains: |
42+
# .anthropic.com
43+
# .github.com
44+
# api.github.com
45+
# .githubusercontent.com
46+
# bun.sh
47+
# registry.npmjs.org
48+
# .blob.core.windows.net

CLAUDE.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
This is a CMake-based build system for creating a statically linked version of CRIU (Checkpoint/Restore In Userspace) along with all its dependencies. The project builds CRIU v4.1 with all necessary libraries statically compiled to produce a self-contained binary and libcriu.o object file.
8+
9+
## Build Commands
10+
11+
### Configure the build
12+
```bash
13+
cmake --preset static-release
14+
```
15+
16+
### Build the project
17+
```bash
18+
cmake --build --preset static-release
19+
```
20+
21+
### Install or package
22+
```bash
23+
# Install directly
24+
sudo cmake --install build
25+
26+
# Create package
27+
cpack --config build/CPackConfig.cmake --verbose -B dist -G STGZ
28+
```
29+
30+
### Alternative presets
31+
- `static-debug` - Debug build with debug symbols
32+
- `static-release` - Release build (default, optimized)
33+
34+
## Architecture
35+
36+
### Build System Structure
37+
38+
The project uses a sophisticated CMake build system that:
39+
40+
1. **External Dependencies**: Downloads and builds all CRIU dependencies from source as static libraries:
41+
- Protocol Buffers (protobuf & protobuf-c)
42+
- Network libraries (libnet, libnl, libmnl, libnftnl, libnftables)
43+
- System libraries (libcap, libaio, zlib, util-linux uuid, libintl)
44+
45+
2. **Dependency Management**: Each dependency is managed via individual CMake files in `dependencies/` directory, using the `register_dependency()` macro from `macros/dependencies.cmake`
46+
47+
3. **CRIU Integration**: The main CRIU build is handled as an ExternalProject that:
48+
- Downloads CRIU source code
49+
- Applies patches from `patch/` directory for static building
50+
- Compiles with all dependencies statically linked
51+
- Includes CUDA plugin compilation
52+
53+
### Key Components
54+
55+
- **CMakeLists.txt**: Main build configuration, sets up all dependencies and CRIU build
56+
- **CMakePresets.json**: Defines build presets for different configurations
57+
- **dependencies/*.cmake**: Individual dependency build configurations
58+
- **macros/dependencies.cmake**: Macro for registering dependencies with license tracking
59+
- **patch/**: Contains patches applied to CRIU for static building support
60+
- **jreleaser.yml**: Release configuration for GitHub releases
61+
62+
### Build Process Flow
63+
64+
1. Configure phase downloads and builds all static dependencies in order
65+
2. CRIU source is downloaded and patched for static plugin support
66+
3. CRIU is built with custom CFLAGS/LDFLAGS pointing to static dependencies
67+
4. Final artifacts are installed: `criu` binary, `libcriu.o` object file, headers, and CUDA plugin
68+
69+
### Static Plugin Architecture
70+
71+
The build enables static plugins (STATIC_PLUGINS=y) and specifically compiles the CUDA plugin statically into the main binary rather than as a shared library, controlled by patches in `patch/criu-static-plugin.patch`.
72+
73+
### License Management
74+
75+
The build system automatically tracks all dependency licenses and consolidates them into `THIRD-PARTY-LICENSES.txt` for distribution compliance.

0 commit comments

Comments
 (0)