Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dependency output wasm in cargo build #128

Merged
merged 2 commits into from
Apr 19, 2024

Conversation

sksat
Copy link
Member

@sksat sksat commented Apr 18, 2024

概要

#127wasm-opslang crate 内でビルドした wasm ファイルなどを devtools-frontendcargo build 内で使う

変更の意図や背景

  • cargo package のとき、ソースディレクトリ内に Cargo.toml が存在すると問答無用でコピー対象から外れてしまう(Setup NodeJS 21 in Rust workflows for integrated frontend build #120
    • このため、devtools-frontend crate 内で wasm の crate をビルドするのは無理がある
  • そこで、 Invoke wasm-pack in wasm crate build script to package wasm into $OUT_DIR #127wasm-opslang crate 内で wasm のビルドまでを行い、$OUT_DIR に出力するようにした
  • wasm-opslang crate 内でビルドした wasm ファイルなどを devtools-frontend crate の build.rs 内で vite から扱えるディレクトリ構造にコピーして使う
  • これで devtools-frontend crate 内で wasm-pack build をする必要が無くなったため、そのロジックを削除

発端となる Issue

@sksat sksat self-assigned this Apr 18, 2024
@sksat sksat requested a review from KOBA789 as a code owner April 18, 2024 12:06
devtools-frontend/build.rs Show resolved Hide resolved
Base automatically changed from invoke-wasm-pack-in-cargo-build to main April 19, 2024 08:37
@KOBA789 KOBA789 merged commit 7bf96f9 into main Apr 19, 2024
4 checks passed
@KOBA789 KOBA789 deleted the use-dependency-output-wasm-in-cargo-build branch April 19, 2024 08:38
@sksat sksat added this to the v0.7.0 milestone Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants