diff --git a/.cargo/config.toml b/.cargo/config.toml index 47684146c..47526e934 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,2 +1,6 @@ [env] CARGO_WORKSPACE_DIR = { value = "", relative = true } + +# Windows環境でテストエラーになるのを防ぐために設定するworkaround +# https://github.com/VOICEVOX/onnxruntime-rs/issues/3#issuecomment-1207381367 +ORT_OUT_DIR = { value = "target/debug/deps", relative = true } diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f14b6ebe..a7521d133 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -58,16 +58,6 @@ jobs: with: # cargoのキャッシュが原因でテストが失敗する場合はバージョン部分をカウントアップすること key: "v1-cargo-test-cache-${{ matrix.additional-features }}-${{ matrix.os }}" - # FIXME: windows-2022 では、onnxruntime-sys のビルド時にダウンロードされる onnxruntime.dll に対してパスが通らないために、テストが行えない - # 原因が不明であるため、姑息的な回避策として target/debug/deps ディレクトリに onnxruntime.dll をコピーする。根本的な解決策を望む。 - # cf. https://github.com/VOICEVOX/voicevox_core/pull/140#issuecomment-1140276585 - - name: Prepare onnxruntime.dll - if: matrix.os == 'windows-2022' - shell: bash - run: | - cargo build - find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll -ctime 0 - find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll -ctime 0 | head -n 1 | xargs -i cp {} target/debug/deps/ - run: cargo test --features generate-c-header,${{ matrix.additional-features }} build-unix-cpp-example: diff --git a/README.md b/README.md index 4d6ffbe96..0ade9ce42 100644 --- a/README.md +++ b/README.md @@ -162,9 +162,6 @@ cargo build --release ## コアライブラリのテスト ```bash -# Windowsの場合は最初にonnxruntime.dllをカレントディレクトリにコピーする必要があります -# find target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib -name onnxruntime.dll | head -n 1 | xargs -i cp {} target/debug/deps/ - cargo test ``` diff --git a/crates/voicevox_core/Cargo.toml b/crates/voicevox_core/Cargo.toml index 68746157b..0e4f10fec 100644 --- a/crates/voicevox_core/Cargo.toml +++ b/crates/voicevox_core/Cargo.toml @@ -19,7 +19,7 @@ derive-getters = "0.2.0" derive-new = "0.5.9" libc = "0.2.126" once_cell = "1.10.0" -onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", version = "0.0.28" } +onnxruntime = { git = "https://github.com/VOICEVOX/onnxruntime-rs.git", version = "0.0.29" } serde = "1.0.137" serde_json = "1.0.81" thiserror = "1.0.31"