diff --git a/Cargo.toml b/Cargo.toml index fcb1241f2..baa7fd78b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,6 +111,7 @@ rev = "de226a26e8e18edbdb1d6f986afe37bbbf35fbf4" version = "0.0.0" edition = "2021" publish = false +rust-version = "1.81.0" # min-sized-rustを元にrelease buildのサイズが小さくなるようにした # https://github.com/johnthagen/min-sized-rust diff --git a/README.md b/README.md index 4812c1297..129854da8 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ ## API -[API ドキュメント](https://voicevox.github.io/voicevox_core/apis/c_api/globals_func.html)をご覧ください。 +[API ドキュメント](https://voicevox.github.io/voicevox_core/apis/)をご覧ください。 ## ユーザーガイド @@ -144,9 +144,9 @@ VOICEVOX CORE の主要機能は Rust で実装されることを前提として ## コアライブラリのビルド -[Releases](https://github.com/VOICEVOX/voicevox_core/releases) にあるビルド済みのコアライブラリを利用せず、自分で一からビルドする場合こちらを参照してください。ビルドには [Rust](https://www.rust-lang.org/ja) ([Windows での Rust 開発環境構築手順はこちら](https://docs.microsoft.com/ja-jp/windows/dev-environment/rust/setup)) と [cmake](https://cmake.org/download/) が必要です。 - -model フォルダにある onnx モデルはダミーのため、ノイズの混じった音声が出力されます +ビルドには [Rust](https://www.rust-lang.org/ja) ([Windows での Rust 開発環境構築手順はこちら](https://docs.microsoft.com/ja-jp/windows/dev-environment/rust/setup)) と [cmake](https://cmake.org/download/) が必要です。 +[Releases](https://github.com/VOICEVOX/voicevox_core/releases) にあるビルド済みのコアライブラリを利用せず、自分で一からビルドした場合は、model フォルダにある onnx モデルのみが利用できます。 +このモデルはダミーのため、ノイズの混じった音声が出力されます。 ```bash # DLLをビルド diff --git a/crates/downloader/Cargo.toml b/crates/downloader/Cargo.toml index 427a1854d..d86d4f7a8 100644 --- a/crates/downloader/Cargo.toml +++ b/crates/downloader/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "downloader" edition.workspace = true +rust-version.workspace = true [[bin]] name = "download" diff --git a/crates/test_util/Cargo.toml b/crates/test_util/Cargo.toml index 329d5f603..5a6bbd7a4 100644 --- a/crates/test_util/Cargo.toml +++ b/crates/test_util/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "test_util" edition.workspace = true +rust-version.workspace = true [dependencies] libloading.workspace = true diff --git a/crates/voicevox_core/Cargo.toml b/crates/voicevox_core/Cargo.toml index 8390e1de3..8052b312a 100644 --- a/crates/voicevox_core/Cargo.toml +++ b/crates/voicevox_core/Cargo.toml @@ -3,6 +3,7 @@ name = "voicevox_core" version.workspace = true edition.workspace = true publish.workspace = true +rust-version.workspace = true [package.metadata.docs.rs] features = ["load-onnxruntime", "link-onnxruntime"] diff --git a/crates/voicevox_core/src/status.rs b/crates/voicevox_core/src/status.rs index 40e1ae6d2..95a1f6c0c 100644 --- a/crates/voicevox_core/src/status.rs +++ b/crates/voicevox_core/src/status.rs @@ -271,7 +271,7 @@ impl LoadedModels { } fn remove(&mut self, model_id: VoiceModelId) -> Result<()> { - if self.0.remove(&model_id).is_none() { + if self.0.shift_remove(&model_id).is_none() { return Err(ErrorRepr::ModelNotFound { model_id }.into()); } Ok(()) diff --git a/crates/voicevox_core/src/user_dict/dict.rs b/crates/voicevox_core/src/user_dict/dict.rs index e3bb640c9..91ec5ad9c 100644 --- a/crates/voicevox_core/src/user_dict/dict.rs +++ b/crates/voicevox_core/src/user_dict/dict.rs @@ -61,7 +61,7 @@ impl Inner { } fn remove_word(&self, word_uuid: Uuid) -> crate::Result { - let Some(word) = self.with_words(|words| words.remove(&word_uuid)) else { + let Some(word) = self.with_words(|words| words.shift_remove(&word_uuid)) else { return Err(ErrorRepr::WordNotFound(word_uuid).into()); }; Ok(word) diff --git a/crates/voicevox_core_c_api/Cargo.toml b/crates/voicevox_core_c_api/Cargo.toml index 1b74bfdf5..e03d6cc4f 100644 --- a/crates/voicevox_core_c_api/Cargo.toml +++ b/crates/voicevox_core_c_api/Cargo.toml @@ -3,6 +3,7 @@ name = "voicevox_core_c_api" version.workspace = true edition.workspace = true publish.workspace = true +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/crates/voicevox_core_java_api/Cargo.toml b/crates/voicevox_core_java_api/Cargo.toml index aed67c058..a34d4220a 100644 --- a/crates/voicevox_core_java_api/Cargo.toml +++ b/crates/voicevox_core_java_api/Cargo.toml @@ -3,6 +3,7 @@ name = "voicevox_core_java_api" version.workspace = true edition.workspace = true publish.workspace = true +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/crates/voicevox_core_macros/Cargo.toml b/crates/voicevox_core_macros/Cargo.toml index 0f8362e77..1be131d65 100644 --- a/crates/voicevox_core_macros/Cargo.toml +++ b/crates/voicevox_core_macros/Cargo.toml @@ -3,6 +3,7 @@ name = "voicevox_core_macros" version.workspace = true edition.workspace = true publish.workspace = true +rust-version.workspace = true [lib] name = "macros" diff --git a/crates/voicevox_core_python_api/Cargo.toml b/crates/voicevox_core_python_api/Cargo.toml index a2c6f7405..00e1e0d4e 100644 --- a/crates/voicevox_core_python_api/Cargo.toml +++ b/crates/voicevox_core_python_api/Cargo.toml @@ -3,6 +3,7 @@ name = "voicevox_core_python_api" version = "0.0.0" edition.workspace = true publish.workspace = true +rust-version.workspace = true [lib] crate-type = ["cdylib"] diff --git a/crates/xtask/Cargo.toml b/crates/xtask/Cargo.toml index 63d14515a..9fafb2aec 100644 --- a/crates/xtask/Cargo.toml +++ b/crates/xtask/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "xtask" edition.workspace = true +rust-version.workspace = true [dependencies] cbindgen.workspace = true diff --git a/docs/apis/index.html b/docs/apis/index.html index d1f5d09b2..efae64b13 100644 --- a/docs/apis/index.html +++ b/docs/apis/index.html @@ -4,11 +4,12 @@ - +

