You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a CI check fails, diagnose using these steps:
365
+
366
+
**1. Style check failures (`style-check.yml`):**
367
+
```bash
368
+
cd src
369
+
make check-whitespace # Most common - fix with: make fix-whitespace
370
+
make check-permissions # Fix with: make fix-permissions
371
+
make check-homepage # Verify https://www.lammps.org URLs
372
+
make check-errordocs # Check error documentation
373
+
make check-fmtlib # Verify fmtlib formatting
374
+
```
375
+
376
+
**2. Build failures:**
377
+
- Check CMake output for missing dependencies
378
+
- Ensure `-S cmake` (not `-S .`) is used
379
+
- Verify package dependencies are met
380
+
- Check for VLA (variable-length array) usage - not allowed
381
+
382
+
**3. Unit test failures:**
383
+
- Run specific failing test: `cd build && ctest -V -R <test_name>`
384
+
- Check if test requires specific packages to be enabled
385
+
- Verify the executable was built before running tests
386
+
387
+
**4. Regression test failures:**
388
+
- Ensure Python environment has numpy, pyyaml, junit_xml
389
+
- Check if example inputs were modified correctly
390
+
391
+
## Short-Circuit Instructions
392
+
393
+
**STOP and check these common mistakes:**
394
+
395
+
1.**Wrong CMake source directory:**
396
+
- WRONG: `cmake -S . -B build`
397
+
- CORRECT: `cmake -S cmake -B build`
398
+
399
+
2.**Building in source tree:**
400
+
- NEVER run cmake or make in the repository root
401
+
- ALWAYS create a separate `build/` directory
402
+
403
+
3.**Mixed build systems:**
404
+
- If switching from Make to CMake: run `make -C src purge` first
405
+
- If switching from CMake to Make: run `make -C src clean-all` first
406
+
407
+
4.**Unicode in source files:**
408
+
- All source code must be ASCII only
409
+
- Unicode characters will cause CI to fail
410
+
411
+
5.**Missing whitespace fixes:**
412
+
- Always run `cd src && make fix-whitespace` before committing
413
+
414
+
6.**Incorrect file permissions:**
415
+
-`.cpp` and `.h` files must NOT be executable
416
+
-`.sh` and `.py` scripts SHOULD be executable
417
+
418
+
## Sample Prompts
419
+
420
+
**Adding a new pair style:**
421
+
> "Create a new pair style called `pair_example` that implements [description]. Follow the pattern in `src/pair_lj_cut.cpp` and add documentation in `doc/src/pair_example.rst`."
422
+
423
+
**Fixing a bug in a compute:**
424
+
> "Fix bug in `compute_temp.cpp` where [description]. Add a unit test in `unittest/` to prevent regression."
425
+
426
+
**Adding a new package:**
427
+
> "Create a new package called MYPACKAGE with [features]. Include CMakeLists.txt entries, documentation, and example inputs."
428
+
429
+
**Updating documentation:**
430
+
> "Update the documentation for `fix_nve.rst` to include the new `keyword` option. Use `.. versionchanged:: TBD` directive."
431
+
432
+
**Debugging build failure:**
433
+
> "The CI build is failing with [error]. Diagnose and fix the issue."
0 commit comments