x07-bundle

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

x07-bundle

x07-bundle

Use
x07 bundle
to produce a native executable that can be run directly on the target machine without the X07 toolchain installed at runtime.
x07 bundle
runs the canonical auto-repair loop by default (
--repair=...
), so it can format/lint/apply quickfixes before compiling. Use
--repair=off
when debugging.
使用
x07 bundle
生成原生可执行文件,无需在运行时安装X07工具链即可直接在目标机器上运行。
默认情况下,
x07 bundle
会运行标准的自动修复循环(
--repair=...
),因此它可以在编译前进行格式化、代码检查并应用快速修复。调试时请使用
--repair=off
参数。

Canonical commands

标准命令

  • Bundle an OS-world CLI executable:
    • x07 bundle --project x07.json --profile os --out dist/app
    • run it:
      ./dist/app --help
    • if bundling fails with
      fuel exhausted
      , override:
      • x07 bundle --project x07.json --profile os --solve-fuel 500000000 --out dist/app
  • Bundle a policy-enforced OS-world executable:
    • x07 bundle --project x07.json --profile sandbox --out dist/app
    • requires a base policy (via
      profiles.sandbox.policy
      or
      --policy
      )
  • 打包生成适用于操作系统环境的CLI可执行文件:
    • x07 bundle --project x07.json --profile os --out dist/app
    • 运行它:
      ./dist/app --help
    • 如果打包时出现
      fuel exhausted
      错误,可覆盖默认值:
      • x07 bundle --project x07.json --profile os --solve-fuel 500000000 --out dist/app
  • 打包生成受策略约束的操作系统环境可执行文件:
    • x07 bundle --project x07.json --profile sandbox --out dist/app
    • 需要基础策略(通过
      profiles.sandbox.policy
      --policy
      参数指定)

Runtime ABI

运行时ABI

The bundled executable:
  • reads standard process args (
    argc/argv
    )
  • encodes them into
    argv_v1
    input bytes
  • calls the compiled program entrypoint (
    x07_solve_v2
    )
  • writes program output bytes directly to stdout (no framing)
打包后的可执行文件:
  • 读取标准进程参数(
    argc/argv
  • 将它们编码为
    argv_v1
    输入字节
  • 调用编译后的程序入口点(
    x07_solve_v2
  • 将程序输出字节直接写入标准输出(无帧处理)

Emit artifacts (debug / CI)

生成构件(调试/持续集成)

  • x07 bundle ... --emit-dir dist/emit
    • emits
      report.json
      ,
      program.freestanding.c
      ,
      wrapper.main.c
      , and
      bundle.combined.c
    • for
      run-os-sandboxed
      , also emits
      policy.used.json
  • x07 bundle ... --emit-dir dist/emit
    • 生成
      report.json
      program.freestanding.c
      wrapper.main.c
      bundle.combined.c
      文件
    • 对于
      run-os-sandboxed
      模式,还会生成
      policy.used.json
      文件

Report contract

报告约定

x07 bundle
prints a machine JSON report to stdout:
  • schema_version: "x07.bundle.report@0.2.0"
  • report
    contains the underlying runner report used to compile the native artifact
x07 bundle
会向标准输出打印一份机器可读的JSON报告:
  • schema_version: "x07.bundle.report@0.2.0"
  • report
    字段包含用于编译原生构件的底层运行器报告