Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen
#376 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
68/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
documentation

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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/[email protected] 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().

Vorherrschende Sprache
Rust
Sterne
138
Forks
89
Ø Merge
10 Std. 38 Min.
Gemergte PRs (30 T.)
2

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus bytecodealliance/component-docs

Alle Issues in bytecodealliance/component-docs

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.