-
Notifications
You must be signed in to change notification settings - Fork 346
feat: ビルドしたAppImageを展開して編集してappimagetoolで再度パッケージする #2734
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
There was a problem hiding this 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-sandboxdetection 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"); |
Copilot
AI
Sep 13, 2025
There was a problem hiding this comment.
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.
| const currentVersion = await fs.readFile(versionFilePath, "utf-8"); | |
| const currentVersion = (await fs.readFile(versionFilePath, "utf-8")).trim(); |
Update build/appImageArtifactBuildCompleted.ts Co-authored-by: Copilot <[email protected]>
Update build/appImageArtifactBuildCompleted.ts Co-authored-by: Copilot <[email protected]>
|
appimagetoolを1.9.0より新しいバージョンやtype2-runtimeのバイナリのバージョンを固定する場合はどこかのリポジトリでダウンロードしておくかビルドしてReleaseに保存しておく必要があると思います。 とりあえず自分のリポジトリでビルドしてみました。 https://github.com/sabonerune/appimagetool-builder |
sevenc-nanashi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
特に問題なさそう。set -eをつけてマージします。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(なにかのついででも良いので)
このファイルが何なのかあとから見たときにわかりづらいから、最初にコメントを書いておくと後からわかりやすいかもですね!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ぼんやり:フックごとにディレクトリを分けて、今のフック名.tsをフック名/index.tsにするとかしても良さそう?
内容
ビルドしたAppImageを一度展開して編集してappimagetoolで再度パッケージすることで以下の問題を解決・回避します
AppRun(AppImageが起動したときに一番最初に実行されるスクリプト)にuser namespaceが使用可能か確認して自動的に
--no-sandboxを引数に追加するようにします。これによりuser namespaceが制限されているUbuntu 24.04では起動できるようにしつつ他の使用可能なディストリビューションではセキュリティを維持することができます。
ref #2071
appimagetoolでパッケージすることで起動するためにlibfuse2のインストールを不要にします。
関連 Issue
(libfuse2が不要になるため結果的に不要になる)
その他
動作確認は主にVirtualBox上のUbuntu 24.04上で行っています。
ビルドの安定性に関する問題
appimagetoolに安定性の問題があります。
appimagetool 1.9.0の動作するために
desktop-file-validateが必要なのでdesktop-file-utilsをインストールする必要があります。Continuous buildの方は不要ですがmainにコミットがある度に更新されているようなので安定性が確保できません。
また、appimagetoolはデフォルトではビルドの度に自動的に
type2-runtimeをContinuous buildからダウンロードしてきます。これもmainにコミットがある度に更新されるようです。
runtimeについてはこれ以外に使えるビルド済みバイナリは用意されていないようです。
AutoUpdaterへの影響
ビルド後にファイルを差し替えするためAutoUpdater(特に差分更新の機能)が機能しなくなると思います。
念のため機能するようにできるコードをコメントアウトして書いておきましたが動作チェックはできていません。
他にはelectron-builderの更新に気を使う必要があるということでしょうか?
この辺りの更新作業がelectron-builder側で進んでいる様子はありませんが…