home / skills / redisearch / redisearch / build

build skill

/.skills/build

This skill compiles the project to verify changes build successfully across c and rust builds, accelerating development feedback.

npx playbooks add skill redisearch/redisearch --skill build

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
922 B
---
name: build
description: Compile the project to verify changes build successfully
---

# Build Skill

Compile the project to verify changes build successfully.

## Usage
Run this skill after making code changes to verify they compile.

## Instructions

1. For a full build (C + Rust):
   ```bash
   ./build.sh
   ```

2. For Rust-only build (faster iteration):
   ```bash
   cd src/redisearch_rs && cargo build
   ```
   Always build the C code at least **once** before running the Rust-only build.

3. If build fails:
   - Read the compiler errors carefully
   - Fix the issues
   - Re-run the build

4. If you update C code, re-build the C code before running the Rust-only build:
   ```bash
   ./build.sh
   cd src/redisearch_rs && cargo build
   ```

## Clean Build

If you encounter strange build errors:
```bash
./build.sh FORCE
```

For Rust only:
```bash
cd src/redisearch_rs && cargo clean && cargo build
```

Overview

This skill compiles the project to verify code changes build successfully. It supports full builds (C + Rust) and faster Rust-only iteration, with helpers for clean and forced builds. Use it to catch compilation issues early and ensure native modules and Rust bindings are synchronized.

How this skill works

The skill runs the top-level build script for a complete C and Rust compilation, or invokes Cargo inside the Rust binding directory for Rust-only builds. It inspects compiler output and returns success/failure so you can iterate on errors. It also provides commands for forced rebuilds and cleaning Rust artifacts when build issues appear persistent.

When to use it

  • After making changes to C sources to verify native module compiles
  • After modifying Rust bindings or logic for a quick verification
  • Before submitting a patch or PR to ensure no compilation regressions
  • When CI reports build failures and you want to reproduce locally
  • When switching branches that change build artifacts or dependencies

Best practices

  • Perform a full build once after C changes to ensure native code and Rust bindings are aligned
  • Use Rust-only builds for fast iterations while working exclusively in the Rust codepath
  • Run ./build.sh FORCE if you encounter unexplainable or stale build errors
  • Read compiler output carefully and fix root causes before re-running the build
  • Use cargo clean in src/redisearch_rs when Rust artifacts seem corrupted

Example use cases

  • Make a small bugfix in Rust bindings and run cargo build in src/redisearch_rs for quick verification
  • Change C data structures or APIs, run ./build.sh to compile both C and Rust components together
  • Reproduce a CI build failure locally by running the full build script and inspecting errors
  • Resolve flaky build errors with ./build.sh FORCE or cargo clean followed by cargo build
  • Integrate a new dependency: perform full build to ensure link-time and native compatibility

FAQ

Can I skip the C build when I only change Rust code?

Yes. For faster iteration, build only the Rust crate with cargo build in src/redisearch_rs, but ensure you’ve done a full C build at least once after C changes.

What should I do if the build still fails after fixes?

Double-check compiler messages, run a forced clean (./build.sh FORCE or cargo clean) and rebuild. If errors persist, isolate the failing component and reproduce with minimal changes.