Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Risingwavelabs Risingwave Cargo Workspace Configuration

From Leeroopedia


Knowledge Sources
Domains Build, Configuration, Rust
Last Updated 2026-02-09 07:00 GMT

Overview

Root Cargo workspace manifest that defines all crate members, shared dependency versions, build profiles, lint rules, and patch overrides for the entire RisingWave project.

Description

The Cargo.toml at the repository root is the central workspace configuration governing the Rust build for RisingWave. It declares over 70 workspace members spanning core components (batch, stream, frontend, meta, storage, connector), utility crates, test harnesses, and tooling. All shared dependencies are pinned in [workspace.dependencies] to ensure consistent versions across the workspace. The file also defines multiple build profiles (dev, release, production, ci-release, ci-dev, ci-sim) with varying optimization levels and debug information settings, and applies workspace-wide lint rules for both rustc and clippy.

Usage

This file is consumed automatically by cargo for every build, test, and check operation. Developers modify it when adding new crates, updating shared dependency versions, adjusting build profiles, or changing lint policies.

Code Reference

Source Location

  • Repository: risingwave
  • File: Cargo.toml
  • Lines: L1-441

Signature

[workspace]
members = [
    "src/batch",
    "src/cmd",
    "src/cmd_all",
    "src/common",
    "src/compute",
    "src/connector",
    "src/frontend",
    "src/meta",
    "src/storage",
    "src/stream",
    # ... 60+ additional members
]
resolver = "2"

[workspace.package]
version = "2.9.0-alpha"
edition = "2024"

Import

# No explicit import needed - Cargo reads this automatically
# Build the project
cargo build
# Or via risedev
./risedev b

I/O Contract

Inputs

Name Type Required Description
Workspace members Directory paths Yes Crate directories listed under [workspace.members]
Dependency specifications TOML entries Yes Shared dependency versions under [workspace.dependencies]
Build profile Profile name No Selected via --profile flag (dev, release, production, ci-release, ci-dev, ci-sim)

Outputs

Name Type Description
Compiled binaries Executables Built into target/{profile}/ directory
Dependency lockfile Cargo.lock Resolved dependency versions
Build timing HTML report Generated via --timings flag in build tasks

Key Sections

Workspace Members -- Over 70 crates organized into logical groups:

  • Core engines: batch, stream, storage, frontend, meta, compute
  • Connectors: connector, connector/codec, connector/with_options
  • Expressions: expr/core, expr/impl, expr/macro
  • Storage: storage, storage/backup, storage/compactor, storage/hummock_sdk
  • Utilities: pgwire, futures_util, iter_util, runtime, sync-point
  • Testing: simulation, sqlsmith, compaction_test, e2e_extended_mode

Build Profiles:

Profile LTO Debug Incremental Use Case
dev off default yes Local development
release off full yes Local release builds
production thin full no Production deployments
ci-release off line-tables-only no CI release testing with debug assertions
ci-dev off line-tables-only no CI dev testing with external dep optimization
ci-sim off line-tables-only no Deterministic simulation testing (opt-level 2)

Lint Configuration:

  • unused_must_use is set to forbid to prevent misuse of #[allow(unused)]
  • clippy::dbg_macro, clippy::str_to_string, and clippy::await_holding_lock are warnings
  • clippy::ptr_arg and clippy::new_without_default are allowed for pragmatic reasons

Patch Overrides: Several crates are patched for deterministic simulation (madsim) compatibility, including getrandom, tokio-retry, tokio-postgres, sqlx, prost, and rdkafka-sys.

Usage Examples

Building the Project

# Standard dev build via risedev
./risedev b

# Build with production profile
cargo build --profile production -p risingwave_cmd_all

# Build for CI
cargo build --profile ci-release -p risingwave_cmd_all

Adding a New Workspace Member

# In Cargo.toml [workspace] members list:
[workspace]
members = [
    # ... existing members
    "src/my_new_crate",
]

# Then declare the crate dependency for workspace sharing:
[workspace.dependencies]
risingwave_my_new_crate = { path = "./src/my_new_crate" }

Related Pages

Implements Principle

Related Implementations

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment