🚨 fix: フィールド差し替え時の危険な自動fini呼び出しを発見

現在の問題:
- me.field = newValue で古いfieldのfiniが自動で呼ばれる
- 共有参照を破壊する可能性(複数から参照されている場合)
- GC的な「おせっかい」でNyashの明示的哲学に反する

次の修正予定:
- フィールド差し替え:fini呼ばない(プログラマー責任)
- スコープ離脱時:fini呼ぶ(自然なリソース管理)
- Everything is Explicit の哲学を貫く

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Moe Charm
2025-08-20 05:57:18 +09:00
parent bab57e7c07
commit 83d3914e46
17 changed files with 17082 additions and 50 deletions

View File

@ -11,13 +11,15 @@ categories = ["development-tools::parsing", "interpreters"]
# Default features - minimal CLI only
[features]
default = ["cli"]
default = ["cli", "plugins"]
cli = []
gui = ["dep:egui", "dep:eframe", "dep:egui_extras", "dep:image"]
gui-examples = ["gui"]
all-examples = ["gui-examples"]
dynamic-file = []
wasm-backend = ["dep:wasmtime", "dep:wabt"]
# プラグイン機構の有効化(ネイティブ環境のみ推奨)
plugins = ["dep:libloading"]
# Note: LLVM feature requires inkwell dependency and LLVM development libraries
# llvm = ["dep:inkwell"]
@ -104,7 +106,7 @@ once_cell = "1.20"
# デバッグ・ログ
log = "0.4"
env_logger = "0.11"
libloading = "0.8"
libloading = { version = "0.8", optional = true }
toml = "0.8"
# 日時処理

267
build_errors_only.txt Normal file
View File

