Tutorial: invalid crate-type syntax and inconsistent command-component example
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
調査の方向性
Start with the Create a command component section in tutorial.html, then compare it with examples/tutorial/command/src/main.rs, examples/tutorial/command/Cargo.toml, and examples/tutorial/wit/calculator/world.wit. Choose one entrypoint approach and make the tutorial and completed example consistent, including valid crate-type syntax where applicable. Verify the documented project with cargo metadata --no-deps --format-version 1 --offline and the tutorial's build steps.
索引モデルが issue の本文から書いたものです。
説明
The Create a command component section has two problems: an invalid Cargo configuration and a mismatch between the library-based instructions and the linked binary example.
1. Invalid crate-type syntax
The tutorial asks readers to create a library with cargo new --lib example and add:
[lib]
crate-type = "cdylib"
Running cargo metadata --no-deps --format-version 1 --offline in that project fails with:
error: invalid type: string "cdylib", expected a sequence
Reproduced with Cargo 1.98.1. The configuration should be:
[lib]
crate-type = ["cdylib"]
2. The completed example uses a different entrypoint approach
The tutorial creates a library crate and asks readers to add export wasi:cli/run@0.2.7 to the app world. However, its linked completed example is a binary:
- src/main.rs uses an ordinary
fn main(). - Cargo.toml has no
[lib]configuration. - The app world imports
calculatebut does not explicitly exportwasi:cli/run.
Both approaches are valid, but copying that main() into the tutorial's library project does not implement the requested wasi:cli/run export. Fixing the manifest syntax alone does not resolve this mismatch.
The tutorial and completed example should use the same approach: either keep the cdylib instructions and provide the explicit run implementation and export, or use a binary project built for wasm32-wasip2, where Rust supplies the entrypoint for main().
- 主要言語
- Rust
- スター
- 137
- フォーク
- 88
- 平均マージ
- 10時間 38分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bytecodealliance/component-docs のほかの issue
-
難易度 2/5 半日 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
bytecodealliance/component-docs#294 · コメント 1 件 ·
-
Fix Python Tutorial オープンbug lang/python
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
bytecodealliance/component-docs#348 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
bytecodealliance/component-docs の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
state:needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
zed-industries/zed#64680 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
RustPython/RustPython#8802 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
TheLarkInn/aipm#2390 ·