Skip to content

Commit

Permalink
Windows環境でテストエラーになるのを防ぐ処理を追加
Browse files Browse the repository at this point in the history
workaroundが自動化されるのでCIテスト、READMEのworkaround手順を削除
  • Loading branch information
qwerty2501 committed Aug 9, 2022
1 parent 6dbf15c commit eed0b3b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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 }
10 changes: 0 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion crates/voicevox_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit eed0b3b

Please sign in to comment.