Runfiles for `rust_wasm_bindgen` targets

Đang mở
#4,172 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 3 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust, wasm
Lĩnh vực
build-system, tooling

Hướng nghiên cứu

Bắt đầu với rule rust_wasm_bindgen và target wasm_file của nó, sử dụng ví dụ tar được cung cấp để hiểu layout artifact được mong đợi. Điều tra cách runfiles được tạo cho rust_binary nền tảng và cách app được tạo ra được đóng gói. Công việc được hoàn thành khi ví dụ có thể include app.runfiles/ trong tar mà không yêu cầu một executable entrypoint không rõ ràng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Starlark
Star
857
Fork
701
Merge trung bình
4 ngày 7 giờ
Pull request đã merge (30 ngày)
46

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bazelbuild/rules_rust

Tất cả issue của bazelbuild/rules_rust

Issue tương tự

Thêm issue về Build System

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.