From 2244a2ba4c3ab807ec2444b0a06539e52692d0fa Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 30 Dec 2024 03:09:46 +0000
Subject: [PATCH 1/7] Update submodule
---
binding/voicevox_core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/binding/voicevox_core b/binding/voicevox_core
index 66582bd..ef66cc2 160000
--- a/binding/voicevox_core
+++ b/binding/voicevox_core
@@ -1 +1 @@
-Subproject commit 66582bd052a17c67ee77833d12ac531a4f1b158b
+Subproject commit ef66cc2958a143ff45ceb46e8ba84f91898d66bc
From 5a6498da2e27fcde9f119e8012317c09137ca12a Mon Sep 17 00:00:00 2001
From: "github-actions[bot]"
<41898282+github-actions[bot]@users.noreply.github.com>
Date: Mon, 30 Dec 2024 03:09:55 +0000
Subject: [PATCH 2/7] make generate
---
src/VoicevoxCoreSharp.Core/VoicevoxCoreSharp.Core.Metas.props | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/VoicevoxCoreSharp.Core/VoicevoxCoreSharp.Core.Metas.props b/src/VoicevoxCoreSharp.Core/VoicevoxCoreSharp.Core.Metas.props
index 30d90f0..4075673 100644
--- a/src/VoicevoxCoreSharp.Core/VoicevoxCoreSharp.Core.Metas.props
+++ b/src/VoicevoxCoreSharp.Core/VoicevoxCoreSharp.Core.Metas.props
@@ -1,6 +1,6 @@
1.17.3
- 66582bd052a17c67ee77833d12ac531a4f1b158b
+ ef66cc2958a143ff45ceb46e8ba84f91898d66bc
From 095d3faa25019a5a41b6d14b981b1576e69f2681 Mon Sep 17 00:00:00 2001
From: yamachu
Date: Tue, 28 Jan 2025 18:58:12 +0900
Subject: [PATCH 3/7] =?UTF-8?q?=E5=88=A5=E3=81=AEWorkflow=E3=81=A7?=
=?UTF-8?q?=E5=AE=9F=E4=BD=93=E3=82=92=E4=BD=BF=E3=81=84=E3=81=9F=E3=81=8F?=
=?UTF-8?q?=E3=81=AA=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=81unlink=E3=81=99?=
=?UTF-8?q?=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/composite/build-dev-rust/action.yml | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.github/composite/build-dev-rust/action.yml b/.github/composite/build-dev-rust/action.yml
index 2f572b8..3ac1054 100644
--- a/.github/composite/build-dev-rust/action.yml
+++ b/.github/composite/build-dev-rust/action.yml
@@ -24,6 +24,19 @@ runs:
shell: bash
working-directory: ./binding
run: make build/dev-library
+ - if: ${{ steps.restore-dev-library.outputs.cache-hit != 'true' }}
+ shell: bash
+ working-directory: ./binding/voicevox_core/target/release
+ # ライブラリのシンボリックリンクをコピーしてリンクを解除する
+ run: |
+ find . -type l | while read link; do
+ target=$(readlink "$link")
+ if [ -f "$target" ]; then
+ cp "$target" "$link".tmp
+ unlink "$link"
+ mv "$link".tmp "$link"
+ fi
+ done
- if: ${{ steps.restore-dev-library.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
From 5c48401dd73b4e4a6f6a219a30dee8b377b4b1c2 Mon Sep 17 00:00:00 2001
From: yamachu
Date: Tue, 28 Jan 2025 19:00:24 +0900
Subject: [PATCH 4/7] =?UTF-8?q?libonnxruntime=E3=82=82cache=E3=81=97?=
=?UTF-8?q?=E3=81=9F=E3=82=8Arestore=E3=81=97=E3=81=9F=E3=82=8A=E3=81=99?=
=?UTF-8?q?=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/csharp_test.yml | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/.github/workflows/csharp_test.yml b/.github/workflows/csharp_test.yml
index 3a13f6d..7e3461e 100644
--- a/.github/workflows/csharp_test.yml
+++ b/.github/workflows/csharp_test.yml
@@ -24,7 +24,9 @@ jobs:
ref: ${{ inputs.checkout-ref || github.head_ref }}
- uses: ./.github/composite/build-dev-rust
with:
- cache-path: ./binding/voicevox_core/target/release/libvoicevox_core.so
+ cache-path: |
+ ./binding/voicevox_core/target/release/libvoicevox_core.so
+ ./binding/voicevox_core/target/release/libonnxruntime.so
cache-key: ${{ runner.os }}-dev-library-${{ hashFiles('**/Cargo.lock', '**/VoicevoxCoreSharp.Core.Metas.props') }}
test-dotnet:
@@ -40,9 +42,13 @@ jobs:
dotnet-version: 6
- uses: actions/cache/restore@v4
with:
- path: ./binding/voicevox_core/target/release/libvoicevox_core.so
+ path: |
+ ./binding/voicevox_core/target/release/libvoicevox_core.so
+ ./binding/voicevox_core/target/release/libonnxruntime.so
key: ${{ runner.os }}-dev-library-${{ hashFiles('**/Cargo.lock', '**/VoicevoxCoreSharp.Core.Metas.props') }}
- - run: cp ./binding/voicevox_core/target/release/libvoicevox_core.so ./tests/VoicevoxCoreSharp.Core.Tests/resources/libvoicevox_core.so
+ - run: |
+ cp ./binding/voicevox_core/target/release/libvoicevox_core.so ./tests/VoicevoxCoreSharp.Core.Tests/resources/libvoicevox_core.so
+ cp ./binding/voicevox_core/target/release/libonnxruntime.so ./tests/VoicevoxCoreSharp.Core.Tests/resources/libonnxruntime.so
- uses: ./.github/composite/download-openjtalk-dict
with:
cache-path: open_jtalk_dic_utf_8-1.11.tar.gz
@@ -67,10 +73,14 @@ jobs:
dotnet-version: 8
- uses: actions/cache/restore@v4
with:
- path: ./binding/voicevox_core/target/release/libvoicevox_core.so
+ path: |
+ ./binding/voicevox_core/target/release/libvoicevox_core.so
+ ./binding/voicevox_core/target/release/libonnxruntime.so
key: ${{ runner.os }}-dev-library-${{ hashFiles('**/Cargo.lock', '**/VoicevoxCoreSharp.Core.Metas.props') }}
- run: mkdir -p ./examples/cli/voicevox_core
- - run: cp ./binding/voicevox_core/target/release/libvoicevox_core.so ./examples/cli/voicevox_core/libvoicevox_core.so
+ - run: |
+ cp ./binding/voicevox_core/target/release/libvoicevox_core.so ./examples/cli/voicevox_core/libvoicevox_core.so
+ cp ./binding/voicevox_core/target/release/libonnxruntime.so ./examples/cli/voicevox_core/libonnxruntime.so
- uses: ./.github/composite/download-openjtalk-dict
with:
cache-path: open_jtalk_dic_utf_8-1.11.tar.gz
From b3dececc2e0325fb863da95b17193d8ae8d177f3 Mon Sep 17 00:00:00 2001
From: yamachu
Date: Tue, 28 Jan 2025 19:00:41 +0900
Subject: [PATCH 5/7] =?UTF-8?q?=E3=81=93=E3=81=AEWorkflow=E3=81=8B?=
=?UTF-8?q?=E3=82=89=E4=BD=BF=E3=81=84=E3=81=9F=E3=81=84=E3=81=97=E3=80=81?=
=?UTF-8?q?on:=20pull=5Frequest=E3=81=AB=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/csharp_test.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/csharp_test.yml b/.github/workflows/csharp_test.yml
index 7e3461e..a744d09 100644
--- a/.github/workflows/csharp_test.yml
+++ b/.github/workflows/csharp_test.yml
@@ -1,7 +1,7 @@
name: CI
on:
- push:
+ pull_request:
branches-ignore:
- 'auto.**'
workflow_call:
From 4df0799a34067192cb18c69518f60bdb1870f3bb Mon Sep 17 00:00:00 2001
From: yamachu
Date: Tue, 28 Jan 2025 19:02:36 +0900
Subject: [PATCH 6/7] =?UTF-8?q?voicevox=5Fcore=E3=82=92=E3=83=93=E3=83=AB?=
=?UTF-8?q?=E3=83=89=E3=81=97=E3=81=9F=E6=99=82=E3=81=AB=E4=BD=BF=E3=82=8F?=
=?UTF-8?q?=E3=82=8C=E3=81=9Fonnxruntime=E3=82=92=E4=BD=BF=E3=81=86?=
=?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../VoicevoxCoreSharp.Core.Tests.csproj | 20 ++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
diff --git a/tests/VoicevoxCoreSharp.Core.Tests/VoicevoxCoreSharp.Core.Tests.csproj b/tests/VoicevoxCoreSharp.Core.Tests/VoicevoxCoreSharp.Core.Tests.csproj
index 7667f17..d70c183 100644
--- a/tests/VoicevoxCoreSharp.Core.Tests/VoicevoxCoreSharp.Core.Tests.csproj
+++ b/tests/VoicevoxCoreSharp.Core.Tests/VoicevoxCoreSharp.Core.Tests.csproj
@@ -11,7 +11,6 @@
-
@@ -66,18 +65,21 @@
-
-
+
+
+
-
-
-
+
+
+
+
-
-
-
+
+
+
+
From 760aa60672f104fc8af543a2a7f25ef9778dc4ab Mon Sep 17 00:00:00 2001
From: yamachu
Date: Tue, 28 Jan 2025 19:04:20 +0900
Subject: [PATCH 7/7] =?UTF-8?q?dlopen=E3=81=A7=E4=BD=BF=E3=81=86=E3=81=AE?=
=?UTF-8?q?=E3=81=AF=E3=82=B7=E3=82=B9=E3=83=86=E3=83=A0=E3=81=AE=E8=A8=AD?=
=?UTF-8?q?=E5=AE=9A=E3=81=A7=E3=80=81=E6=98=8E=E7=A4=BA=E7=9A=84=E3=81=AB?=
=?UTF-8?q?=E3=83=91=E3=82=B9=E3=82=92=E6=B8=A1=E3=81=95=E3=81=AA=E3=81=84?=
=?UTF-8?q?=E3=81=A8=E5=8F=82=E7=85=A7=E3=81=A7=E3=81=8D=E3=81=AA=E3=81=84?=
=?UTF-8?q?=E3=81=AE=E3=81=A7=E3=80=81Default=E3=81=AF=E4=BD=BF=E3=82=8F?=
=?UTF-8?q?=E3=81=9A=E3=81=AB=E4=BD=BF=E3=81=86=E6=99=82=E3=81=AB=E6=98=8E?=
=?UTF-8?q?=E7=A4=BA=E3=81=99=E3=82=8B?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
tests/VoicevoxCoreSharp.Core.Tests/Helper.cs | 12 ++++++++++++
.../VoicevoxCoreSharp.Core.Tests/OnnxruntimeTest.cs | 3 ++-
.../VoicevoxCoreSharp.Core.Tests/SynthesizerTest.cs | 3 ++-
tests/VoicevoxCoreSharp.Core.Tests/UtilsTest.cs | 3 ++-
4 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/tests/VoicevoxCoreSharp.Core.Tests/Helper.cs b/tests/VoicevoxCoreSharp.Core.Tests/Helper.cs
index 5d5907e..1cf42b7 100644
--- a/tests/VoicevoxCoreSharp.Core.Tests/Helper.cs
+++ b/tests/VoicevoxCoreSharp.Core.Tests/Helper.cs
@@ -1,6 +1,7 @@
using System;
using System.IO;
using System.Reflection;
+using System.Runtime.InteropServices;
namespace VoicevoxCoreSharp.Core.Tests
{
@@ -27,5 +28,16 @@ public static string GetTestResultsDirectory()
{
return Path.Combine(GetProjectDirectory(), "results");
}
+
+ public static string GetOnnxruntimeAssemblyName()
+ {
+ return 0 switch
+ {
+ var _ when RuntimeInformation.IsOSPlatform(OSPlatform.Windows) => "onnxruntime.dll",
+ var _ when RuntimeInformation.IsOSPlatform(OSPlatform.Linux) => "libonnxruntime.so",
+ var _ when RuntimeInformation.IsOSPlatform(OSPlatform.OSX) => "libonnxruntime.dylib",
+ _ => throw new PlatformNotSupportedException()
+ };
+ }
}
}
diff --git a/tests/VoicevoxCoreSharp.Core.Tests/OnnxruntimeTest.cs b/tests/VoicevoxCoreSharp.Core.Tests/OnnxruntimeTest.cs
index 393a79f..8e514f7 100644
--- a/tests/VoicevoxCoreSharp.Core.Tests/OnnxruntimeTest.cs
+++ b/tests/VoicevoxCoreSharp.Core.Tests/OnnxruntimeTest.cs
@@ -1,4 +1,5 @@
using System;
+using System.IO;
using System.Runtime.InteropServices;
using VoicevoxCoreSharp.Core.Enum;
using VoicevoxCoreSharp.Core.Struct;
@@ -19,7 +20,7 @@ var _ when RuntimeInformation.IsOSPlatform(OSPlatform.Linux) => "libonnxruntime_
var _ when RuntimeInformation.IsOSPlatform(OSPlatform.OSX) => "libonnxruntime_another_path.dylib",
_ => throw new PlatformNotSupportedException()
};
- var option = new LoadOnnxruntimeOptions(libraryPath);
+ var option = new LoadOnnxruntimeOptions(Path.Join(AppContext.BaseDirectory, libraryPath));
var result = Onnxruntime.LoadOnce(option, out var onnruntime);
Assert.Equal(ResultCode.RESULT_OK, result);
diff --git a/tests/VoicevoxCoreSharp.Core.Tests/SynthesizerTest.cs b/tests/VoicevoxCoreSharp.Core.Tests/SynthesizerTest.cs
index 34e0ae2..e19bee0 100644
--- a/tests/VoicevoxCoreSharp.Core.Tests/SynthesizerTest.cs
+++ b/tests/VoicevoxCoreSharp.Core.Tests/SynthesizerTest.cs
@@ -1,4 +1,5 @@
using System;
+using System.IO;
using VoicevoxCoreSharp.Core.Enum;
using VoicevoxCoreSharp.Core.Struct;
using Xunit;
@@ -12,7 +13,7 @@ public void Tts()
{
OpenJtalk.New(Consts.OpenJTalkDictDir, out var openJtalk);
var initializeOptions = InitializeOptions.Default();
- var onnxruntimeOptions = LoadOnnxruntimeOptions.Default();
+ var onnxruntimeOptions = new LoadOnnxruntimeOptions(Path.Join(AppContext.BaseDirectory, Helper.GetOnnxruntimeAssemblyName()));
if (Onnxruntime.LoadOnce(onnxruntimeOptions, out var onnruntime) != ResultCode.RESULT_OK)
{
Assert.Fail("Failed to initialize onnxruntime");
diff --git a/tests/VoicevoxCoreSharp.Core.Tests/UtilsTest.cs b/tests/VoicevoxCoreSharp.Core.Tests/UtilsTest.cs
index 932f6aa..d378989 100644
--- a/tests/VoicevoxCoreSharp.Core.Tests/UtilsTest.cs
+++ b/tests/VoicevoxCoreSharp.Core.Tests/UtilsTest.cs
@@ -1,4 +1,5 @@
using System;
+using System.IO;
using VoicevoxCoreSharp.Core.Enum;
using VoicevoxCoreSharp.Core.Struct;
using Xunit;
@@ -10,7 +11,7 @@ public class UtilsTest
[Fact]
public void CreateSupportedDevicesJson()
{
- var option = LoadOnnxruntimeOptions.Default();
+ var option = new LoadOnnxruntimeOptions(Path.Join(AppContext.BaseDirectory, Helper.GetOnnxruntimeAssemblyName()));
if (Onnxruntime.LoadOnce(option, out var onnruntime) != ResultCode.RESULT_OK)
{
Assert.Fail("Failed to initialize onnxruntime");