Configuration for additional_derives_ignore

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

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
42/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, wasm
領域
cli, tooling

調査の方向性

現在空になっている設定の周辺にある src/bindings.rs から始め、[package.metadata.component.bindings] の derives が生成コードにどのように到達するかを追跡してください。pull request 1199 における wit-bindgen の additional_derives_ignore サポートと比較し、その後、インポートされた wasi:io 型に適用せずに serde derives を設定できることを確認してください。Cargo メタデータから ignore 値が受け入れられ、報告された Deserialize エラーを防げれば完了です。

索引モデルが issue の本文から書いたものです。

説明

wit-bindgen has a feature to disable certain variants and records from being included for the additional_derives:
https://github.com/bytecodealliance/wit-bindgen/pull/1199

Looks like this is just empty currently: https://github.com/bytecodealliance/cargo-component/blob/40a41559a1cd938900823f727e7a9ab4f4ada910/src/bindings.rs#L112

I would like to be able to set the derives for serde, but the generated code has errors due to it adding these derives to imported types from wasi io:

[package.metadata.component.bindings]
derives = ["serde::Serialize", "serde::Deserialize"]

 LastOperationFailed(Error),
                 ^^^^^ the trait `Deserialize<'_>` is not implemented for `bindings::wasi::io::error::Error`

Can this be implemented so that we can specify this value in the Cargo metadata?

主要言語
Rust
スター
593
フォーク
68
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

bytecodealliance/cargo-component のほかの issue

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

似ている issue

Rust の issue をもっと見る

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

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