Repository navigation
fix(linux): 本地应用搜索无结果(缓存图标格式误判死循环);补全 setting 插件依赖安装文档 - #709
Open
Subway-chenyan wants to merge 2 commits into
Open
Subway-chenyan wants to merge 2 commits into
Subway-chenyan wants to merge 2 commits into
Conversation
added 2 commits
October 19, 2026 14:13
LinuxScanner 生成的应用图标是 file:// 路径,而缓存校验的 file: 豁免 仅覆盖 win32,导致 Linux 上每次读取缓存都判定为"旧格式图标缓存"并 触发重新扫描;重扫写回的仍是 file:// 格式,形成无限循环,渲染层始 终拿不到可用应用列表,本地应用搜索一直为空。 为 linux 平台的 file: 图标增加豁免,与 win32 静态 png 豁免保持一致。
internal-plugins/setting 使用独立 lockfile,根目录 pnpm install 不会 安装其依赖(pnpm workspace 会把子目录安装重定向到主项目),全新 clone 后按 README 直接 pnpm dev / build 会在 build:setting 阶段报 Cannot find package 'unocss'。CI 中通过 --ignore-workspace 单独安装, 但文档没有体现。 - 新增 install:setting 与 setup 脚本,复用 CI 的安装方式 - README / README_CN / CONTRIBUTING 的安装依赖步骤补充该步骤
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题一:Linux 上本地应用搜索始终无结果(核心修复)
现象
在 Linux(arm64,Ubuntu 24.04)上,主界面搜索任何关键词都匹配不到本地应用,
~/.ztools/logs/main.log中出现每 ~1.5 秒一轮的无限循环:根因
LinuxScanner生成的应用图标是file://路径(src/main/core/commandScanner/linuxScanner.ts)commands.ts的hasOldFormat校验中,file:图标的豁免仅覆盖win32;Linux 上file://必然被判为"旧格式"file://→ 再判旧,形成无限重扫;渲染层始终拿不到可用的应用列表,搜索一直为空修复
为
linux平台的file:图标增加豁免,与 win32 静态 png 豁免保持一致(src/main/api/renderer/commands.ts,+4 行)。验证
Ubuntu 24.04.4 arm64 / Node 22 / pnpm 10,
electron-builder --dir打包后 Xvfb 实测:从缓存读取到 91 个应用);GUI 中输入term正常出现"最佳搜索结果: Terminal",图标正常渲染问题二:全新 clone 按文档构建必失败(文档 + 脚本)
internal-plugins/setting使用独立 lockfile,根目录pnpm install不会安装其依赖(pnpm workspace 会把子目录安装重定向到主项目)。CI 中有专门的pnpm install --ignore-workspace步骤(build.yml "Install plugin dependencies"),但 README / CONTRIBUTING 均未提及,全新 clone 后pnpm dev/pnpm build:*会在build:setting阶段报Cannot find package 'unocss'。变更:
install:setting脚本(复用 CI 的--ignore-workspace安装方式)与setup脚本(pnpm install && pnpm install:setting)pnpm install:setting附带发现(不在本 PR 范围,供参考)
prebuilds/linux-arm64/*.node实际是 x86-64 ELF(与prebuilds/linux-x64同 BuildID,darwin-arm64 正常)。Linux arm64 主机上全局快捷键模块 dlopen 失败,需从源码自建替换。Linux 支持如要完善,建议关注。electron-builder --linux打 deb 会报"可执行文件格式错误"(AppImage 不受影响)。可用系统 ruby-fpm(USE_SYSTEM_FPM=true)或基于dist/linux-*-unpacked手工dpkg-deb组包绕过;若后续为 Linux 配置 CI(native arm64 runner),需要留意。