@ai-ecoverse/wasi-rustc

中文文档
1.98.1-10发布于 2026/10/21(MIT OR Apache-2.0) AND Apache-2.0 WITH LLVM-exception零依赖构建来源已验证近 30 天下载 3115

The Rust compiler, to build Rust programs in SLICC.

原始使用文档
文档目录3 节
  1. Layout
  2. Environment
  3. LTO

@ai-ecoverse/wasi-rustc

rustc 1.98.1 (LLVM-in-wasm) for slicc. Host: wasm32-wasip1-threads. Default compile target: wasm32-wasip1.

  • rustc --version, rustc -vV (LLVM 21.1.8), rustc hello.rs -o hello.wasm, -O, std::fs / std::env / std::process::exit, --extern crates.
  • Linker: LLD inside rustc.wasm (no separate rust-lld).
  • Proc macros run as child processes (WASIX proc_spawn3), so derives work under @ai-ecoverse/wasi-cargo.
  • Compile errors exit with status 1.

Built by homescoop's ladder from rustc-1.98.1-src.tar.xz with the patches in the recipe, against @ai-ecoverse/wasi-llvm 21.1.8 and wasi-sdk 34.

Layout

  • bin/rustc: shell driver (adds --sysroot and --target, keeps PATH)
  • bin/rustc.wasm: the compiler (wasip1-threads host), without its name section; @ai-ecoverse/wasi-rustc-names has the function names for SLICC_WASM_BACKTRACE
  • lib/rustlib/wasm32-wasip1/: std/core/alloc and the self-contained crt

Environment

  • RUST_MIN_STACK=16777216 (set by the package: LLVM needs a large stack)

LTO

-C lto=fat and -C lto=thin (Cargo's lto = true / "fat" / "thin") aren't available: rustc.wasm's LLVM (wasi-llvm 21) can't read the standard library's bitcode, which Rust's LLVM 22 wrote, so rustc says so and stops (homescoop#1237). An rlib with -C lto builds as before: it reads no upstream bitcode (1.98.1-9, homescoop#1464). The refusal comes before any output is written, so a refused build (say --crate-type rlib,cdylib) leaves nothing behind (1.98.1-10, homescoop#1543). Local ThinLTO, the default, works.

版本与发布记录

@ai-ecoverse/wasi-rustc 共发布 15 个版本,首次发布于 2026/10/01;过去 12 个月发布了 15 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.98.1-10latest2026/10/2117 天前
1.98.1-92026/10/2117 天前
1.98.1-82026/10/2117 天前
1.98.1-72026/10/2118 天前
1.98.1-62026/10/1919 天前
1.98.1-52026/10/1821 天前

关于 @ai-ecoverse/wasi-rustc 的常见问题

@ai-ecoverse/wasi-rustc 是什么?

The Rust compiler, to build Rust programs in SLICC.

如何安装 @ai-ecoverse/wasi-rustc?

在项目目录运行 npm install @ai-ecoverse/wasi-rustc,或使用 pnpm add / yarn add / bun add。

@ai-ecoverse/wasi-rustc 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/ai-ecoverse__wasi-rustc 是否存在。

@ai-ecoverse/wasi-rustc 可以商用吗?

@ai-ecoverse/wasi-rustc 使用 (MIT OR Apache-2.0) AND Apache-2.0 WITH LLVM-exception 许可。可在 MIT、Apache-2.0) AND Apache-2.0 WITH LLVM-exception 中任选其一遵守。选择 MIT 时,宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ai-ecoverse/wasi-rustc 的下载量有多少?

根据 npm 官方下载统计,@ai-ecoverse/wasi-rustc 在 2026/10/05 – 2026/11/03 这 30 天内被下载 3,115 次,日均约 104 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ai-ecoverse/wasi-rustc 还在维护吗?

最新版本 1.98.1-10 发布于 2026/10/21(17 天前);至今共发布 15 个版本,其中过去 12 个月发布了 15 个;首次发布于 2026/10/01。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。