Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Tutorial: invalid crate-type syntax and inconsistent command-component example

オープン
#376 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
documentation

調査の方向性

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 calculate but does not explicitly export wasi: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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

bytecodealliance/component-docs のほかの issue

bytecodealliance/component-docs の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。