rust:rhai

文書の過去の版を表示しています。


Rhai - Rust 用の組み込みスクリプト

$ rustup target add wasm32-unknown-unknown

info: downloading component 'rust-std' for 'wasm32-unknown-unknown'
info: installing component 'rust-std' for 'wasm32-unknown-unknown'
 20.1 MiB /  20.1 MiB (100 %)   4.9 MiB/s in  4s         
$ cargo binstall wasm-bindgen-cli         
 INFO resolve: Resolving package: 'wasm-bindgen-cli'
 WARN The package wasm-bindgen-cli v0.2.105 (x86_64-unknown-linux-musl) has been downloaded from github.com
 INFO This will install the following binaries:
 INFO   - wasm-bindgen => /home/tomoyan/.cargo/bin/wasm-bindgen
 INFO   - wasm-bindgen-test-runner => /home/tomoyan/.cargo/bin/wasm-bindgen-test-runner
 INFO   - wasm2es6js => /home/tomoyan/.cargo/bin/wasm2es6js
Do you wish to continue? [yes]/no
? 
 INFO Installing binaries...
 INFO Done in 13.319376311s

$ bun install

bun install v1.3.1 (89fa0f34)
[149.72ms] migrated lockfile from package-lock.json

+ @open-wc/webpack-import-meta-loader@0.4.7
+ buefy@0.8.20
+ codemirror@5.65.16
+ css-loader@3.6.0
+ file-loader@6.2.0
+ style-loader@1.3.0
+ vue@2.7.16
+ vue-loader@15.11.1
+ vue-template-compiler@2.7.16
+ wasm-pack@0.12.1
+ @types/codemirror@0.0.96
+ @wasm-tool/wasm-pack-plugin@1.7.0
+ copy-webpack-plugin@5.1.2
+ git-revision-webpack-plugin@3.0.6
+ raw-loader@4.0.2
+ rimraf@3.0.2
+ webpack@4.47.0
+ webpack-cli@3.3.12
+ webpack-dev-server@3.11.3
+ workerize-loader@1.3.0

661 packages installed [13.24s]

Blocked 1 postinstall. Run `bun pm untrusted` for details.

$ bun pm untrusted

bun pm untrusted v1.3.1 (89fa0f34)

./node_modules/wasm-pack @0.12.1
 » [postinstall]: node ./install.js

These dependencies had their lifecycle scripts blocked during install.

If you trust them and wish to run their scripts, use `bun pm trust`.

$ bun run build

$ rimraf dist pkg && webpack
🧐  Checking for wasm-pack...

✅  wasm-pack is installed at /home/tomoyan/my_projects/_crates_src/playground/node_modules/.bin/wasm-pack. 

ℹ️  Compiling your crate in release mode...

[INFO]: 🎯  Checking for the Wasm target...
[INFO]: 🌀  Compiling to Wasm...
warning: Found `debug_assertions` in `target.'cfg(...)'.dependencies`. This value is not supported for selecting dependencies and will not work as expected. To learn more visit https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html#platform-specific-dependencies
   Compiling unicode-ident v1.0.20
   Compiling proc-macro2 v1.0.101
   Compiling quote v1.0.41
   Compiling wasm-bindgen-shared v0.2.104
   Compiling portable-atomic v1.11.1
   Compiling serde_core v1.0.228
   Compiling rustversion v1.0.22
   Compiling bumpalo v3.19.0
   Compiling syn v2.0.107
   Compiling log v0.4.28
   Compiling serde_json v1.0.145
   Compiling serde v1.0.228
   Compiling wasm-bindgen v0.2.104
   Compiling ryu v1.0.20
   Compiling itoa v1.0.15
   Compiling memchr v2.7.6
   Compiling once_cell v1.21.3
   Compiling cfg-if v1.0.4
   Compiling autocfg v1.5.0
   Compiling libc v0.2.177
   Compiling crunchy v0.2.4
   Compiling version_check v0.9.5
   Compiling tiny-keccak v2.0.2
   Compiling ahash v0.8.11
   Compiling smartstring v1.0.1
   Compiling num-traits v0.2.19
   Compiling getrandom v0.2.16
   Compiling zerocopy v0.7.35
   Compiling wasm-bindgen-backend v0.2.104
   Compiling const-random-macro v0.1.16
   Compiling const-random v0.1.18
   Compiling static_assertions v1.1.0
   Compiling wasm-bindgen-macro-support v0.2.104
   Compiling thin-vec v0.2.14
   Compiling smallvec v1.15.1
   Compiling bitflags v2.10.0
   Compiling serde_derive v1.0.228
   Compiling rhai_codegen v3.1.0
   Compiling wasm-bindgen-macro v0.2.104
   Compiling js-sys v0.3.81
   Compiling console_error_panic_hook v0.1.7
   Compiling web-sys v0.3.81
   Compiling instant v0.1.13
   Compiling rhai v1.23.3
   Compiling rhai-playground v0.2.1 (/home/tomoyan/my_projects/_crates_src/playground)
warning: use of deprecated associated function `wasm_bindgen::JsValue::from_serde`: causes dependency cycles, use `serde-wasm-bindgen` or `gloo_utils::format::JsValueSerdeExt` instead
  --> src/scripting.rs:92:14
   |
92 |     JsValue::from_serde(&res).unwrap()
   |              ^^^^^^^^^^
   |
   = note: `#[warn(deprecated)]` on by default

