Skip to content

Conversation

@sabonerune
Copy link
Contributor

内容

ビルドしたAppImageを一度展開して編集してappimagetoolで再度パッケージすることで以下の問題を解決・回避します

AppRun(AppImageが起動したときに一番最初に実行されるスクリプト)にuser namespaceが使用可能か確認して自動的に--no-sandboxを引数に追加するようにします。
これによりuser namespaceが制限されているUbuntu 24.04では起動できるようにしつつ他の使用可能なディストリビューションではセキュリティを維持することができます。
ref #2071

appimagetoolでパッケージすることで起動するためにlibfuse2のインストールを不要にします。

関連 Issue

その他

動作確認は主にVirtualBox上のUbuntu 24.04上で行っています。

ビルドの安定性に関する問題

appimagetoolに安定性の問題があります。
appimagetool 1.9.0の動作するためにdesktop-file-validateが必要なのでdesktop-file-utilsをインストールする必要があります。
Continuous buildの方は不要ですがmainにコミットがある度に更新されているようなので安定性が確保できません。

また、appimagetoolはデフォルトではビルドの度に自動的にtype2-runtimeContinuous buildからダウンロードしてきます。
これもmainにコミットがある度に更新されるようです。
runtimeについてはこれ以外に使えるビルド済みバイナリは用意されていないようです。

AutoUpdaterへの影響

ビルド後にファイルを差し替えするためAutoUpdater(特に差分更新の機能)が機能しなくなると思います。
念のため機能するようにできるコードをコメントアウトして書いておきましたが動作チェックはできていません。


他にはelectron-builderの更新に気を使う必要があるということでしょうか?
この辺りの更新作業がelectron-builder側で進んでいる様子はありませんが…

@sabonerune sabonerune requested a review from a team as a code owner September 13, 2025 06:15
@sabonerune sabonerune requested review from Hiroshiba and removed request for a team September 13, 2025 06:15
@voicevox-preview-pages
Copy link

voicevox-preview-pages bot commented Sep 13, 2025

🚀 プレビュー用ページを作成しました 🚀

更新時点でのコミットハッシュ:48a2ab8

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR modifies the AppImage build process to unpack, edit, and repackage AppImages using appimagetool to solve compatibility and security issues. The main purpose is to automatically add the --no-sandbox flag when user namespaces are unavailable (such as on Ubuntu 24.04) while maintaining security on systems where they are available.

  • Implements automatic --no-sandbox detection in AppRun script for Ubuntu 24.04 compatibility
  • Replaces libfuse2 dependency by using appimagetool for packaging
  • Adds post-build processing to modify AppImage contents before final packaging

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tools/downloadAppimagetool.ts Downloads and manages appimagetool binary for AppImage repackaging
package.json Adds appimagetool download to postinstall scripts
build/installer_linux.sh Removes hardcoded --no-sandbox from desktop entry
build/electronBuilderConfig.ts Adds artifact build completion hook
build/artifactBuildCompleted.ts Routes AppImage artifacts to specialized handler
build/appImageArtifactBuildCompleted.ts Main logic for AppImage modification and repackaging
.github/workflows/build.yml Installs desktop-file-utils for appimagetool compatibility

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

} catch {
return false;
}
const currentVersion = await fs.readFile(versionFilePath, "utf-8");
Copy link

Copilot AI Sep 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version comparison doesn't handle potential whitespace in the file content. The file content should be trimmed before comparison to avoid false mismatches.

Suggested change
const currentVersion = await fs.readFile(versionFilePath, "utf-8");
const currentVersion = (await fs.readFile(versionFilePath, "utf-8")).trim();

Copilot uses AI. Check for mistakes.
sabonerune and others added 3 commits September 13, 2025 19:38
Update build/appImageArtifactBuildCompleted.ts

Co-authored-by: Copilot <[email protected]>
Update build/appImageArtifactBuildCompleted.ts

Co-authored-by: Copilot <[email protected]>
@sabonerune
Copy link
Contributor Author

appimagetoolを1.9.0より新しいバージョンやtype2-runtimeのバイナリのバージョンを固定する場合はどこかのリポジトリでダウンロードしておくかビルドしてReleaseに保存しておく必要があると思います。

とりあえず自分のリポジトリでビルドしてみました。 https://github.com/sabonerune/appimagetool-builder

Copy link
Member

@sevenc-nanashi sevenc-nanashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特に問題なさそう。set -eをつけてマージします。

@sevenc-nanashi sevenc-nanashi added this pull request to the merge queue Sep 16, 2025
Merged via the queue into VOICEVOX:main with commit 5f1cced Sep 16, 2025
12 checks passed
@sabonerune sabonerune deleted the build/appimagetool branch September 17, 2025 09:43
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(なにかのついででも良いので)

このファイルが何なのかあとから見たときにわかりづらいから、最初にコメントを書いておくと後からわかりやすいかもですね!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ぼんやり:フックごとにディレクトリを分けて、今のフック名.tsフック名/index.tsにするとかしても良さそう?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ubuntu 22.04でlibfuse2がなくAppImageが動かないので、install_linux.sh内で案内する

4 participants