Runfiles for `rust_wasm_bindgen` targets

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

メンテナーはふだん 3 日以内に返信

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

評価

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

調査の方向性

rust_wasm_bindgen ルールとその wasm_file ターゲットから始め、提供されている tar の例を使って、想定されるアーティファクトのレイアウトを理解します。基盤となる rust_binary の runfiles がどのように生成され、生成されたアプリがどのようにパッケージ化されるかを調査します。例で、曖昧な実行可能エントリーポイントを必要とせずに app.runfiles/ を tar に含められれば完了です。

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

説明

wasm

Currently, rust_wasm_bindgen doesn't include runfiles of the underlying wasm_file target which in some cases is a rust_binary that uses the runfiles API as the common way to look up data files at runtime. For example:

load("@tar.bzl", "tar")
load("@rules_rust_wasm_bindgen//:defs.bzl", "rust_wasm_bindgen")

rust_wasm_bindgen(
    name = "app",
    target = "web",
    wasm_file = "//:app",
)

tar(
    name = "archive",
    srcs = [
        "index.html",
        ":app",
    ],
    include_runfiles = True,
)

Currently app is only the generated web files from wasm-bindgen and the .wasm file itself but there is no runfiles tree rendered next to it. I believe this is because rust_wasm_bindgen is not executable and therefore no runfiles tree is created. It would be easy to convert this to an executable but it's unclear what the "entrypoint" would be or if this makes sense semantically as the wasm file nor any of the javascript is directly executable. It would be nice though to have a way to author something like the example and have app.runfiles/ in the tar.

主要言語
Starlark
スター
857
フォーク
701
平均マージ
4日 7時間
マージ済み PR(30日)
46

環境構築

はじめの一歩

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

bazelbuild/rules_rust のほかの issue

bazelbuild/rules_rust の issue をすべて見る

似ている issue

Build System の issue をもっと見る

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

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