본문으로 건너뛰기
토파즈6.0 · 출시 전
다운로드 →

문서 검색

명세 6.0

방향키로 결과를 고르고 Enter를 눌러 여세요.

API 이름, 진단 번호, 규칙 또는 프로젝트 주제를 입력하세요.

    도구

    패키지와 잠금 파일 및 대상

    Describe a package in topaz.toml, bind its inputs in topaz.lock, and select the artifact that build produces.

    Package root and entry

    링크

    A package root contains topaz.toml. Package-mode commands load that file from the selected root, which defaults to the current directory. The manifest is read before the package entry source.

    Package loading source

    [package] declares the package name, version, language mode, and entry path. The entry is relative to the package root. License metadata is optional. Unknown top-level sections and unknown fields in supported sections are rejected.

    Manifest sections source · Package fields source

    topaz init --root app creates a native package with a complete entry program. It refuses to overwrite an existing manifest or entry. Use that scaffold as the starting point for the configuration below.

    Scaffold source

    Configuration example

    링크

    Complete native package configuration

    링크
    topaz.tomlComplete native package configuration플레이그라운드 열기 →
    1. [package]
    2. name = "reference_app"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "src/main.tpz"
    6. [build]
    7. target = "native"
    8. deterministic = true
    9. [dependencies]
    10. std = { version = "5.21" }
    src/main.tpzComplete native package configuration플레이그라운드 열기 →
    1. import std.io
    2. export function main(args: Array<string>, stdin: string) -> Result<int, string> {
    3. io.writeLine("Hello from Topaz")
    4. Ok(0)
    5. }
    대상 제품 5.21.3
    기대 결과

    기대 결과

    Configuration example. The command references own executable check, initialization, and lock examples.

    Place both files under the same package root. Run package-mode commands from that root, or select it with --root.

    Dependency identity

    링크

    Each dependency declaration uses a table. A version dependency has version and may have hash. A path dependency has path and requires hash. The table chooses exactly one of version and path. A bare version string is rejected when the package manifest is loaded.

    Dependency declaration source

    Registry dependency compilation requires --locked and matching content under vendor/<name>/<version>. The dependency package name and version must agree with the declaration. A local dependency's manifest name must also agree with its declared name.

    Package dependency loading source

    [exports].module selects the module a dependency exposes as its root. Without that section, its package entry supplies the root. A dependency name that collides with a root module path is rejected. These configuration relationships do not redefine source import syntax.

    What topaz.lock binds

    링크

    topaz.lock records the root package identity and a manifest_hash derived from the manifest text. It also binds declared dependency identities and content hashes. Changing a locked input requires a corresponding lock update.

    Lock verification source · Manifest digest source

    --locked verifies the existing lock before the applicable package operation continues. Missing, stale, duplicate, or undeclared lock entries are rejected. topaz lock writes the lock for the current manifest. It does not waive a mismatched local dependency hash.

    Lock verification also checks declared extern artifacts and replay inputs, plus embedded Lispex source, limits, quotas, and prepared artifacts when present. A matching root manifest hash does not replace those checks.

    Select the build artifact

    링크

    [build].target selects native, web, or web-worker. An omitted build target selects native. Ordinary package loading requires deterministic builds. The separate usage-profile validation path does not enable an unrestricted nondeterministic build.

    Build configuration source

    For package builds, an explicit command target takes precedence over the manifest target. Without a command target, build uses the manifest. Entry-file builds use their command target or the native default. Web targets cannot be combined with automatic execution through --run.

    Package build selection source

    The target describes the resulting artifact. It does not select SELF or the reference compiler. emit has a separate Rust-source target and does not produce a final native or web binary.

    Embedded Lispex configuration

    링크

    [lispex] selects a package-owned evaluator profile and declares at least one [[lispex.rule]]. Each rule has a unique name and distinct project-relative source and limits paths. A package containing this section requires locked compilation.

    Lispex configuration source · Locked package requirement

    An application identifier and its application_quotas file appear together. The application and evaluator profile must be a supported pair. In the current language mode, application configuration also requires the exact standard-library version for that mode.

    Application binding source

    The Lispex admission contract defines package admission and component identities. The factory contract defines generated calls from the verified lock. Installed profile availability requires distribution evidence.

    Lispex lock verification follows the package admission and generated factory contracts. Changing a locked input requires a matching lock update.

    Additional package inputs

    링크

    [capabilities.fs] declares project-relative read and write roots. [extern] declares externally implemented modules and their associated inputs. An extern module cannot occupy a root path already used by a local module or dependency.

    Capability and export declarations · Extern module collision source

    The complete external ABI and host sandbox behavior belong to their own reference contracts. This page records their effect on package identity and lock verification.

    Pending contracts

    링크

    One registry materialization command

    링크
    규칙topaz.tools.registry-command.rule

    One registry materialization command

    Use topaz vendor --from <registry> for registry dependency materialization. topaz fetch is rejected during command validation.

    The vendor command without --from checks existing vendored content and updates the lock. Supplying --from also copies the selected registry content.

    이유

    Both reviewed command names materialize the same dependencies in the vendor directory and write the same lock. They express the same dependency materialization intent. The vendor name identifies the destination.

    One registry materialization command rejection

    계열
    topaz-cli
    단계
    command
    연산
    argument-validation
    분류
    registry-command

    원인과 조건

    Use topaz vendor --from <registry> for registry dependency materialization. topaz fetch is rejected during command validation.

    대응

    Use topaz vendor --from <registry> to materialize registry dependencies.

    One registry materialization command examples

    링크

    Reject the fetch command alias

    링크
    main.tpzReject the fetch command alias플레이그라운드 열기 →
    1. let value = 1
    기대 출력종료 코드 1
    표준 출력 없음.
    $ topaz fetch --root . --from registry · 대상 제품 5.21.3
    topaz.tomlReject the fetch command alias플레이그라운드 열기 →
    1. [package]
    2. name = "tools_registry_example"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [build]
    7. target = "native"
    8. deterministic = true
    9. [dependencies]
    10. sample = { version = "1.0.0" }
    registry/sample/1.0.0/topaz.tomlReject the fetch command alias플레이그라운드 열기 →
    1. [package]
    2. name = "sample"
    3. version = "1.0.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    registry/sample/1.0.0/main.tpzReject the fetch command alias플레이그라운드 열기 →
    1. export let value = 1
    기대 결과

    기대 결과

    거절 단계 command. 종료 코드 1.

    Materialize a registry dependency with vendor

    링크
    main.tpzMaterialize a registry dependency with vendor플레이그라운드 열기 →
    1. let value = 1
    기대 출력종료 코드 0
    표준 출력 없음.
    $ topaz vendor --root . --from registry · 대상 제품 5.21.3
    topaz.tomlMaterialize a registry dependency with vendor플레이그라운드 열기 →
    1. [package]
    2. name = "tools_registry_example"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [build]
    7. target = "native"
    8. deterministic = true
    9. [dependencies]
    10. sample = { version = "1.0.0" }
    registry/sample/1.0.0/topaz.tomlMaterialize a registry dependency with vendor플레이그라운드 열기 →
    1. [package]
    2. name = "sample"
    3. version = "1.0.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    registry/sample/1.0.0/main.tpzMaterialize a registry dependency with vendor플레이그라운드 열기 →
    1. export let value = 1
    기대 결과

    기대 결과

    검사가 프로그램을 받아들입니다. 종료 코드 0.

    Dependency declarations use tables

    링크
    규칙topaz.tools.dependency-table.rule

    Dependency declarations use tables

    Each entry in [dependencies] is a table. A bare version string is rejected while the package manifest is loaded.

    A version dependency uses version and may include hash. A path dependency uses path and requires hash. Each table chooses exactly one of version and path.

    이유

    A version string and a table containing that version select the same dependency. The table preserves this intent and carries version, path, and content hash fields through one declaration structure.

    Dependency declarations use tables rejection

    계열
    topaz-cli
    단계
    package
    연산
    manifest-admission
    분류
    dependency-table

    원인과 조건

    Each entry in [dependencies] is a table. A bare version string is rejected while the package manifest is loaded.

    대응

    Use a table such as std = { version = "5.21" } in [dependencies].

    Dependency declarations use tables examples

    링크

    Reject a version string dependency

    링크
    topaz.tomlReject a version string dependency플레이그라운드 열기 →
    1. [package]
    2. name = "tools_dependency_table"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [dependencies]
    7. std = "5.21"
    main.tpzReject a version string dependency플레이그라운드 열기 →
    1. let value = 1
    기대 출력종료 코드 1
    표준 출력 없음.
    $ topaz lock --root . · 대상 제품 5.21.3
    기대 결과

    기대 결과

    거절 단계 package. 종료 코드 1.

    Lock a table dependency

    링크
    topaz.tomlLock a table dependency플레이그라운드 열기 →
    1. [package]
    2. name = "tools_dependency_table"
    3. version = "0.1.0"
    4. language = "5.21"
    5. entry = "main.tpz"
    6. [dependencies]
    7. std = { version = "5.21" }
    main.tpzLock a table dependency플레이그라운드 열기 →
    1. let value = 1
    기대 출력종료 코드 0
    표준 출력 없음.
    $ topaz lock --root . · 대상 제품 5.21.3
    기대 결과

    기대 결과

    검사가 프로그램을 받아들입니다. 종료 코드 0.

    Related commands and selection

    링크

    Compiler selection →

    init →

    lock →

    build →

    check →

    메뉴

    다운로드 →