@ -0,0 +1,267 @@
Compiling proc-macro2 v1.0.95
Compiling unicode-ident v1.0.18
Compiling serde v1.0.219
Compiling cfg-if v1.0.1
Compiling wasm-bindgen-shared v0.2.100
Compiling memchr v2.7.5
Compiling log v0.4.27
Compiling bumpalo v3.19.0
Compiling rustversion v1.0.21
Compiling utf8parse v0.2.2
Compiling autocfg v1.5.0
Compiling regex-syntax v0.8.5
Compiling is_terminal_polyfill v1.70.1
Compiling anstyle v1.0.11
Compiling colorchoice v1.0.4
Compiling crossbeam-utils v0.8.21
Compiling wasm-bindgen v0.2.100
Compiling once_cell v1.21.3
Compiling anstyle-query v1.1.3
Compiling serde_json v1.0.142
Compiling hashbrown v0.15.5
Compiling equivalent v1.0.2
Compiling itoa v1.0.15
Compiling strsim v0.11.1
Compiling heck v0.5.0
Compiling clap_lex v0.7.5
Compiling ryu v1.0.20
Compiling thiserror v2.0.12
Compiling rayon-core v1.12.1
Compiling toml_write v0.1.2
Compiling anyhow v1.0.98
Compiling anstyle-parse v0.2.7
Compiling either v1.15.0
Compiling libc v0.2.174
Compiling winnow v0.7.12
Compiling half v2.6.0
Compiling iana-time-zone v0.1.63
Compiling jiff v0.2.15
Compiling aho-corasick v1.1.3
Compiling indexmap v2.10.0
Compiling anstream v0.6.19
Compiling plotters-backend v0.3.7
Compiling ciborium-io v0.2.2
Compiling itertools v0.10.5
Compiling libloading v0.8.8
Compiling same-file v1.0.6
Compiling lazy_static v1.5.0
Compiling cast v0.3.0
Compiling oorandom v11.1.5
Compiling anes v0.1.6
Compiling ciborium-ll v0.2.2
Compiling num-traits v0.2.19
Compiling plotters-svg v0.3.7
Compiling walkdir v2.5.0
Compiling clap_builder v4.5.42
Compiling regex-automata v0.4.9
Compiling criterion-plot v0.5.0
Compiling regex v1.11.1
Compiling env_filter v0.1.3
Compiling crossbeam-epoch v0.9.18
Compiling env_logger v0.11.8
Compiling crossbeam-deque v0.8.6
Compiling quote v1.0.40
Compiling syn v2.0.104
Compiling rayon v1.10.0
Compiling is-terminal v0.4.16
Compiling chrono v0.4.41
Compiling plotters v0.3.7
Compiling wasm-bindgen-backend v0.2.100
Compiling serde_derive v1.0.219
Compiling clap_derive v4.5.41
Compiling thiserror-impl v2.0.12
Compiling wasm-bindgen-macro-support v0.2.100
Compiling wasm-bindgen-macro v0.2.100
Compiling clap v4.5.42
Compiling js-sys v0.3.77
Compiling console_error_panic_hook v0.1.7
Compiling toml_datetime v0.6.11
Compiling serde_spanned v0.6.9
Compiling ciborium v0.2.2
Compiling toml_edit v0.22.27
Compiling tinytemplate v1.2.1
Compiling criterion v0.5.1
Compiling toml v0.8.23
Compiling web-sys v0.3.77
Compiling nyash-rust v0.1.0 (/mnt/c/git/nyash-project/nyash)
error: couldn't read `examples/C:/Windows/Fonts/arial.ttf`: No such file or directory (os error 2)
--> examples/simple_notepad_win.rs:32:57
|
32 | std::sync::Arc::new(egui::FontData::from_static(include_bytes!(
| _________________________________________________________^
33 | | "C:/Windows/Fonts/arial.ttf"
34 | | ))),
| |_________^
error[E0432]: unresolved import `nyash_rust::backend::wasm`
--> tests/wasm_poc1_basic_operations.rs:15:26
|
15 | use nyash_rust::backend::wasm::WasmBackend;
| ^^^^ could not find `wasm` in `backend`
|
note: found an item that was configured out
--> /mnt/c/git/nyash-project/nyash/src/backend/mod.rs:9:9
|
9 | pub mod wasm;
| ^^^^
note: the item is gated behind the `wasm-backend` feature
--> /mnt/c/git/nyash-project/nyash/src/backend/mod.rs:8:7
|
8 | #[cfg(feature = "wasm-backend")]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0432]: unresolved import `nyash_rust::backend::wasm`
--> tests/wasm_poc2_box_operations.rs:17:26
|
17 | use nyash_rust::backend::wasm::WasmBackend;
| ^^^^ could not find `wasm` in `backend`
|
note: found an item that was configured out
--> /mnt/c/git/nyash-project/nyash/src/backend/mod.rs:9:9
|
9 | pub mod wasm;
| ^^^^
note: the item is gated behind the `wasm-backend` feature
--> /mnt/c/git/nyash-project/nyash/src/backend/mod.rs:8:7
|
8 | #[cfg(feature = "wasm-backend")]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error[E0432]: unresolved import `nyash_rust::backend::wasm`
--> tests/wasm_string_constants.rs:15:26
|
15 | use nyash_rust::backend::wasm::WasmBackend;
| ^^^^ could not find `wasm` in `backend`
|
note: found an item that was configured out
--> /mnt/c/git/nyash-project/nyash/src/backend/mod.rs:9:9
|
9 | pub mod wasm;
| ^^^^
note: the item is gated behind the `wasm-backend` feature
--> /mnt/c/git/nyash-project/nyash/src/backend/mod.rs:8:7
|
8 | #[cfg(feature = "wasm-backend")]
| ^^^^^^^^^^^^^^^^^^^^^^^^
For more information about this error, try `rustc --explain E0432`.
error: could not compile `nyash-rust` (test "wasm_poc1_basic_operations") due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `nyash-rust` (test "wasm_string_constants") due to 1 previous error
error: could not compile `nyash-rust` (test "wasm_poc2_box_operations") due to 1 previous error
error[E0433]: failed to resolve: unresolved import
--> tests/array_state_sharing_test.rs:4:16
|
4 | use crate::boxes::array::ArrayBox;
| ^^^^^
| |
| unresolved import
| help: a similar path exists: `nyash_rust::boxes`
error[E0432]: unresolved import `crate::mir`
--> tests/mir_phase8_5_hierarchical_25_instructions.rs:7:12
|
7 | use crate::mir::{
| ^^^
| |
| unresolved import
| help: a similar path exists: `nyash_rust::mir`
error[E0432]: unresolved import `crate::interpreter`
--> tests/array_state_sharing_test.rs:3:16
|
3 | use crate::interpreter::Interpreter;
| ^^^^^^^^^^^
| |
| unresolved import
| help: a similar path exists: `nyash_rust::interpreter`
error[E0432]: unresolved import `crate::box_trait`
--> tests/array_state_sharing_test.rs:5:16
|
5 | use crate::box_trait::{NyashBox, IntegerBox, StringBox};
| ^^^^^^^^^
| |
| unresolved import
| help: a similar path exists: `nyash_rust::box_trait`
Some errors have detailed explanations: E0432, E0433.
For more information about an error, try `rustc --explain E0432`.
error: could not compile `nyash-rust` (test "array_state_sharing_test") due to 3 previous errors
error: could not compile `nyash-rust` (test "mir_phase8_5_hierarchical_25_instructions") due to 1 previous error
error[E0432]: unresolved import `eframe`
--> examples/simple_notepad_win.rs:4:5
|
4 | use eframe::egui;
| ^^^^^^ use of unresolved module or unlinked crate `eframe`
|
= help: if you wanted to use a crate named `eframe`, use `cargo add eframe` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `eframe`
--> examples/simple_notepad_win.rs:6:14
|
6 | fn main() -> eframe::Result {
| ^^^^^^ use of unresolved module or unlinked crate `eframe`
|
= help: if you wanted to use a crate named `eframe`, use `cargo add eframe` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `eframe`
--> examples/simple_notepad_win.rs:7:19
|
7 | let options = eframe::NativeOptions {
| ^^^^^^ use of unresolved module or unlinked crate `eframe`
|
= help: if you wanted to use a crate named `eframe`, use `cargo add eframe` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `eframe`
--> examples/simple_notepad_win.rs:14:5
|
14 | eframe::run_native(
| ^^^^^^ use of unresolved module or unlinked crate `eframe`
|
= help: if you wanted to use a crate named `eframe`, use `cargo add eframe` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `eframe`
--> examples/simple_notepad_win.rs:69:6
|
69 | impl eframe::App for NyashNotepad {
| ^^^^^^ use of unresolved module or unlinked crate `eframe`
|
= help: if you wanted to use a crate named `eframe`, use `cargo add eframe` to add it to your `Cargo.toml`
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `eframe`
--> examples/simple_notepad_win.rs:70:60
|
70 | fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) {
| ^^^^^^ use of unresolved module or unlinked crate `eframe`
|
= help: if you wanted to use a crate named `eframe`, use `cargo add eframe` to add it to your `Cargo.toml`
error: could not compile `nyash-rust` (example "simple_notepad_win") due to 7 previous errors
error[E0599]: no method named `to_string_box` found for struct `box_trait::StringBox` in the current scope
--> src/main.rs:77:31
|
77 | assert_eq!(string_box.to_string_box().value, "test");
| ^^^^^^^^^^^^^
|
::: src/box_trait.rs:96:8
|
96 | fn to_string_box(&self) -> StringBox;
| ------------- the method is available for `box_trait::StringBox` here
...
127 | pub struct StringBox {
| -------------------- method `to_string_box` not found for this struct
|
= help: items from traits can only be used if the trait is in scope
help: trait `NyashBox` which provides `to_string_box` is implemented but not in scope; perhaps you want to import it
|
70 + use crate::box_trait::NyashBox;
|
help: there is a method `to_string` with a similar name
|
77 - assert_eq!(string_box.to_string_box().value, "test");
77 + assert_eq!(string_box.to_string().value, "test");
|
For more information about this error, try `rustc --explain E0599`.
error: could not compile `nyash-rust` (bin "nyash" test) due to 1 previous error

View File

@ -0,0 +1,123 @@
# Instance v2 統一レジストリ設計メモ(提案)
目的: ユーザー定義 / ビルトイン / プラグインの3系統を instance_v2 で一元管理し、同一の生成birth/破棄finiライフサイクルで扱えるようにする。また、wasm-bindgen ターゲットでプラグイン機構を安全に無効化できる切替を用意する。
---
## 現状の整理(実装済み)
- ユーザー定義Box
- インタプリタの AST → InstanceBox 生成で対応済み。
- `execute_new` は最初に統一レジストリを呼び、ユーザー定義については最終的に `InstanceBox` を構築し、birth 相当のコンストラクタ実行を行う。
- ビルトインBox
- 統一レジストリ経由で生成可能。ユーザー定義と同じ呼び出し経路に乗る。
- プラグインBoxv2
- `nyash.toml v2``PluginLoaderV2` が読み込み、`nyash_plugin_invoke` の birth 呼び出しでインスタンスを生成。
- 現状、`PluginBoxV2``clone_box=新birth``share_box=同一 instance_id` を実装済み。
---
## 目標
1. 3系統ユーザー定義/ビルトイン/プラグインを「統一レジストリ→instance_v2」で一元管理。
2. birth/fini ライフサイクルの整合をとる。
3. wasm-bindgen ターゲット(`wasm32-unknown-unknown`)ではプラグイン機構をコンパイル時に無効化し、ビルド可能にする。
---
## 設計方針
### 1) 統一レジストリの責務
- 名前(クラス名)と引数(`Box<dyn NyashBox>` の配列)を入力に、ユーザー定義/ビルトイン/プラグインの順で解決・生成を試みる。
- 生成に成功したら `Box<dyn NyashBox>` を返す。
- ユーザー定義: `InstanceBox` とし、インタプリタがコンストラクタbirthを実行。
- ビルトイン: 直接生成必要なら簡易birth相当の初期化
- プラグイン: `PluginLoaderV2``invoke_fn(type_id, method_id=0=birth, ...)` を呼ぶ。
### 2) birth / fini ライフサイクル
- birth:
- ユーザー定義: 既存通り AST 上のコンストラクタbirthを呼ぶ。
- プラグイン: `nyash.toml``methods.birth` の method_id=0 を使い、`invoke_fn` 呼び出しで instance_id を取得済み。
- fini:
- InstanceBox のフィールド差し替え時、旧値が InstanceBox なら `fini()` を呼んで finalize 済みIDとしてマーキング実装済み
- プラグインBoxについても `nyash.toml``methods.fini`(例: 0xFFFFを定義し、差し替えやスコープ終端で `invoke_fn(type_id, method_id=fini, instance_id, ...)` を呼ぶ。エラーは握りつぶさずログ化。
### 3) wasm-bindgen ターゲットでの切り替え
- Cargo features によるコンパイル時ガードを導入:
- `plugins`デフォルトON`wasm-backend`WASMビルド用の2フラグを用意。
- `#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]` のときのみ `plugin_loader_v2` 実体を有効化。
- それ以外では `plugin_loader_v2` のスタブ実装を使う(常に `Err(BidError::PluginError)` を返すなど)。
- 統一レジストリはプラグインFactoryの登録を `#[cfg(feature="plugins")]` でガードし、WASMビルドでもユーザー定義/ビルトインは動かせる。
- `nyash.toml` のファイルI/O`from_file`)も `cfg` で握り、WASMではロードしない。
---
## nyash.toml v2 との整合
- 既存:
- `libraries.<libname>.boxes = ["FileBox"]`
- `libraries.<libname>.<BoxType>.methods.birth = { method_id = 0 }`
- `... .fini = { method_id = 4294967295 }` など
- 追加検討:
- 将来、ユーザー定義Boxをプラグインで置換したい場合
- クラス名→プラグインBox型の上書きマップを `nyash.toml` に追加(例:`overrides = { "DataBox" = "libX::RemoteDataBox" }`)。
- 統一レジストリがこのマップを見て、ユーザー定義をスキップしてプラグインへ委譲。
---
## API/コード上の具体案(抜粋)
- features`Cargo.toml`:
```toml
[features]
default = ["plugins"]
plugins = []
wasm-backend = []
```
- プラグインローダ(`src/runtime/plugin_loader_v2.rs`:
```rust
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
pub mod real_loader { /* 現在の実装 */ }
#[cfg(any(not(feature = "plugins"), target_arch = "wasm32"))]
pub mod stub_loader {
use crate::bid::{BidResult, BidError};
use crate::box_trait::NyashBox;
pub struct PluginLoaderV2; // ダミー
impl PluginLoaderV2 { pub fn new() -> Self { Self } }
impl PluginLoaderV2 {
pub fn load_config(&mut self, _p: &str) -> BidResult<()> { Ok(()) }
pub fn load_all_plugins(&self) -> BidResult<()> { Ok(()) }
pub fn create_box(&self, _t: &str, _a: &[Box<dyn NyashBox>]) -> BidResult<Box<dyn NyashBox>> {
Err(BidError::PluginError)
}
}
}
```
- 統一レジストリのFactory登録部は `#[cfg(feature = "plugins")]` でプラグインFactoryの登録を条件化。
---
## マイグレーション手順(段階)
1. Cargo features と cfg ガードの導入(プラグイン機構のスタブ化を含む)。
2. 統一レジストリのプラグインFactory登録の条件化。
3. プラグインBoxの `fini` 呼び出し用メソッドを InstanceBox 置換/破棄パスへ組み込む。
4. 必要に応じて `nyash.toml` の `methods.fini` を明記。
5. 追加要件(ユーザー定義のプラグイン置換)を `overrides` マップで設計 → 実装。
---
## テスト観点
- ユニット:
- birth/fini の呼び出し順と複数回置換時の `fini` 呼び出し保証。
- `plugins` ON/OFF、`wasm-backend` ON の3軸でビルド/テストが通ること。
- 統合テスト:
- `nyash.toml` によるビルトイン→プラグインの透過切替。
- ユーザー定義→ビルトイン→プラグインの優先順位が想定通り。
---
## メモ
- すでに `execute_new` は統一レジストリ優先の実装になっており、この設計と整合が良い。
- WASM ターゲットでは `libloading` が使えないため、コンパイル時に完全にプラグインコードを外す方針cfg/featureは自然。
- `nyash.toml` のロードはネイティブ時のみで十分WASM は将来、バンドルまたは JS 側から供給する計画があるなら別途)。
---
以上。必要であれば、この方針でPRを小さく分割features→レジストリ→fini→overridesして入れていきます。

View File

@ -0,0 +1,81 @@
# プラグイン機構と WASM ビルド切替ガイド
本書は、nyash のプラグイン機構nyash.toml v2 / PluginLoaderV2と、wasm-bindgen を使う WASM ビルドでの切替手順をまとめたものです。目的は「ネイティブではプラグインON、WASMでは安全にプラグインOFF」でビルド/実行できるようにすることです。
---
## 1. Cargo features 構成(現状)
- `default = ["cli", "plugins"]`
- `plugins`: プラグイン機構を有効化(`libloading` 等の動的ロードに依存)
- `wasm-backend`: WASM バックエンドを有効化(`wabt`/`wasmtime` 等)
これにより、デフォルトではネイティブ開発時にプラグインが有効になります。WASM ターゲットでプラグインを完全に外したい場合は、`--no-default-features` を使います。
---
## 2. ビルド/テスト コマンド例
### 2.1 ネイティブプラグインON・デフォルト
- ビルド: `cargo build`
- テスト: `cargo test`
nyash.toml v2 によるプラグインの透過切替(ビルトイン→プラグイン)はこの構成で有効です。
### 2.2 ネイティブプラグインOFF
- テスト: `cargo test --no-default-features --features cli`
`plugins` を外すとプラグインローダはスタブ化され、プラグイン経由の生成は失敗(適切なエラー)になります。
### 2.3 WASM ターゲットプラグインOFF
- 初回のみ: `rustup target add wasm32-unknown-unknown`
- ビルド例: `cargo build --target wasm32-unknown-unknown --no-default-features --features wasm-backend`
この構成では `plugins` が無効のため、`libloading` 等の動的ロードに依存せずビルドできます。
---
## 3. runtime 側の切替実装(概要)
`src/runtime/plugin_loader_v2.rs` は cfg で2パスを提供:
- `#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]` … 実体実装libloading + invoke_fn
- `#[cfg(any(not(feature = "plugins"), target_arch = "wasm32"))]` … スタブ実装(常にエラー返却)
`src/runtime/unified_registry.rs` は、`#[cfg(feature = "plugins")]` のときだけプラグインFactoryをレジストリに登録します。WASMやpluginsオフ時は登録されず、ユーザー定義/ビルトインのみが対象になります。
---
## 4. nyash.toml v2 の取り扱い
- ネイティブ: `init_global_loader_v2()` により `nyash.toml` を読み込み、`libraries`/`methods.birth`/`methods.fini` などの設定に従ってプラグインをロードします。
- WASM/プラグインOFF: `init_global_loader_v2()` はスタブ化され、ファイルI/Oや動的ロードは行いません。
---
## 5. ライフサイクルbirth/fini整合設計
- ユーザー定義: AST上のコンストラクタbirth実行・フィールド差し替え時に `fini()` 呼び出しInstanceBox側実装
- プラグイン: `methods.birth=0` で生成済み。差し替え/破棄時に `methods.fini`(例: `0xFFFF`)を `invoke_fn(type_id, method_id=fini, instance_id)` で呼ぶフックを今後統合予定。
---
## 6. よくある質問
- Q. なぜランタイム切替ではなくコンパイル時切替?
- A. WASM ターゲットでは `libloading` が使えないため、リンク/依存段階で除去する必要があり、features/cfg によるコンパイル時切替が安全・簡潔です。
- Q. `nyash.toml` はWASMでも使える
- A. ファイルI/O前提のため、現状はネイティブのみ。将来、バンドルや JS 側から設定注入をする場合は別アプローチで設計します。
---
## 7. 今後の拡張
- `nyash.toml` にクラス名→プラグインBox型の `overrides` マップを追加し、ユーザー定義Boxの外部置換をサポート任意
- プラグインBoxの `fini` 呼び出しを InstanceBox の破棄/置換パスへ統合し、birth/fini ライフサイクルを完全整合。
以上。

View File

@ -0,0 +1,73 @@
# プラグインBoxのライフサイクルと nyash.toml methods 定義
本書は、プラグインBoxPluginBoxV2の生成birthと終了finiの流れ、ならびに nyash.toml v2 における `methods` 定義の役割をまとめたものです。
---
## 1. 用語
- birth: プラグインBoxのインスタンス生成`method_id=0`
- fini: プラグインBoxの終了処理任意の `method_id`。例: `4294967295`
- invoke_fn: プラグイン側の単一エントリポイント(`nyash_plugin_invoke`
---
## 2. 生成birthの流れ
1. `unified registry``PluginLoaderV2::create_box(box_type, args)` を呼び出す。
2. `PluginLoaderV2``nyash.toml` から `type_id``methods` を読み込む。
3. `invoke_fn(type_id, method_id=0 /* birth */, instance_id=0, ...)` を呼び、戻り値出力TLVの先頭4バイトから `instance_id` を取得。
4. `PluginBoxV2 { type_id, instance_id, invoke_fn, fini_method_id }` を生成して返す。
補足:
- `fini_method_id``nyash.toml``methods` から `fini``method_id` を取り出して保持します。未定義の場合は `None`
---
## 3. 終了finiの流れ現状
- フィールド差し替え時(代入で旧値を置き換えるとき):
- 旧値が `InstanceBox` の場合: インタプリタが `fini()` を呼び、finalized としてマーキングします。
- 旧値が `PluginBoxV2` の場合: `fini_method_id` が設定されていれば `invoke_fn(type_id, fini_method_id, instance_id, ...)` を呼びます。
- 破棄Drop時:
- RustのDropでFFIを呼ぶのは安全性の観点でリスクがあるため、現状は「明示タイミングフィールド差し替えなど」での fini 呼び出しを優先しています。
注意:
- ローカル変数のスコープ終了時に自動で fini を呼ぶ実装は、現時点では入っていません(将来検討)。
---
## 4. nyash.toml v2 の定義例
```toml
[libraries]
[libraries."libnyash_filebox_plugin.so"]
boxes = ["FileBox"]
path = "./plugins/nyash-filebox-plugin/target/release/libnyash_filebox_plugin.so"
[libraries."libnyash_filebox_plugin.so".FileBox]
type_id = 6
[libraries."libnyash_filebox_plugin.so".FileBox.methods]
birth = { method_id = 0 }
open = { method_id = 1 }
read = { method_id = 2 }
write = { method_id = 3 }
close = { method_id = 4 }
fini = { method_id = 4294967295 } # 任意の終端ID
```
要点:
- `methods``fini` を定義すれば、差し替え時などに fini が呼ばれます。
- `fini` 未定義の場合、プラグインBoxの終了処理は呼ばれませんフォールバック動作
---
## 5. WASMwasm-bindgenとの関係
- WASMターゲットでは `libloading` が使えないため、プラグイン機構は features/cfg でスタブ化しています。
- `plugins` フィーチャを外す、または `target_arch = "wasm32"` のときは、プラグイン生成・fini 呼び出しのコードはコンパイル対象外になります(ビルド可能化のため)。
---
## 6. 将来拡張の方向
- ローカル変数のスコープ終了時(関数/メソッド呼び出しの戻りなどに、InstanceBox/PluginBoxV2 の fini を安全に呼び出す仕組み(順序・例外耐性・二重呼び出し防止を含む)。
- `nyash.toml` にクラス名→プラグインBox型の `overrides` を加え、ユーザー定義Boxの外部置換を許可する設計任意
以上。

9838
final_test_output.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,66 @@
// 🎯 デリゲーション透過テスト
// 通常のユーザー定義Box継承
box Parent {
init { name, power }
birth(parentName) {
me.name = parentName
me.power = 100
print("👨‍👩‍👧‍👦 Parent誕生: " + me.name + " (power:" + me.power + ")")
}
attack() {
print("💥 " + me.name + "の攻撃!ダメージ:" + me.power)
}
}
box Child from Parent {
init { skill }
birth(childName) {
from Parent.birth(childName)
me.skill = "必殺技"
print("🧒 Child誕生完了スキル: " + me.skill)
}
override attack() {
print("⚡ " + me.skill + "発動!")
from Parent.attack()
}
}
// ビルトインBox継承pack透過テスト
box EnhancedString from StringBox {
init { prefix, suffix }
birth(text) {
pack StringBox(text) // ビルトイン継承(透過的)
me.prefix = "【"
me.suffix = "】"
print("📝 EnhancedString誕生: " + me.prefix + text + me.suffix)
}
enhanced() {
return me.prefix + me.toString() + me.suffix + "✨"
}
}
static box Main {
init { console }
main() {
me.console = new ConsoleBox()
me.console.log("🧪 デリゲーション透過テスト開始")
// ユーザー定義 → ユーザー定義
local child = new Child("太郎")
child.attack()
// ユーザー定義 → ビルトインpack透過
local enhanced = new EnhancedString("Hello")
print("結果: " + enhanced.enhanced())
return "全テスト完了"
}
}

View File

@ -305,12 +305,16 @@ impl NyashInterpreter {
}
}
// 既存のフィールド値があればfini()を呼ぶ
// 既存のフィールド値があれば fini() を呼ぶ
if let Some(old_field_value) = instance.get_field(field) {
if let Some(old_instance) = (*old_field_value).as_any().downcast_ref::<InstanceBox>() {
let _ = old_instance.fini();
finalization::mark_as_finalized(old_instance.box_id());
}
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
if let Some(old_plugin) = (*old_field_value).as_any().downcast_ref::<crate::runtime::plugin_loader_v2::PluginBoxV2>() {
old_plugin.call_fini();
}
}
instance.set_field(field, Arc::from(val.clone_box()))
@ -338,12 +342,16 @@ impl NyashInterpreter {
});
}
// 既存のthis.field値があればfini()を呼ぶ
// 既存のthis.field値があれば fini() を呼ぶ
if let Some(old_field_value) = instance.get_field(field) {
if let Some(old_instance) = (*old_field_value).as_any().downcast_ref::<InstanceBox>() {
let _ = old_instance.fini();
finalization::mark_as_finalized(old_instance.box_id());
}
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
if let Some(old_plugin) = (*old_field_value).as_any().downcast_ref::<crate::runtime::plugin_loader_v2::PluginBoxV2>() {
old_plugin.call_fini();
}
}
instance.set_field(field, Arc::from(val.clone_box()))
@ -371,12 +379,16 @@ impl NyashInterpreter {
});
}
// 既存のme.field値があればfini()を呼ぶ
// 既存のme.field値があれば fini() を呼ぶ
if let Some(old_field_value) = instance.get_field(field) {
if let Some(old_instance) = (*old_field_value).as_any().downcast_ref::<InstanceBox>() {
let _ = old_instance.fini();
finalization::mark_as_finalized(old_instance.box_id());
}
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
if let Some(old_plugin) = (*old_field_value).as_any().downcast_ref::<crate::runtime::plugin_loader_v2::PluginBoxV2>() {
old_plugin.call_fini();
}
}
instance.set_field(field, Arc::from(val.clone_box()))

View File

@ -1,18 +1,22 @@
//! Nyash v2 Plugin Loader
//!
//! nyash.toml v2ベースの新しいプラグインローダー
//! Single FFI entry point (nyash_plugin_invoke) + optional init
//! cfg/features で2パスを提供:
//! - enabled: plugins feature 有効 かつ 非wasm32 ターゲット
//! - stub : それ以外WASMやplugins無効
use crate::bid::{BidResult, BidError};
use crate::box_trait::{NyashBox, BoxCore, BoxBase, StringBox};
use crate::config::nyash_toml_v2::{NyashConfigV2, LibraryDefinition};
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use std::ffi::c_void;
use std::any::Any;
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
mod enabled {
use crate::bid::{BidResult, BidError};
use crate::box_trait::{NyashBox, BoxCore, BoxBase, StringBox};
use crate::config::nyash_toml_v2::{NyashConfigV2, LibraryDefinition};
use std::collections::HashMap;
use std::sync::{Arc, RwLock};
use std::ffi::c_void;
use std::any::Any;
use once_cell::sync::Lazy;
/// Loaded plugin information
pub struct LoadedPluginV2 {
pub struct LoadedPluginV2 {
/// Library handle
_lib: Arc<libloading::Library>,
@ -28,14 +32,16 @@ pub struct LoadedPluginV2 {
/// v2 Plugin Box wrapper - temporary implementation
#[derive(Debug)]
pub struct PluginBoxV2 {
pub box_type: String,
pub type_id: u32,
pub invoke_fn: unsafe extern "C" fn(u32, u32, u32, *const u8, usize, *mut u8, *mut usize) -> i32,
pub instance_id: u32,
}
pub struct PluginBoxV2 {
pub box_type: String,
pub type_id: u32,
pub invoke_fn: unsafe extern "C" fn(u32, u32, u32, *const u8, usize, *mut u8, *mut usize) -> i32,
pub instance_id: u32,
/// Optional fini method_id from nyash.toml (None if not provided)
pub fini_method_id: Option<u32>,
}
impl BoxCore for PluginBoxV2 {
impl BoxCore for PluginBoxV2 {
fn box_id(&self) -> u64 {
self.instance_id as u64
}
@ -57,7 +63,7 @@ impl BoxCore for PluginBoxV2 {
}
}
impl NyashBox for PluginBoxV2 {
impl NyashBox for PluginBoxV2 {
fn type_name(&self) -> &'static str {
// Return the actual box type name for proper method dispatch
match self.box_type.as_str() {
@ -101,6 +107,7 @@ impl NyashBox for PluginBoxV2 {
type_id: self.type_id,
invoke_fn: self.invoke_fn,
instance_id: new_instance_id,
fini_method_id: self.fini_method_id,
})
} else {
eprintln!("❌ clone_box failed: birth() returned error code {}", result);
@ -126,12 +133,39 @@ impl NyashBox for PluginBoxV2 {
type_id: self.type_id,
invoke_fn: self.invoke_fn,
instance_id: self.instance_id, // Same instance_id - this is sharing!
fini_method_id: self.fini_method_id,
})
}
}
impl PluginBoxV2 {
/// Call fini() on this plugin instance if configured
pub fn call_fini(&self) {
if let Some(fini_id) = self.fini_method_id {
// Empty TLV args
let tlv_args: [u8; 4] = [1, 0, 0, 0];
let mut out: [u8; 4] = [0; 4];
let mut out_len: usize = out.len();
let rc = unsafe {
(self.invoke_fn)(
self.type_id,
fini_id,
self.instance_id,
tlv_args.as_ptr(),
tlv_args.len(),
out.as_mut_ptr(),
&mut out_len,
)
};
if rc != 0 {
eprintln!("⚠️ PluginBoxV2::fini failed for {} id={} rc={}", self.box_type, self.instance_id, rc);
}
}
}
}
/// Plugin loader v2
pub struct PluginLoaderV2 {
pub struct PluginLoaderV2 {
/// Loaded plugins (library name -> plugin info)
plugins: RwLock<HashMap<String, Arc<LoadedPluginV2>>>,
@ -139,7 +173,7 @@ pub struct PluginLoaderV2 {
pub config: Option<NyashConfigV2>,
}
impl PluginLoaderV2 {
impl PluginLoaderV2 {
/// Create new loader
pub fn new() -> Self {
Self {
@ -262,13 +296,14 @@ impl PluginLoaderV2 {
// Get type_id from config - read actual nyash.toml content
eprintln!("🔍 Reading nyash.toml for type configuration...");
let type_id = if let Ok(toml_content) = std::fs::read_to_string("nyash.toml") {
let (type_id, fini_method_id) = if let Ok(toml_content) = std::fs::read_to_string("nyash.toml") {
eprintln!("🔍 nyash.toml read successfully");
if let Ok(toml_value) = toml::from_str::<toml::Value>(&toml_content) {
eprintln!("🔍 nyash.toml parsed successfully");
if let Some(box_config) = config.get_box_config(lib_name, box_type, &toml_value) {
eprintln!("🔍 Found box config for {} with type_id: {}", box_type, box_config.type_id);
box_config.type_id
let fini_id = box_config.methods.get("fini").map(|m| m.method_id);
(box_config.type_id, fini_id)
} else {
eprintln!("No type configuration for {} in {}", box_type, lib_name);
return Err(BidError::InvalidType);
@ -327,6 +362,7 @@ impl PluginLoaderV2 {
type_id,
invoke_fn: plugin.invoke_fn,
instance_id,
fini_method_id,
};
Ok(Box::new(plugin_box))
@ -334,25 +370,53 @@ impl PluginLoaderV2 {
}
// Global loader instance
use once_cell::sync::Lazy;
static GLOBAL_LOADER_V2: Lazy<Arc<RwLock<PluginLoaderV2>>> =
Lazy::new(|| Arc::new(RwLock::new(PluginLoaderV2::new())));
static GLOBAL_LOADER_V2: Lazy<Arc<RwLock<PluginLoaderV2>>> =
Lazy::new(|| Arc::new(RwLock::new(PluginLoaderV2::new())));
/// Get global v2 loader
pub fn get_global_loader_v2() -> Arc<RwLock<PluginLoaderV2>> {
GLOBAL_LOADER_V2.clone()
}
/// Get global v2 loader
pub fn get_global_loader_v2() -> Arc<RwLock<PluginLoaderV2>> {
GLOBAL_LOADER_V2.clone()
/// Initialize global loader with config
pub fn init_global_loader_v2(config_path: &str) -> BidResult<()> {
let loader = get_global_loader_v2();
let mut loader = loader.write().unwrap();
loader.load_config(config_path)?;
drop(loader); // Release write lock
// Load all plugins
let loader = get_global_loader_v2();
let loader = loader.read().unwrap();
loader.load_all_plugins()
}
}
/// Initialize global loader with config
pub fn init_global_loader_v2(config_path: &str) -> BidResult<()> {
let loader = get_global_loader_v2();
let mut loader = loader.write().unwrap();
loader.load_config(config_path)?;
drop(loader); // Release write lock
#[cfg(any(not(feature = "plugins"), target_arch = "wasm32"))]
mod stub {
use crate::bid::{BidResult, BidError};
use crate::box_trait::NyashBox;
use once_cell::sync::Lazy;
use std::sync::{Arc, RwLock};
// Load all plugins
let loader = get_global_loader_v2();
let loader = loader.read().unwrap();
loader.load_all_plugins()
pub struct PluginLoaderV2;
impl PluginLoaderV2 { pub fn new() -> Self { Self } }
impl PluginLoaderV2 {
pub fn load_config(&mut self, _p: &str) -> BidResult<()> { Ok(()) }
pub fn load_all_plugins(&self) -> BidResult<()> { Ok(()) }
pub fn create_box(&self, _t: &str, _a: &[Box<dyn NyashBox>]) -> BidResult<Box<dyn NyashBox>> {
Err(BidError::PluginError)
}
}
static GLOBAL_LOADER_V2: Lazy<Arc<RwLock<PluginLoaderV2>>> =
Lazy::new(|| Arc::new(RwLock::new(PluginLoaderV2::new())));
pub fn get_global_loader_v2() -> Arc<RwLock<PluginLoaderV2>> { GLOBAL_LOADER_V2.clone() }
pub fn init_global_loader_v2(_config_path: &str) -> BidResult<()> { Ok(()) }
}
#[cfg(all(feature = "plugins", not(target_arch = "wasm32")))]
pub use enabled::*;
#[cfg(any(not(feature = "plugins"), target_arch = "wasm32"))]
pub use stub::*;

View File

@ -5,7 +5,9 @@
* Integrates all Box creation sources (builtin, user-defined, plugin)
*/
use crate::box_factory::{UnifiedBoxRegistry, builtin::BuiltinBoxFactory, plugin::PluginBoxFactory};
use crate::box_factory::{UnifiedBoxRegistry, builtin::BuiltinBoxFactory};
#[cfg(feature = "plugins")]
use crate::box_factory::plugin::PluginBoxFactory;
use std::sync::{Arc, Mutex, OnceLock};
/// Global registry instance
@ -20,7 +22,10 @@ pub fn init_global_unified_registry() {
registry.register(Arc::new(BuiltinBoxFactory::new()));
// Register plugin Box factory (lowest priority)
registry.register(Arc::new(PluginBoxFactory::new()));
#[cfg(feature = "plugins")]
{
registry.register(Arc::new(PluginBoxFactory::new()));
}
// TODO: User-defined Box factory will be registered by interpreter

434
ta.txt Normal file
View File

@ -0,0 +1,434 @@
warning: unused imports: `BoolBox`, `IntegerBox`, and `StringBox`
--> src/ast.rs:885:28
|
885 | use crate::box_trait::{StringBox, IntegerBox, BoolBox};
| ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `Mutex`
--> src/instance_v2.rs:387:26
|
387 | use std::sync::{Arc, Mutex};
| ^^^^^
warning: unused imports: `BasicBlockIdGenerator`, `BasicBlock`, `CompareOp`, `EffectMask`, `MirFunction`, and `ValueIdGenerator`
--> src/mir/loop_builder.rs:9:21
|
9 | MirInstruction, BasicBlock, BasicBlockId, MirFunction, ValueId,
| ^^^^^^^^^^ ^^^^^^^^^^^
10 | ConstValue, CompareOp, BasicBlockIdGenerator, ValueIdGenerator, EffectMask
| ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `HashSet`
--> src/mir/loop_builder.rs:13:33
|
13 | use std::collections::{HashMap, HashSet};
| ^^^^^^^
warning: unused import: `BasicBlock`
--> src/mir/verification.rs:311:75
|
311 | use crate::mir::{MirFunction, FunctionSignature, MirType, EffectMask, BasicBlock};
| ^^^^^^^^^^
warning: unexpected `cfg` condition value: `llvm`
--> src/backend/mod.rs:13:7
|
13 | #[cfg(feature = "llvm")]
| ^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `all-examples`, `cli`, `default`, `dynamic-file`, `gui`, `gui-examples`, and `wasm-backend`
= help: consider adding `llvm` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value: `llvm`
--> src/backend/mod.rs:23:7
|
23 | #[cfg(feature = "llvm")]
| ^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `all-examples`, `cli`, `default`, `dynamic-file`, `gui`, `gui-examples`, and `wasm-backend`
= help: consider adding `llvm` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
warning: unused imports: `BasicBlock`, `EffectMask`, `FunctionSignature`, `MirFunction`, `MirModule`, and `MirType`
--> src/backend/vm.rs:860:22
|
860 | use crate::mir::{MirModule, MirFunction, FunctionSignature, MirType, EffectMask, BasicBlock};
| ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `MirInstruction`
--> src/backend/vm_phi.rs:9:41
|
9 | use crate::mir::{BasicBlockId, ValueId, MirInstruction};
| ^^^^^^^^^^^^^^
warning: unused import: `super::Usize`
--> src/bid/types.rs:1:5
|
1 | use super::Usize;
| ^^^^^^^^^^^^
warning: unused import: `std::os::raw::c_char`
--> src/bid/plugin_api.rs:2:5
|
2 | use std::os::raw::c_char;
| ^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `NyashHostVtable`, `NyashMethodInfo`, and `NyashPluginInfo`
--> src/bid/plugins/filebox/mod.rs:7:18
|
7 | use crate::bid::{NyashPluginInfo, NyashMethodInfo, NyashHostVtable};
| ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
warning: unused imports: `SeekFrom` and `Seek`
--> src/bid/plugins/filebox/mod.rs:10:28
|
10 | use std::io::{Read, Write, Seek, SeekFrom};
| ^^^^ ^^^^^^^^
warning: unused imports: `c_char` and `c_void`
--> src/bid/plugins/filebox/mod.rs:11:20
|
11 | use std::os::raw::{c_char, c_void};
| ^^^^^^ ^^^^^^
warning: unused imports: `CStr` and `CString`
--> src/bid/plugins/filebox/mod.rs:13:16
|
13 | use std::ffi::{CStr, CString};
| ^^^^ ^^^^^^^
warning: unused import: `std::ffi::c_void`
--> src/bid/loader.rs:3:5
|
3 | use std::ffi::c_void;
| ^^^^^^^^^^^^^^^^
warning: unused imports: `TlvDecoder` and `TlvEncoder`
--> src/bid/generic_plugin_box.rs:2:23
|
2 | use crate::bid::tlv::{TlvEncoder, TlvDecoder};
| ^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `crate::bid::types::BidTag`
--> src/bid/generic_plugin_box.rs:3:5
|
3 | use crate::bid::types::BidTag;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `BoxBase`
--> src/runtime/plugin_loader_v2.rs:7:43
|
7 | use crate::box_trait::{NyashBox, BoxCore, BoxBase, StringBox};
| ^^^^^^^
warning: unused import: `std::ffi::c_void`
--> src/runtime/plugin_loader_v2.rs:11:5
|
11 | use std::ffi::c_void;
| ^^^^^^^^^^^^^^^^
warning: unused imports: `BidHandle` and `BoxTypeId`
--> src/runtime/tests.rs:10:22
|
10 | use crate::bid::{BidHandle, BoxTypeId};
| ^^^^^^^^^ ^^^^^^^^^
warning: unused variable: `registry`
--> src/box_factory/plugin.rs:53:13
|
53 | let registry = get_global_registry();
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_registry`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `args`
--> src/instance_v2.rs:147:28
|
147 | pub fn init(&mut self, args: &[Box<dyn NyashBox>]) -> Result<(), String> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
warning: unused variable: `nyash_value`
--> src/instance_v2.rs:289:21
|
289 | if let Some(nyash_value) = self.fields_ng.lock().unwrap().get(field_name) {
| ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_nyash_value`
warning: variable does not need to be mutable
--> src/mir/basic_block.rs:314:13
|
314 | let mut bb = BasicBlock::new(bb_id);
| ----^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: unused variable: `block_id`
--> src/mir/loop_builder.rs:246:39
|
246 | fn mark_block_unsealed(&mut self, block_id: BasicBlockId) -> Result<(), String> {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_block_id`
warning: unused variable: `block_id`
--> src/mir/loop_builder.rs:273:49
|
273 | fn get_variable_at_block(&self, name: &str, block_id: BasicBlockId) -> Option<ValueId> {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_block_id`
warning: unused variable: `child`
--> src/mir/ownership_verifier_simple.rs:313:13
|
313 | let child = value_gen.next();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_child`
warning: unused variable: `dst`
--> src/backend/vm_phi.rs:48:9
|
48 | dst: ValueId,
| ^^^ help: if this is intentional, prefix it with an underscore: `_dst`
warning: unused variable: `f`
--> src/bid/plugin_api.rs:167:36
|
167 | pub fn with_alloc<F>(mut self, f: F) -> Self
| ^ help: if this is intentional, prefix it with an underscore: `_f`
warning: variable does not need to be mutable
--> src/bid/plugin_api.rs:167:26
|
167 | pub fn with_alloc<F>(mut self, f: F) -> Self
| ----^^^^
| |
| help: remove this `mut`
warning: unused variable: `f`
--> src/bid/plugin_api.rs:176:35
|
176 | pub fn with_free<F>(mut self, f: F) -> Self
| ^ help: if this is intentional, prefix it with an underscore: `_f`
warning: variable does not need to be mutable
--> src/bid/plugin_api.rs:176:25
|
176 | pub fn with_free<F>(mut self, f: F) -> Self
| ----^^^^
| |
| help: remove this `mut`
warning: unused variable: `f`
--> src/bid/plugin_api.rs:183:34
|
183 | pub fn with_log<F>(mut self, f: F) -> Self
| ^ help: if this is intentional, prefix it with an underscore: `_f`
warning: variable does not need to be mutable
--> src/bid/plugin_api.rs:183:24
|
183 | pub fn with_log<F>(mut self, f: F) -> Self
| ----^^^^
| |
| help: remove this `mut`
warning: unused variable: `args`
--> src/runtime/plugin_loader_v2.rs:236:46
|
236 | pub fn create_box(&self, box_type: &str, args: &[Box<dyn NyashBox>]) -> BidResult<Box<dyn NyashBox>> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
warning: variable does not need to be mutable
--> src/tests/box_tests.rs:11:13
|
11 | let mut array = ArrayBox::new();
| ----^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/tests/box_tests.rs:90:13
|
90 | let mut stream = NyashStreamBox::from_data(vec![72, 101, 108, 108, 111]); // "Hello"
| ----^^^^^^
| |
| help: remove this `mut`
warning: type `FileMode` is more private than the item `FileBoxRegistry::open`
--> src/bid/plugins/filebox/mod.rs:44:5
|
44 | pub fn open(&mut self, path: &str, mode: FileMode) -> Result<BidHandle, std::io::Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method `FileBoxRegistry::open` is reachable at visibility `pub`
|
note: but type `FileMode` is only usable at visibility `pub(self)`
--> src/bid/plugins/filebox/mod.rs:29:1
|
29 | enum FileMode {
| ^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
warning: field `block_var_maps` is never read
--> src/mir/loop_builder.rs:35:5
|
27 | pub struct LoopBuilder<'a> {
| ----------- field in this struct
...
35 | block_var_maps: HashMap<BasicBlockId, HashMap<String, ValueId>>,
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: fields `type_name_holder` and `method_holders` are never read
--> src/bid/metadata.rs:148:5
|
143 | pub struct PluginMetadata {
| -------------- fields in this struct
...
148 | type_name_holder: Option<CString>,
| ^^^^^^^^^^^^^^^^
149 | method_holders: Vec<(NyashMethodInfo, CString)>,
| ^^^^^^^^^^^^^^
warning: fields `path` and `mode` are never read
--> src/bid/plugins/filebox/mod.rs:24:5
|
22 | struct FileBoxState {
| ------------ fields in this struct
23 | file: File,
24 | path: String,
| ^^^^
25 | mode: FileMode,
| ^^^^
warning: fields `box_types` and `init_fn` are never read
--> src/runtime/plugin_loader_v2.rs:20:5
|
15 | pub struct LoadedPluginV2 {
| -------------- fields in this struct
...
20 | box_types: Vec<String>,
| ^^^^^^^^^
...
23 | init_fn: Option<unsafe extern "C" fn() -> i32>,
| ^^^^^^^
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:62:9
|
62 | self.add_predecessor(header_id, preheader_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
62 | let _ = self.add_predecessor(header_id, preheader_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:66:9
|
66 | self.mark_block_unsealed(header_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
66 | let _ = self.mark_block_unsealed(header_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:78:9
|
78 | self.add_predecessor(body_id, header_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
78 | let _ = self.add_predecessor(body_id, header_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:79:9
|
79 | self.add_predecessor(after_loop_id, header_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
79 | let _ = self.add_predecessor(after_loop_id, header_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:93:9
|
93 | self.add_predecessor(header_id, latch_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
93 | let _ = self.add_predecessor(header_id, latch_id);
| +++++++
warning: creating a shared reference to mutable static
--> src/bid/plugins/filebox/mod.rs:102:12
|
102 | if FILEBOX_REGISTRY.is_none() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
= note: `#[warn(static_mut_refs)]` on by default
warning: creating a shared reference to mutable static
--> src/bid/plugins/filebox/mod.rs:105:9
|
105 | FILEBOX_REGISTRY.as_ref().unwrap().clone()
| ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
warning: `nyash-rust` (lib test) generated 50 warnings (run `cargo fix --lib -p nyash-rust --tests` to apply 25 suggestions)
Finished `test` profile [unoptimized + debuginfo] target(s) in 1.81s
Running unittests src/lib.rs (target/debug/deps/nyash_rust-027bd4c76143e77b)
running 1 test
🔍 DEBUG: Starting interpreter execution...
🔍 DEBUG: execute_node called with node type: Program
🔍 DEBUG: Executing program with 1 statements
🔍 DEBUG: Executing statement 1 of 1: Assignment
🔍 execute_statement called with node type: "Assignment"
🔍 About to call execute_assignment...
🔍 execute_assignment called, evaluating value expression...
🔍 execute_new called for class: IntegerBox, with 1 arguments
🔍 Trying unified registry for class: IntegerBox
🏭 Unified registry created: IntegerBox
🔍 execute_new called for class: IntegerBox, with 1 arguments
🔍 Trying unified registry for class: IntegerBox
🏭 Unified registry created: IntegerBox
🔧 execute_binary_op: op=Add, left=IntegerBox, right=IntegerBox
🔍 try_add_operation: left=IntegerBox, right=IntegerBox
🔍 After unwrap: left=IntegerBox, right=IntegerBox
🔍 Checking StringBox downcast...
🔍 StringBox downcast FAILED!
❌ Interpreter error: Invalid operation: Addition not supported between IntegerBox and IntegerBox
🔍 DEBUG: Interpreter execution completed
thread 'interpreter::core::tests::test_arithmetic' panicked at src/interpreter/core.rs:590:34:
called `Result::unwrap()` on an `Err` value: InvalidOperation { message: "Addition not supported between IntegerBox and IntegerBox" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
test interpreter::core::tests::test_arithmetic ... FAILED
failures:
failures:
interpreter::core::tests::test_arithmetic
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 155 filtered out; finished in 0.19s
error: test failed, to rerun pass `--lib`

1108
test_out2.txt Normal file

File diff suppressed because it is too large Load Diff

1104
test_out3.txt Normal file

File diff suppressed because it is too large Load Diff

405
test_out4.txt Normal file
View File

@ -0,0 +1,405 @@
Compiling nyash-rust v0.1.0 (/mnt/c/git/nyash-project/nyash)
warning: unused imports: `BoolBox`, `IntegerBox`, and `StringBox`
--> src/ast.rs:885:28
|
885 | use crate::box_trait::{StringBox, IntegerBox, BoolBox};
| ^^^^^^^^^ ^^^^^^^^^^ ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused import: `Mutex`
--> src/instance_v2.rs:387:26
|
387 | use std::sync::{Arc, Mutex};
| ^^^^^
warning: unused imports: `BasicBlockIdGenerator`, `BasicBlock`, `CompareOp`, `EffectMask`, `MirFunction`, and `ValueIdGenerator`
--> src/mir/loop_builder.rs:9:21
|
9 | MirInstruction, BasicBlock, BasicBlockId, MirFunction, ValueId,
| ^^^^^^^^^^ ^^^^^^^^^^^
10 | ConstValue, CompareOp, BasicBlockIdGenerator, ValueIdGenerator, EffectMask
| ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `HashSet`
--> src/mir/loop_builder.rs:13:33
|
13 | use std::collections::{HashMap, HashSet};
| ^^^^^^^
warning: unused import: `BasicBlock`
--> src/mir/verification.rs:311:75
|
311 | use crate::mir::{MirFunction, FunctionSignature, MirType, EffectMask, BasicBlock};
| ^^^^^^^^^^
warning: unexpected `cfg` condition value: `llvm`
--> src/backend/mod.rs:13:7
|
13 | #[cfg(feature = "llvm")]
| ^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `all-examples`, `cli`, `default`, `dynamic-file`, `gui`, `gui-examples`, and `wasm-backend`
= help: consider adding `llvm` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
= note: `#[warn(unexpected_cfgs)]` on by default
warning: unexpected `cfg` condition value: `llvm`
--> src/backend/mod.rs:23:7
|
23 | #[cfg(feature = "llvm")]
| ^^^^^^^^^^^^^^^^
|
= note: expected values for `feature` are: `all-examples`, `cli`, `default`, `dynamic-file`, `gui`, `gui-examples`, and `wasm-backend`
= help: consider adding `llvm` as a feature in `Cargo.toml`
= note: see <https://doc.rust-lang.org/nightly/rustc/check-cfg/cargo-specifics.html> for more information about checking conditional configuration
warning: unused imports: `BasicBlock`, `EffectMask`, `FunctionSignature`, `MirFunction`, `MirModule`, and `MirType`
--> src/backend/vm.rs:860:22
|
860 | use crate::mir::{MirModule, MirFunction, FunctionSignature, MirType, EffectMask, BasicBlock};
| ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^ ^^^^^^^ ^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `MirInstruction`
--> src/backend/vm_phi.rs:9:41
|
9 | use crate::mir::{BasicBlockId, ValueId, MirInstruction};
| ^^^^^^^^^^^^^^
warning: unused import: `super::Usize`
--> src/bid/types.rs:1:5
|
1 | use super::Usize;
| ^^^^^^^^^^^^
warning: unused import: `std::os::raw::c_char`
--> src/bid/plugin_api.rs:2:5
|
2 | use std::os::raw::c_char;
| ^^^^^^^^^^^^^^^^^^^^
warning: unused imports: `NyashHostVtable`, `NyashMethodInfo`, and `NyashPluginInfo`
--> src/bid/plugins/filebox/mod.rs:7:18
|
7 | use crate::bid::{NyashPluginInfo, NyashMethodInfo, NyashHostVtable};
| ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^
warning: unused imports: `SeekFrom` and `Seek`
--> src/bid/plugins/filebox/mod.rs:10:28
|
10 | use std::io::{Read, Write, Seek, SeekFrom};
| ^^^^ ^^^^^^^^
warning: unused imports: `c_char` and `c_void`
--> src/bid/plugins/filebox/mod.rs:11:20
|
11 | use std::os::raw::{c_char, c_void};
| ^^^^^^ ^^^^^^
warning: unused imports: `CStr` and `CString`
--> src/bid/plugins/filebox/mod.rs:13:16
|
13 | use std::ffi::{CStr, CString};
| ^^^^ ^^^^^^^
warning: unused import: `std::ffi::c_void`
--> src/bid/loader.rs:3:5
|
3 | use std::ffi::c_void;
| ^^^^^^^^^^^^^^^^
warning: unused imports: `TlvDecoder` and `TlvEncoder`
--> src/bid/generic_plugin_box.rs:2:23
|
2 | use crate::bid::tlv::{TlvEncoder, TlvDecoder};
| ^^^^^^^^^^ ^^^^^^^^^^
warning: unused import: `crate::bid::types::BidTag`
--> src/bid/generic_plugin_box.rs:3:5
|
3 | use crate::bid::types::BidTag;
| ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: unused import: `BoxBase`
--> src/runtime/plugin_loader_v2.rs:7:43
|
7 | use crate::box_trait::{NyashBox, BoxCore, BoxBase, StringBox};
| ^^^^^^^
warning: unused import: `std::ffi::c_void`
--> src/runtime/plugin_loader_v2.rs:11:5
|
11 | use std::ffi::c_void;
| ^^^^^^^^^^^^^^^^
warning: unused imports: `BidHandle` and `BoxTypeId`
--> src/runtime/tests.rs:10:22
|
10 | use crate::bid::{BidHandle, BoxTypeId};
| ^^^^^^^^^ ^^^^^^^^^
warning: unused variable: `registry`
--> src/box_factory/plugin.rs:53:13
|
53 | let registry = get_global_registry();
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_registry`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `args`
--> src/instance_v2.rs:147:28
|
147 | pub fn init(&mut self, args: &[Box<dyn NyashBox>]) -> Result<(), String> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
warning: unused variable: `nyash_value`
--> src/instance_v2.rs:289:21
|
289 | if let Some(nyash_value) = self.fields_ng.lock().unwrap().get(field_name) {
| ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_nyash_value`
warning: variable does not need to be mutable
--> src/mir/basic_block.rs:314:13
|
314 | let mut bb = BasicBlock::new(bb_id);
| ----^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: unused variable: `block_id`
--> src/mir/loop_builder.rs:246:39
|
246 | fn mark_block_unsealed(&mut self, block_id: BasicBlockId) -> Result<(), String> {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_block_id`
warning: unused variable: `block_id`
--> src/mir/loop_builder.rs:273:49
|
273 | fn get_variable_at_block(&self, name: &str, block_id: BasicBlockId) -> Option<ValueId> {
| ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_block_id`
warning: unused variable: `child`
--> src/mir/ownership_verifier_simple.rs:313:13
|
313 | let child = value_gen.next();
| ^^^^^ help: if this is intentional, prefix it with an underscore: `_child`
warning: unused variable: `dst`
--> src/backend/vm_phi.rs:48:9
|
48 | dst: ValueId,
| ^^^ help: if this is intentional, prefix it with an underscore: `_dst`
warning: unused variable: `f`
--> src/bid/plugin_api.rs:167:36
|
167 | pub fn with_alloc<F>(mut self, f: F) -> Self
| ^ help: if this is intentional, prefix it with an underscore: `_f`
warning: variable does not need to be mutable
--> src/bid/plugin_api.rs:167:26
|
167 | pub fn with_alloc<F>(mut self, f: F) -> Self
| ----^^^^
| |
| help: remove this `mut`
warning: unused variable: `f`
--> src/bid/plugin_api.rs:176:35
|
176 | pub fn with_free<F>(mut self, f: F) -> Self
| ^ help: if this is intentional, prefix it with an underscore: `_f`
warning: variable does not need to be mutable
--> src/bid/plugin_api.rs:176:25
|
176 | pub fn with_free<F>(mut self, f: F) -> Self
| ----^^^^
| |
| help: remove this `mut`
warning: unused variable: `f`
--> src/bid/plugin_api.rs:183:34
|
183 | pub fn with_log<F>(mut self, f: F) -> Self
| ^ help: if this is intentional, prefix it with an underscore: `_f`
warning: variable does not need to be mutable
--> src/bid/plugin_api.rs:183:24
|
183 | pub fn with_log<F>(mut self, f: F) -> Self
| ----^^^^
| |
| help: remove this `mut`
warning: unused variable: `args`
--> src/runtime/plugin_loader_v2.rs:236:46
|
236 | pub fn create_box(&self, box_type: &str, args: &[Box<dyn NyashBox>]) -> BidResult<Box<dyn NyashBox>> {
| ^^^^ help: if this is intentional, prefix it with an underscore: `_args`
warning: variable does not need to be mutable
--> src/tests/box_tests.rs:11:13
|
11 | let mut array = ArrayBox::new();
| ----^^^^^
| |
| help: remove this `mut`
warning: variable does not need to be mutable
--> src/tests/box_tests.rs:90:13
|
90 | let mut stream = NyashStreamBox::from_data(vec![72, 101, 108, 108, 111]); // "Hello"
| ----^^^^^^
| |
| help: remove this `mut`
warning: type `FileMode` is more private than the item `FileBoxRegistry::open`
--> src/bid/plugins/filebox/mod.rs:44:5
|
44 | pub fn open(&mut self, path: &str, mode: FileMode) -> Result<BidHandle, std::io::Error> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method `FileBoxRegistry::open` is reachable at visibility `pub`
|
note: but type `FileMode` is only usable at visibility `pub(self)`
--> src/bid/plugins/filebox/mod.rs:29:1
|
29 | enum FileMode {
| ^^^^^^^^^^^^^
= note: `#[warn(private_interfaces)]` on by default
warning: field `block_var_maps` is never read
--> src/mir/loop_builder.rs:35:5
|
27 | pub struct LoopBuilder<'a> {
| ----------- field in this struct
...
35 | block_var_maps: HashMap<BasicBlockId, HashMap<String, ValueId>>,
| ^^^^^^^^^^^^^^
|
= note: `#[warn(dead_code)]` on by default
warning: fields `type_name_holder` and `method_holders` are never read
--> src/bid/metadata.rs:148:5
|
143 | pub struct PluginMetadata {
| -------------- fields in this struct
...
148 | type_name_holder: Option<CString>,
| ^^^^^^^^^^^^^^^^
149 | method_holders: Vec<(NyashMethodInfo, CString)>,
| ^^^^^^^^^^^^^^
warning: fields `path` and `mode` are never read
--> src/bid/plugins/filebox/mod.rs:24:5
|
22 | struct FileBoxState {
| ------------ fields in this struct
23 | file: File,
24 | path: String,
| ^^^^
25 | mode: FileMode,
| ^^^^
warning: fields `box_types` and `init_fn` are never read
--> src/runtime/plugin_loader_v2.rs:20:5
|
15 | pub struct LoadedPluginV2 {
| -------------- fields in this struct
...
20 | box_types: Vec<String>,
| ^^^^^^^^^
...
23 | init_fn: Option<unsafe extern "C" fn() -> i32>,
| ^^^^^^^
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:62:9
|
62 | self.add_predecessor(header_id, preheader_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
= note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
|
62 | let _ = self.add_predecessor(header_id, preheader_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:66:9
|
66 | self.mark_block_unsealed(header_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
66 | let _ = self.mark_block_unsealed(header_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:78:9
|
78 | self.add_predecessor(body_id, header_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
78 | let _ = self.add_predecessor(body_id, header_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:79:9
|
79 | self.add_predecessor(after_loop_id, header_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
79 | let _ = self.add_predecessor(after_loop_id, header_id);
| +++++++
warning: unused `Result` that must be used
--> src/mir/loop_builder.rs:93:9
|
93 | self.add_predecessor(header_id, latch_id);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this `Result` may be an `Err` variant, which should be handled
help: use `let _ = ...` to ignore the resulting value
|
93 | let _ = self.add_predecessor(header_id, latch_id);
| +++++++
warning: creating a shared reference to mutable static
--> src/bid/plugins/filebox/mod.rs:102:12
|
102 | if FILEBOX_REGISTRY.is_none() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
= note: `#[warn(static_mut_refs)]` on by default
warning: creating a shared reference to mutable static
--> src/bid/plugins/filebox/mod.rs:105:9
|
105 | FILEBOX_REGISTRY.as_ref().unwrap().clone()
| ^^^^^^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static
|
= note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html>
= note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives
error: could not compile `nyash-rust` (lib)
Caused by:
could not execute process `/home/tomoaki/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name nyash_rust --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --crate-type rlib --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="cli"' --cfg 'feature="default"' --check-cfg 'cfg(docsrs,test)' --check-cfg 'cfg(feature, values("all-examples", "cli", "default", "dynamic-file", "gui", "gui-examples", "wasm-backend"))' -C metadata=024e0bfefa24aea7 --out-dir /mnt/c/git/nyash-project/nyash/target/debug/deps -C incremental=/mnt/c/git/nyash-project/nyash/target/debug/incremental -L dependency=/mnt/c/git/nyash-project/nyash/target/debug/deps --extern anyhow=/mnt/c/git/nyash-project/nyash/target/debug/deps/libanyhow-cb0106135621df54.rlib --extern chrono=/mnt/c/git/nyash-project/nyash/target/debug/deps/libchrono-0d332b6d25ba4f26.rlib --extern clap=/mnt/c/git/nyash-project/nyash/target/debug/deps/libclap-402745ede5642e57.rlib --extern console_error_panic_hook=/mnt/c/git/nyash-project/nyash/target/debug/deps/libconsole_error_panic_hook-8d542a370ca115ea.rlib --extern env_logger=/mnt/c/git/nyash-project/nyash/target/debug/deps/libenv_logger-b5822987cce07060.rlib --extern js_sys=/mnt/c/git/nyash-project/nyash/target/debug/deps/libjs_sys-9f8e174f128030e3.rlib --extern lazy_static=/mnt/c/git/nyash-project/nyash/target/debug/deps/liblazy_static-a60c6f0d6f5b0a48.rlib --extern libloading=/mnt/c/git/nyash-project/nyash/target/debug/deps/liblibloading-212293e6e9433adc.rlib --extern log=/mnt/c/git/nyash-project/nyash/target/debug/deps/liblog-97254b5c9fae48ec.rlib --extern once_cell=/mnt/c/git/nyash-project/nyash/target/debug/deps/libonce_cell-140027e2059e248c.rlib --extern regex=/mnt/c/git/nyash-project/nyash/target/debug/deps/libregex-593e58218ee7d01e.rlib --extern serde=/mnt/c/git/nyash-project/nyash/target/debug/deps/libserde-fe05dc3dd0f4c02d.rlib --extern serde_json=/mnt/c/git/nyash-project/nyash/target/debug/deps/libserde_json-4c960d663cd516d2.rlib --extern thiserror=/mnt/c/git/nyash-project/nyash/target/debug/deps/libthiserror-4e3b67f662716893.rlib --extern toml=/mnt/c/git/nyash-project/nyash/target/debug/deps/libtoml-5883ff1c2c8abaf1.rlib --extern wasm_bindgen=/mnt/c/git/nyash-project/nyash/target/debug/deps/libwasm_bindgen-79650e8bccd47590.rlib --extern web_sys=/mnt/c/git/nyash-project/nyash/target/debug/deps/libweb_sys-a459292f085ab080.rlib` (never executed)
Caused by:
Operation not permitted (os error 1)
warning: build failed, waiting for other jobs to finish...
warning: `nyash-rust` (lib test) generated 50 warnings (run `cargo fix --lib -p nyash-rust --tests` to apply 25 suggestions)

1155
test_out5.txt Normal file

File diff suppressed because it is too large Load Diff

1155
test_out_full.txt Normal file

File diff suppressed because it is too large Load Diff

1140
test_run_output.txt Normal file

File diff suppressed because it is too large Load Diff