Skip to content

Commit 6dcdf06

Browse files
committed
Unify cmakelists.txt and enhance builtins list generation
1 parent 4624ce7 commit 6dcdf06

File tree

6 files changed

+1022
-1875
lines changed

6 files changed

+1022
-1875
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
os: [macos-latest, ubuntu-20.04, ubuntu-22.04]
16+
os: [macos-latest, ubuntu-24.04, ubuntu-22.04]
1717
runs-on: ${{matrix.os}}
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v5
2020
- name: setup
2121
run: cmake -E make_directory ${{runner.workspace}}/build
2222
- name: configure

AGENTS.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Repository Guidelines
2+
3+
## Project Structure & Module Organization
4+
- `CMakeLists.txt`: Single entry point; handles native and cross builds internally.
5+
- `cmake/`: CMake helpers and modules.
6+
- `v8/`: Upstream V8 sources (vendored). Avoid direct edits; prefer upstream patches or local CMake-only changes.
7+
- `patches/`: Local patch files, used sparingly to adapt upstream.
8+
- `build/`: Out-of-tree build output (create with `-B build`).
9+
- `update_v8.py`, `update_v8.json`: Maintainer scripts for bumping V8.
10+
11+
## Build, Test, and Development Commands
12+
- Configure: `cmake -S . -B build` (use `-DPYTHON_EXECUTABLE=/usr/bin/python3` if detection fails; toggle `-DV8_ENABLE_I18N=ON|OFF`).
13+
- Build all: `cmake --build build -j` (or `cd build && make -j8`).
14+
- Build a target: `cmake --build build --target v8_snapshot -j` (common targets include `v8_base_without_compiler`, `v8_compiler`, `v8_libplatform`, `mksnapshot`, `torque`).
15+
- Cross-compile: tool-generating steps expect host-built binaries. Place host executables `torque`, `mksnapshot`, and `bytecode_builtins_list_generator` at the repo root, then configure with your toolchain as usual (e.g., `-DCMAKE_TOOLCHAIN_FILE=...`). You can override the host tools location with `-DV8_HOST_TOOLS_DIR=/absolute/path/to/host/tools`.
16+
17+
## Coding Style & Naming Conventions
18+
- CMake: 2-space indent, lowercase commands, group related sources/defs; prefer generator expressions for platform guards (see `v8_defines`).
19+
- C++: follow upstream V8 style; C++20; no exceptions (`-fno-exceptions`); include paths relative to `v8/` tree.
20+
- Targets: prefix with `v8_`; provide `ch_contrib::` aliases when adding public-facing targets for consumers.
21+
- Do not modify files under `v8/` unless absolutely required; prefer CMake-only changes or isolated patches.
22+
23+
## Testing Guidelines
24+
- This repo validates via successful multi-OS builds (see `.github/workflows/ci.yml`).
25+
- Local smoke tests: build `v8_snapshot`, `mksnapshot`, and `torque` and run `build/mksnapshot --help` or `build/torque --help`.
26+
- If changing cross-compilation, verify both native and cross builds configure and generate outputs.
27+
28+
## Commit & Pull Request Guidelines
29+
- Commits: short, imperative subject (<=72 chars), detailed body when changing build flags, platforms, or cross-compile behavior. Reference issues when relevant.
30+
- PRs must include: problem statement, summary of changes, affected platforms, sample configure line(s), and how you validated (commands/output). Screenshots optional.
31+
32+
## Maintenance & Updates
33+
- To bump V8: run `python update_v8.py`. For minor/major upgrades, update `branch` in `update_v8.json` then re-run. Commit updated files and tag the release appropriately.

0 commit comments

Comments
 (0)