warning: `rhai-playground` (lib) generated 1 warning
    Finished `release` profile [optimized] target(s) in 1m 53s
[INFO]: ⬇️  Installing wasm-bindgen...
[INFO]: Optimizing wasm binaries with `wasm-opt`...
Error: invalid type: map, expected a string at line 2 column 18
Caused by: invalid type: map, expected a string at line 2 column 18
Hash: 3e0c2fac679e24749860
Version: webpack 4.47.0
Time: 197745ms
Built at: 2025/11/11 2:21:56
 97 assets
Entrypoint index = index.js
  [0] ./pkg/index.js 23.1 KiB {0} [built]
  [1] ./js/wasm_loader.js + 1 modules 946 bytes {0} [built]
      | ./js/wasm_loader.js 860 bytes [built]
      | ./pkg/index_bg.wasm 81 bytes [built]
  [2] (webpack)/buildin/global.js 472 bytes {0} [built]
  [3] ./js/index.js 1.24 KiB {0} [built]
  [4] (webpack)/buildin/harmony-module.js 573 bytes {0} [built]
  [6] ./js/init.js + 26 modules 54.2 KiB {2} [built]
      | ./js/init.js 652 bytes [built]
      | ./js/playground.vue 665 bytes [built]
      | ./js/playground.vue?vue&type=template&id=edbf0ef0&scoped=true 283 bytes [built]
      | ./js/playground.vue?vue&type=script&lang=js 424 bytes [built]
      | ./node_modules/@open-wc/webpack-import-meta-loader/webpack-import-meta-loader.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--4!./node_modules/vue-loader/lib??vue-loader-options!./js/playground.vue?vue&type=template&id=edbf0ef0&scoped=true 19.6 KiB [built]
      | ./node_modules/@open-wc/webpack-import-meta-loader/webpack-import-meta-loader.js!./node_modules/vue-loader/lib??vue-loader-options!./js/playground.vue?vue&type=script&lang=js 11.9 KiB [built]
      | ./js/playground-runner.js 4.51 KiB [built]
      |     + 20 hidden modules
 [17] ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib??vue-loader-options!./js/playground.vue?vue&type=style&index=0&id=edbf0ef0&prod&scoped=true&lang=css 703 bytes {2} [built]
 [18] ./node_modules/style-loader/dist/cjs.js!./node_modules/css-loader/dist/cjs.js!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/vue-loader/lib??vue-loader-options!./js/playground.vue?vue&type=style&index=1&id=edbf0ef0&prod&lang=css 691 bytes {2} [built]
 [39] ./example-scripts lazy nonrecursive ./node_modules/raw-loader/dist/cjs.js \.rhai$ 160 bytes {2} [built]
 [41] ./js/playground.vue?vue&type=style&index=0&id=edbf0ef0&prod&scoped=true&lang=css 293 bytes {2} [built]
 [43] ./js/playground.vue?vue&type=style&index=1&id=edbf0ef0&prod&lang=css 281 bytes {2} [built]
[210] ./node_modules/buefy/dist/esm/dropdown.js + 2 modules 18 KiB {1} [built]
      |    3 modules
[211] ./node_modules/buefy/dist/esm/select.js + 2 modules 7.89 KiB {1} [built]
      |    3 modules
[212] ./node_modules/buefy/dist/esm/field.js + 1 modules 8.43 KiB {1} [built]
      |    2 modules
[213] ./node_modules/buefy/dist/esm/tooltip.js + 1 modules 2.52 KiB {1} [built]
      |    2 modules
    + 245 hidden modules

ERROR in index.js from Terser
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:79:19)
    at Object.createHash (node:crypto:139:10)
    at /home/tomoyan/my_projects/_crates_src/playground/node_modules/terser-webpack-plugin/dist/index.js:217:37
    at Array.forEach (<anonymous>)
    at TerserPlugin.optimizeFn (/home/tomoyan/my_projects/_crates_src/playground/node_modules/terser-webpack-plugin/dist/index.js:160:259)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/tomoyan/my_projects/_crates_src/playground/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:7:1)
    at AsyncSeriesHook.lazyCompileHook (/home/tomoyan/my_projects/_crates_src/playground/node_modules/tapable/lib/Hook.js:154:20)
    at /home/tomoyan/my_projects/_crates_src/playground/node_modules/webpack/lib/Compilation.js:1409:36
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/home/tomoyan/my_projects/_crates_src/playground/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/home/tomoyan/my_projects/_crates_src/playground/node_modules/tapable/lib/Hook.js:154:20)
    at /home/tomoyan/my_projects/_crates_src/playground/node_modules/webpack/lib/Compilation.js:1405:32
    at eval (eval at create (/home/tomoyan/my_projects/_crates_src/playground/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:12:1)
    at /home/tomoyan/my_projects/_crates_src/playground/node_modules/git-revision-webpack-plugin/lib/build-file.js:12:9
    at /home/tomoyan/my_projects/_crates_src/playground/node_modules/git-revision-webpack-plugin/lib/helpers/run-git-command.js:22:7
    at ChildProcess.exithandler (node:child_process:414:7)
    at ChildProcess.emit (node:events:519:28)
    at maybeClose (node:internal/child_process:1105:16)
    at Socket.<anonymous> (node:internal/child_process:457:11)
    at Socket.emit (node:events:519:28)
    at Pipe.<anonymous> (node:net:339:12)

  • rust/rhai.1762796652.txt.gz
  • 最終更新: 2025/11/11 02:44
  • by ともやん