Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Configuration System

Batuta is configured through batuta.toml with sensible defaults, environment variable overrides, and validation that catches mistakes before the pipeline runs.

Configuration Hierarchy

Settings are resolved in priority order (highest first):

  1. CLI flags: --backend gpu
  2. Environment variables: BATUTA_BACKEND=gpu
  3. Project config: batuta.toml in the project root
  4. User config: ~/.config/batuta/config.toml
  5. Built-in defaults

TOML Structure

[project]
name = "my-migration"
source = "./src"
target = "./rust_out"

[transpilation]
type_hint_mode = "strict"   # strict | lenient | off

[optimization]
backend = "auto"            # auto | gpu | simd | scalar
target_cpu = "native"

[validation]
trace_enabled = true
comparison_tolerance = 1e-6

[build]
profile = "release"
lto = "thin"
codegen_units = 1

[tools]
depyler_min = "0.5.0"
decy_min = "0.3.0"
bashrs_min = "0.2.0"

[dependencies.mapping]
numpy = { crate = "trueno", version = "0.14" }
sklearn = { crate = "aprender", version = "0.24" }

Environment Variable Overrides

Every config key can be overridden with a BATUTA_ prefix:

Config KeyEnvironment Variable
optimization.backendBATUTA_OPTIMIZATION_BACKEND
validation.trace_enabledBATUTA_VALIDATION_TRACE_ENABLED
build.profileBATUTA_BUILD_PROFILE

Validation and Error Reporting

Batuta validates configuration before running:

batuta init --check
RuleError Message
Source directory existssource path does not exist
Languages supportedunsupported language 'fortran'
Backend is validunknown backend 'quantum'
TOML syntax correctparse error at line 12

Default Values

SettingDefaultRationale
backendautoLet Batuta choose based on workload
target_cpunativeBest performance on current machine
trace_enabledtrueSafety first during migration
profilereleaseMigration output should be optimized

Generating a Config File

batuta init --config                          # With defaults and comments
batuta init --from-analysis ./legacy_project  # From existing project

Navigate: Table of Contents