TODO: まともなページを用意する

+

VOICEVOX/voicevox_core#496

diff --git a/renovate.json b/renovate.json deleted file mode 100644 index f56767ea0..000000000 --- a/renovate.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "config:recommended" - ], - "timezone": "Asia/Tokyo", - "packageRules": [ - { - "groupSlug": "rust", - "groupName": "Rust", - "matchPackagePatterns": [ - "^rust-lang/rust$" - ] - }, - { - "groupSlug": "others", - "groupName": "Others", - "matchPackagePatterns": [ - "*" - ], - "excludePackagePatterns": [ - "^rust-lang/rust$" - ], - "dependencyDashboardApproval": true - } - ], - "customManagers": [ - { - "customType": "regex", - "fileMatch": [ - "^rust-toolchain$" - ], - "matchStrings": [ - "(?\\d+\\.\\d+\\.\\d+)" - ], - "depNameTemplate": "Rust", - "packageNameTemplate": "rust-lang/rust", - "datasourceTemplate": "github-tags" - } - ] -} diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 000000000..0d1e00acd --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,102 @@ +{ + $schema: "https://docs.renovatebot.com/renovate-schema.json", + extends: [ + "config:recommended", + ], + timezone: "Asia/Tokyo", + separateMajorMinor: false, + dependencyDashboardApproval: true, // 万が一`packageRules`の網羅性に穴ができた場合に備え + packageRules: [ + // `separateMajorMinor`を無効化した上で次の二つのgroupにすべてをまとめる。 + // + // * "major dependencies" (`renovate/major-dependencies`) + // * "non-major dependencies" (`renovate/non-major-dependencies`) + // + // バージョン0.y.z (y≧1)のyとバージョン0.0.zのzの変更は"major dependencies"の方に含むようにする。 + + // メジャーバージョンの更新 + { + groupName: "major dependencies", + matchUpdateTypes: [ + "major", + ], + dependencyDashboardApproval: false, + }, + { + groupName: "major dependencies", + matchUpdateTypes: [ + "minor", + ], + matchCurrentVersion: "/^v?0\\./", + dependencyDashboardApproval: false, + }, + { + groupName: "major dependencies", + matchUpdateTypes: [ + "patch", + ], + matchCurrentVersion: "/^v?0\\.0\\./", + dependencyDashboardApproval: false, + }, + + // メジャーバージョン以外の更新 + { + groupName: "non-major dependencies", + matchUpdateTypes: [ + "minor", + ], + matchCurrentVersion: "!/^v?0\\./", + dependencyDashboardApproval: false, + }, + { + groupName: "non-major dependencies", + matchUpdateTypes: [ + "patch", + ], + matchCurrentVersion: "!/^v?0\\.0\\./", + dependencyDashboardApproval: false, + }, + + // GHAのrunnerに対しては無効化する + { + matchDatasources: [ + "github-runners", + ], + matchPackageNames: [ + "windows", + "macos", + "ubuntu", + ], + enabled: false, + }, + ], + cargo: { + rangeStrategy: "bump", + }, + customManagers: [ + { + customType: "regex", + fileMatch: [ + "^rust-toolchain$", + ], + matchStrings: [ + "(?\\d+\\.\\d+\\.\\d+)", + ], + depNameTemplate: "Rust", + packageNameTemplate: "rust-lang/rust", + datasourceTemplate: "github-tags", + }, + { + customType: "regex", + fileMatch: [ + "^Cargo.toml$", + ], + matchStrings: [ + "rust-version = \"(?\\d+\\.\\d+\\.\\d+)\"", + ], + depNameTemplate: "Rust", + packageNameTemplate: "rust-lang/rust", + datasourceTemplate: "github-tags", + }, + ], +}