enhance xce-build skill
This commit is contained in:
parent
9bbff7b016
commit
c8e0f65a39
7 changed files with 107 additions and 22 deletions
|
|
@ -20,7 +20,7 @@ Core source files handle distinct domains:
|
|||
Links against `libxce` from `src/lib/`.
|
||||
|
||||
## Conventions
|
||||
- C standard: C99 or later
|
||||
- C standard: gnu17
|
||||
- Format with `clang-format`
|
||||
- Component-specific headers in `include/`
|
||||
- Shared types defined in `src/include/xce/` (libxce)
|
||||
|
|
@ -31,4 +31,4 @@ Links against `libxce` from `src/lib/`.
|
|||
|
||||
## See Also
|
||||
- Shared library: `src/lib/CLAUDE.md`
|
||||
- Root guidelines: `/workspace/CLAUDE.md`
|
||||
- Root guidelines: `CLAUDE.md` (repo root)
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@ meson build && ninja -C build
|
|||
|
||||
## Architecture
|
||||
- Produces `libxce.a` (static) and/or `libxce.so` (shared)
|
||||
- Linked by all C/C++ system components: controller, worker, scheduler
|
||||
- Linked by all C system components: controller, worker, scheduler
|
||||
- Public headers exposed via `src/include/xce/`
|
||||
- Test suite in `src/lib/testsuite/`
|
||||
|
||||
## Conventions
|
||||
- C standard: C99 or later
|
||||
- C standard: gnu17
|
||||
- Format with `clang-format` (config at repo root if present)
|
||||
- All public API headers go in `src/include/xce/` — not in `src/lib/`
|
||||
- Implementation files stay in `src/lib/`
|
||||
|
|
@ -27,4 +27,4 @@ meson build && ninja -C build
|
|||
- `src/lib/testsuite/` — Library unit tests
|
||||
|
||||
## See Also
|
||||
- Root guidelines: `/workspace/CLAUDE.md`
|
||||
- Root guidelines: `CLAUDE.md` (repo root)
|
||||
|
|
|
|||
|
|
@ -18,11 +18,11 @@ meson build && ninja -C build
|
|||
Links against `libxce` from `src/lib/`.
|
||||
|
||||
## Conventions
|
||||
- C standard: C99 or later
|
||||
- C standard: gnu17
|
||||
- Format with `clang-format`
|
||||
- New scheduling policies → add as a plugin under `src/plugins/`, do not modify the core engine
|
||||
- Shared types defined in `src/include/xce/` (libxce)
|
||||
|
||||
## See Also
|
||||
- Shared library: `src/lib/CLAUDE.md`
|
||||
- Root guidelines: `/workspace/CLAUDE.md`
|
||||
- Root guidelines: `CLAUDE.md` (repo root)
|
||||
|
|
|
|||
82
src/tools/xce-build.sh
Executable file
82
src/tools/xce-build.sh
Executable file
|
|
@ -0,0 +1,82 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
COMPONENT="${1:-all}"
|
||||
BUILD_DIR="${2:-xce.build}"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
SRC_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
||||
|
||||
cd "$SRC_DIR"
|
||||
|
||||
usage() {
|
||||
echo "Usage: $0 [component] [build_dir]"
|
||||
echo "Components: all (default), lib, controller, scheduler, worker, apiserver, xcecli"
|
||||
exit 1
|
||||
}
|
||||
|
||||
setup_build() {
|
||||
echo "=== Clean build: $BUILD_DIR ==="
|
||||
rm -rf "$BUILD_DIR"
|
||||
meson setup "$BUILD_DIR" --buildtype=debug -Db_sanitize=address
|
||||
}
|
||||
|
||||
case "$COMPONENT" in
|
||||
lib)
|
||||
setup_build
|
||||
echo "=== Building lib + tests ==="
|
||||
meson compile -C "$BUILD_DIR" xcelib_test
|
||||
echo "=== Running lib tests ==="
|
||||
meson test -C "$BUILD_DIR" "libxce test" --print-errorlogs
|
||||
;;
|
||||
controller)
|
||||
setup_build
|
||||
echo "=== Building lib + controller + tests ==="
|
||||
meson compile -C "$BUILD_DIR" xce_controller controller_unit_test
|
||||
echo "=== Running controller tests ==="
|
||||
meson test -C "$BUILD_DIR" --suite controller --print-errorlogs
|
||||
;;
|
||||
scheduler)
|
||||
setup_build
|
||||
echo "=== Building lib + scheduler + tests ==="
|
||||
meson compile -C "$BUILD_DIR" xce_scheduler sched_test
|
||||
echo "=== Running scheduler tests ==="
|
||||
"./$BUILD_DIR/scheduler/testsuite/sched_test"
|
||||
;;
|
||||
worker)
|
||||
setup_build
|
||||
echo "=== Building lib + worker ==="
|
||||
meson compile -C "$BUILD_DIR" xcecd xcecd_worker xrun
|
||||
echo "=== Worker built (no unit tests registered) ==="
|
||||
;;
|
||||
apiserver)
|
||||
setup_build
|
||||
echo "=== Building lib + apiserver + xcecli ==="
|
||||
meson compile -C "$BUILD_DIR" apiserver xcecli
|
||||
echo "=== Running frontend Go unit tests ==="
|
||||
cd frontend && make test
|
||||
;;
|
||||
xcecli)
|
||||
setup_build
|
||||
echo "=== Building xcecli ==="
|
||||
meson compile -C "$BUILD_DIR" xcecli
|
||||
echo "=== Running xcecli Go unit tests ==="
|
||||
cd frontend/xcecli && CGO_ENABLED=0 go test ./... -count=1
|
||||
;;
|
||||
all)
|
||||
setup_build
|
||||
echo "=== Building all components ==="
|
||||
meson compile -C "$BUILD_DIR"
|
||||
echo "=== Running all C tests ==="
|
||||
meson test -C "$BUILD_DIR" --print-errorlogs
|
||||
echo "=== Running scheduler test (manual) ==="
|
||||
"./$BUILD_DIR/scheduler/testsuite/sched_test"
|
||||
echo "=== Running frontend Go unit tests ==="
|
||||
cd frontend && make test
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "=== Done: $COMPONENT ==="
|
||||
|
|
@ -18,11 +18,11 @@ meson build && ninja -C build
|
|||
Links against `libxce` from `src/lib/`.
|
||||
|
||||
## Conventions
|
||||
- C standard: C99 or later
|
||||
- C standard: gnu17
|
||||
- Format with `clang-format`
|
||||
- Headers in `include/`
|
||||
- Shared types defined in `src/include/xce/` (libxce)
|
||||
|
||||
## See Also
|
||||
- Shared library: `src/lib/CLAUDE.md`
|
||||
- Root guidelines: `/workspace/CLAUDE.md`
|
||||
- Root guidelines: `CLAUDE.md` (repo root)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue