Runfiles for `rust_wasm_bindgen` targets

Abierto
#4,172 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 3 días

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
rust, wasm

Línea de trabajo

Comienza con la regla rust_wasm_bindgen y su destino wasm_file, usando el ejemplo de tar proporcionado para entender la disposición esperada del artefacto. Investiga cómo se producen los runfiles para el rust_binary subyacente y cómo se empaqueta la aplicación generada. Se considera terminado cuando el ejemplo puede incluir app.runfiles/ en el tar sin requerir un punto de entrada ejecutable ambiguo.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Starlark
Estrellas
857
Forks
701
Merge medio
4 d 7 h
PR fusionados (30 d)
46

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de bazelbuild/rules_rust

Todos los issues de bazelbuild/rules_rust

Issues similares

Más issues de Build System

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.