Invocation, options and results
링크topaz emit
topaz emit [entry]
입력
topaz emit [entry] accepts one optional source entry. Without an entry it loads the package at -, defaulting to the current directory. With an entry, the default root is its directory.
The output target is rust. - selects it explicitly and any other target is rejected. Without -, the primary source is written to standard output. With -, the directory value must be nonempty.
- selects self or rust. - selects boxed or native. The defaults are self and boxed. Native lowering requires -.
- requires native lowering and a nonempty file path. It requests a separate lowering report and does not select JSON presentation for emitted source.
A package with a reached Lispex application requires - so that its runtime closure can accompany the generated source. Program arguments, -, -, output-format options, missing values, repeated options, attached values, and additional entries are rejected.
옵션과 충돌
| 옵션 | 기본값 | 계약 | 충돌 |
|---|---|---|---|
--compiler rust|self | self | compiler selector (default self); rust selects the reference compiler Also rejects combination with --producer, --self-source. | 없음 |
--locked | false | Verify topaz.lock before compiling the selected package. | 없음 |
--verbose | false | Reports the selected compiler and whether it was explicit or the default. For | 없음 |
--root <dir> | entry directory; . in package mode | The explicit source root or package root for this invocation. | 없음 |
--out-dir <dir> | 미지정 | expose generated Rust source for inspection/integration ( | 없음 |
--native-report-json <file> | 미지정 | checked native emit/build only: atomically write a deterministic lowering decision report without changing normal output or artifacts | 없음 |
--backend boxed|native | boxed | emit/build: lowering backend (default boxed). Native specialization requires --compiler rust. | 없음 |
--target rust | rust | emit only: generated source target (default rust) | 없음 |
--language-version <5.21> | 5.21 | language version selector | 없음 |
--compiler-memory-mib <MiB> | 8192 | self compiler worker memory budget (8192); overrides TOPAZ_COMPILER_MEMORY_MIB A positive integer is required. Environment input: TOPAZ_COMPILER_MEMORY_MIB. | 없음 |
--compiler-time-ms <ms> | 1800000 | self compilation wall-clock budget (1800000); overrides TOPAZ_COMPILER_TIME_MS A positive integer is required. Environment input: TOPAZ_COMPILER_TIME_MS. | 없음 |
출력 채널
stdout
stderr
종료 상태
0
The requested source stream or complete crate was emitted successfully.
1
Invalid arguments, input or lock failures, parsing, resolution, checking or lowering failures, unsupported compiler or profile combinations, resource exhaustion, missing runtime components, and output or report write failures.
효과
The command reads the selected source and applicable package inputs. Emitting to standard output creates no output crate. Compiler workspaces may be created by the selected compiler.
- creates the crate directory and writes the generated crate files and admitted runtime closure. Existing files with generated paths may be replaced. Files outside the chosen output directory are not crate outputs.
The optional native report is staged and published at its explicit path. It does not grant authority to modify the input manifest or lock. A failed crate write can leave files already written during that invocation.
Emission uses local package content and the installed runtime closure without network access. It neither invokes Cargo to build the crate nor executes the generated program.
Identical source and package bytes, lock identities, compiler, language mode, backend, and runtime components produce identical generated source and crate content. Generated content does not depend on enumeration order, wall-clock time, or a random workspace name.
Diagnostics can include input paths and the completion line includes the chosen destination. Comparing those streams requires the same path inputs.
- verifies an existing package lock before compilation. Registry dependencies and Lispex configuration require it. Missing or mismatched dependencies fail rather than being materialized.
Emission leaves topaz. and topaz. unchanged. The generated crate's Cargo. binds its embedded Rust runtime closure and does not replace the Topaz package lock.
Operation
링크Choose an output directory when the complete source set is needed. Standard output carries the primary generated source.
Option conditions
링크- applies to emit, build, or init only
- applies to emit/build only
- applies to emit/build only
- requires -
--locked applies to package-mode check, run, emit, build, test, doc, bench, compiler observe, compiler preview. Selected-entry test also accepts it when --root contains topaz.toml.
- cannot be combined with bootstrap - or -
a reached Lispex application requires emit - so its exact conditional runtime closure can be written
Behavior contract
링크Command behavior
Arguments and rejection
topaz emit [entry] accepts one optional source entry. Without an entry it loads the package at -, defaulting to the current directory. With an entry, the default root is its directory.
The output target is rust. - selects it explicitly and any other target is rejected. Without -, the primary source is written to standard output. With -, the directory value must be nonempty.
- selects self or rust. - selects boxed or native. The defaults are self and boxed. Native lowering requires -.
- requires native lowering and a nonempty file path. It requests a separate lowering report and does not select JSON presentation for emitted source.
A package with a reached Lispex application requires - so that its runtime closure can accompany the generated source. Program arguments, -, -, output-format options, missing values, repeated options, attached values, and additional entries are rejected.
Output
Without -, standard output contains the primary UTF-8 generated Rust source and no human banner. Standard error carries diagnostics and requested verbose compiler details.
With -, standard output is empty and standard error identifies the completed self-contained crate. The crate contains generated source, Cargo., Cargo., pinned toolchain information, the vendored runtime closure, and source-distribution notices.
- is rejected because emit has no JSON report mode. The optional native lowering report is written to its requested file with schema identifier topaz.. It does not change ordinary output channels.
No source output is produced for an argument, package, resolution, checking, or lowering failure. A later output I/O error can leave a partial stream or partially written crate and is reported as failure.
Exit status
Exit code 0 means the requested source stream or complete crate was emitted successfully.
Exit code 1 covers invalid arguments, input or lock failures, parsing, resolution, checking or lowering failures, unsupported compiler or profile combinations, resource exhaustion, missing runtime components, and output or report write failures.
Filesystem effects
The command reads the selected source and applicable package inputs. Emitting to standard output creates no output crate. Compiler workspaces may be created by the selected compiler.
- creates the crate directory and writes the generated crate files and admitted runtime closure. Existing files with generated paths may be replaced. Files outside the chosen output directory are not crate outputs.
The optional native report is staged and published at its explicit path. It does not grant authority to modify the input manifest or lock. A failed crate write can leave files already written during that invocation.
Network access
Emission uses local package content and the installed runtime closure without network access. It neither invokes Cargo to build the crate nor executes the generated program.
Reproducibility
Identical source and package bytes, lock identities, compiler, language mode, backend, and runtime components produce identical generated source and crate content. Generated content does not depend on enumeration order, wall-clock time, or a random workspace name.
Diagnostics can include input paths and the completion line includes the chosen destination. Comparing those streams requires the same path inputs.
Packages and locks
- verifies an existing package lock before compilation. Registry dependencies and Lispex configuration require it. Missing or mismatched dependencies fail rather than being materialized.
Emission leaves topaz. and topaz. unchanged. The generated crate's Cargo. binds its embedded Rust runtime closure and does not replace the Topaz package lock.
이유
Emitting source supports inspection and integration, while building requests an executable artifact. These intentions remain distinct even when a later external build produces the same program. The lowering report is also distinct from the emitted source.
The linked public CLI recipe checks the exact displayed argument rejection before the requested operation. It does not execute the successful operation or verify its effects.
Successful source emission and crate creation are outside the exact reviewed execution allowlist. The linked safe recipe rejects an invalid target. Runtime closure and artifact checks remain for the administrator's CI rather than new unreviewed runner arguments.
Example contract
링크Example contract
The invocation topaz emit main. is expected to exit with 1.
Reject an unsupported target during argument validation before producing source, building a program, or creating a binary.
이유
An output target selects the representation of the generated program. Rejecting an unknown target prevents the command from producing a different representation than requested.
Example
링크Argument-rejection example
링크function identity<T>(value: T) -> T {value}
기대 결과
기대 결과
Textual rejection details remain Pending in the reference model. The independent Tools example gate expects exit 1.
Reject an unsupported target during argument validation before producing source, building a program, or creating a binary.
Verification scope
링크Observed with Topaz 5.21.3 on 2026-11-06T08:36:29.642Z. This invocation passed; exit 1. 3 assertions were evaluated against the independent expected result. Execution record. This result covers the displayed invocation.