소스 검색

docs: the build directory is Ninja, so "make" silently builds nothing

CLAUDE.md said to build with make. The configured build/ uses Ninja, where
make prints "Nothing to be done" and exits 0 - it does not fail, so an edit
reads as built when nothing was compiled. Cost real confusion today: a source
change was tested against a binary from the day before.

Building through cmake --build works whichever generator is configured, so the
instructions no longer depend on knowing which one it is. Per-target commands
and the restart step are here too, since a rebuilt service that was never
restarted is the same class of mistake.
fszontagh 1 개월 전
부모
커밋
bd7fdfcf01
1개의 변경된 파일과 25개의 추가작업 그리고 9개의 파일을 삭제
  1. 25 9
      CLAUDE.md

+ 25 - 9
CLAUDE.md

@@ -9,21 +9,37 @@ SmartBotic is a workflow automation and execution platform with a microservices
 ## Build Commands
 
 ### C++ Backend
+
+The existing `build/` directory is configured with **Ninja**, not Make. Running
+`make` in it prints "Nothing to be done" and builds nothing at all - it does not
+fail, so an edit looks built when it has not been. Always build through cmake,
+which uses whichever generator the directory was configured with:
+
+```bash
+# Everything
+cmake --build build -j8
+
+# One target - much faster when only one service changed
+cmake --build build --target smartbotic-webserver -j8
+cmake --build build --target smartbotic-runner -j8
+```
+
+Configuring a build directory from scratch:
+
 ```bash
-# Debug build
-mkdir build && cd build
-cmake -DCMAKE_BUILD_TYPE=Debug ..
-make
+# Debug
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
 
-# Release build
-cmake -DCMAKE_BUILD_TYPE=Release ..
-make
+# Release
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
 
 # With Address Sanitizer
-cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON ..
-make
+cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON
 ```
 
+After building a service, restart it to actually run the new binary:
+`systemctl --user restart smartbotic-webserver smartbotic-runner`.
+
 ### Frontend (webui/)
 ```bash
 cd webui