Skip to content

Commit 0c7635b

Browse files
authored
compiler: restore ability to compile from IR (#48)
* compiler: restore ability to compile from IR This feature was lost in a rebase of 5b1569e * compiler: properly handle direct model relative paths * compiler: reject invalid IR as compile input * cli: reject scenario ir missing version
1 parent d9609e4 commit 0c7635b

File tree

25 files changed

+1930
-575
lines changed

25 files changed

+1930
-575
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,8 @@ amber compile path/to/root.json5 --output /tmp/scenario.json
163163
```
164164

165165
You can also use an existing Scenario IR as input for `amber compile` to produce other outputs
166-
(for example, Docker Compose or Kubernetes manifests).
166+
(for example, Docker Compose, Kubernetes, or direct/native runtime artifacts). Scenario IR input
167+
is graph-only, so `--bundle` still requires a manifest or bundle input with manifest source bytes.
167168

168169
### Check-only (linting + diagnostics)
169170

cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ amber-manifest = { workspace = true }
1414
amber-mesh = { workspace = true }
1515
amber-resolver = { workspace = true }
1616
amber-router = { workspace = true }
17+
amber-scenario = { workspace = true }
1718
amber-template = { workspace = true }
1819
base64 = { workspace = true }
1920
clap = { version = "4.5.46", features = ["derive"] }

cli/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Command-line front-end for the compiler. It resolves a root manifest, runs compi
88
- Keep `amber --help` and nested `--help` pages useful enough that users can discover the CLI
99
surface without reading the source.
1010
- Write compile outputs only when requested; `amber compile` requires at least one output flag (`--output`, `--dot`, `--docker-compose`/`--compose`, `--metadata`, `--kubernetes`, `--direct`, or `--bundle`).
11-
- Detect bundle and Scenario IR inputs and emit bundle directories via `--bundle`.
11+
- Detect bundle and Scenario IR inputs for `amber compile`.
12+
- Emit bundle directories via `--bundle` when the input is a manifest or bundle; Scenario IR
13+
inputs do not carry manifest source bytes, so `--bundle` is not available there.
1214
- Run compiled direct artifacts via `amber run <output-dir>` (delegates to the direct init runtime).
1315
- Direct mode requires a local sandbox backend: `bwrap` plus `slirp4netns` on Linux, or `/usr/bin/sandbox-exec` on macOS.
1416
- Direct mode only supports explicit `program.path` executables; it does not resolve bare program names through `PATH`.

0 commit comments

Comments
 (0)