scadable compile

Run the full pipeline and produce gateway artifacts.

scadable compile
scadable compile --target linux --output dist
scadable compile --target esp32              # raises TargetNotImplementedError
FlagDefaultNotes
--target <name>linuxOne of linux, esp32, rtos. ESP and RTOS are preview.
--output <dir>outWhere to write artifacts
-vfalseVerbose: print each pipeline stage

What it produces

Run with the default Linux target:

out/
├── drivers/
│   ├── line-sensor.yaml
│   └── env-sensor.yaml
├── manifest.json
└── bundle.tar.gz

Three artifacts, each with a job:

  • drivers/<id>.yaml is the driver config the gateway reads to spawn a Modbus subprocess. One file per device. The gateway watches /etc/scadable/devices/<id>/config.yaml and reloads when this file changes.
  • manifest.json is the project manifest. Project name, version, target, full device + controller + model inventory. The dashboard reads this to display what is deployed.
  • bundle.tar.gz is everything together (drivers, manifest, models). Ship this single file to the gateway.

Verifying the output

Inspect the bundle without unpacking it:

tar -tzf out/bundle.tar.gz

Read a driver config:

cat out/drivers/line-sensor.yaml

Read the manifest:

jq . out/manifest.json

Targets

scadable compile --target linux works today. --target esp32 and --target rtos raise TargetNotImplementedError with the planned release version. The DSL still validates against these targets, so you can author forward-compatible projects:

scadable verify --target esp32        # full capability check
scadable compile --target esp32       # raises TargetNotImplementedError

Exit codes

CodeMeaning
0Build succeeded
1Validation errors (run scadable verify for details)
2Emit failure (disk full, permissions, etc.)

In CI

scadable verify --target linux && \
scadable compile --target linux --output dist

The two commands are idempotent. Compile re-runs verify internally; verify-then-compile gives you a cleaner failure mode if validation breaks.

Next steps