This document describes the available build tasks and IDE configuration for the Media Deduplication Server project.
Press Cmd+Shift+B (macOS) or Ctrl+Shift+B (Linux/Windows) to run the fast rebuild with all tests.
This runs ./scripts/smart_rebuild which:
- ✅ Cleans all build artifacts
- ✅ Preserves dependency cache (no re-download of ONNX Runtime)
- ✅ Full project rebuild
- ✅ Runs all unit tests
- ✅ Runs integration tests
Time: ~30-60 seconds (depends on changes)
All tasks can be accessed via:
- Cmd+Shift+P (macOS) or Ctrl+Shift+P (Linux/Windows)
- Type: "Tasks: Run Task"
- Select from the list below
Command: ./scripts/smart_rebuild
What it does:
- Complete clean of build artifacts
- Preserves
build/_deps/cache (ONNX Runtime stays cached) - Full rebuild from scratch
- Runs all unit tests
- Runs integration tests via ctest
When to use:
- Regular development workflow
- Before committing changes
- After pulling updates
- Testing comprehensive changes
Time: ~30-60 seconds
Command: ./scripts/rebuild
What it does:
- Complete clean including all dependencies
- Re-downloads ONNX Runtime (~200MB)
- Full rebuild from scratch
- Runs all unit tests
- Runs integration tests via ctest
When to use:
- Suspected dependency corruption
- Major CMake configuration changes
- Clean slate verification
- Troubleshooting build issues
Time: ~3-5 minutes (includes download)
Command: ./build.sh --clean
What it does:
- Cleans build artifacts (preserves
_deps/) - Full rebuild
- Does NOT run tests
When to use:
- Quick rebuild without testing
- Just want to verify compilation
- Testing build system changes
Time: ~20-40 seconds
Command: ./build.sh
What it does:
- Incremental build (only changed files)
- Does NOT run tests
When to use:
- Rapid iteration during development
- Small changes to single files
- Quick compilation check
Time: ~5-15 seconds
Command: ./build.sh --clean --debug
What it does:
- Cleans build artifacts
- Builds with debug symbols (
-g -O0) - Enables all warnings
- Does NOT run tests
When to use:
- Preparing for debugging session
- Need debug symbols for GDB/LLDB
- Investigating crashes or issues
Time: ~30-50 seconds
Command: ./build.sh --clean --test
What it does:
- Cleans build artifacts (preserves
_deps/) - Full rebuild
- Runs unit tests only (not integration tests)
When to use:
- Quick test validation
- Don't need ctest integration tests
- Faster than smart_rebuild
Time: ~25-45 seconds
# Make changes to code
# Press Cmd+Shift+B (runs smart_rebuild)
# All tests pass → commit# git pull origin main
# Press Cmd+Shift+B (runs smart_rebuild)
# Verify everything builds and tests pass# Cmd+Shift+P → "Full Rebuild (Clean Everything)"
# Re-downloads all dependencies
# Clean slate build# Cmd+Shift+P → "Build Server (No Clean)"
# Fast incremental build
# Manually run: build/bin/media_dedup_serverYou can also run build scripts directly from the terminal:
# Smart rebuild (fast, preserves cache)
./scripts/smart_rebuild
# Full rebuild (clean everything)
./scripts/rebuild
# Standard build
./build.sh
# Build with options
./build.sh --clean # Clean build
./build.sh --debug # Debug build
./build.sh --test # Build and test
./build.sh --clean --test # Clean, build, and test| Task | Clean | Cache | Tests | Time | Use Case |
|---|---|---|---|---|---|
| Smart Rebuild ⭐ | ✅ | ✅ Keep | ✅ All | ~45s | Default development |
| Full Rebuild | ✅ | ❌ Delete | ✅ All | ~4m | Troubleshooting |
| Clean Build | ✅ | ✅ Keep | ❌ | ~30s | Quick compile check |
| Incremental | ❌ | ✅ Keep | ❌ | ~10s | Rapid iteration |
| Debug Build | ✅ | ✅ Keep | ❌ | ~40s | Debugging session |
| Build & Test | ✅ | ✅ Keep | ~35s | Quick validation |
The following VS Code/Cursor configuration files are tracked in the repository:
Defines all build tasks and keyboard shortcuts.
Debugger configuration for F5 debugging.
Project-specific editor settings (formatting, linting, etc.).
Custom keyboard shortcuts for build and debug operations.
| Shortcut | Task | Description |
|---|---|---|
| Cmd+Shift+B | Smart Rebuild | Fast rebuild with tests (default) |
| F5 | Debug Build & Run | Build in debug mode and attach debugger |
| Shift+F5 | Stop Debugger | Stop debugging session |
| Cmd+Shift+P | Command Palette | Access all tasks |
- Set breakpoints in your code
- Press F5
- Builds in debug mode automatically
- Attaches debugger to the server
- Server starts and breaks at your breakpoints
See .vscode/launch.json for debugger configuration.
- ONNX Runtime headers (~200MB tarball)
- External dependencies from CMake FetchContent
- Located in
build/_deps/
- Full Rebuild task (deliberate)
- Manual
rm -rf build - CMake dependency version changes
- Smart Rebuild task ✅
- Clean Build task ✅
- All other build tasks ✅
- Use Smart Rebuild for daily work - It's fast and thorough
- Run Full Rebuild weekly - Ensures clean dependency state
- Use Incremental builds - For rapid testing during development
- Always test before committing - Cmd+Shift+B runs all tests
- Debug with F5 - Automatic debug build and attach
- Check test output for specific failures
- Try "Full Rebuild (Clean Everything)" to rule out cache issues
- Verify database and config files are not corrupted
- Check if you're running Full Rebuild (re-downloads dependencies)
- Use Smart Rebuild instead for faster builds
- Verify network connection if downloads are slow
- Run Full Rebuild to refresh CMake cache
- Check that all dependencies are installed
- Review CMake error messages in the terminal
- Ensure you're in the project root directory
- Reload VS Code/Cursor window
- Check that
.vscode/tasks.jsonexists
- Build Scripts - Manual build script documentation
- Testing Guide - Comprehensive testing documentation
- Configuration Reference - Server configuration
- Development Setup - Initial setup and dependencies
Last Updated: October 2025