Repository navigation
fix(client): 把 downloadFabric() 提升为 Client 扩展,GUI 也能下载 Fabric 库 - #99
Merged
Merged
Conversation
现象:GUI 里选「客户端 · Fabric」启动失败(CLI 正常)。
根因:`downloadFabric()` 只写在 `Launcher`(CLI 用的实现)上,**不在 `Client` 协议扩展里**,
所以 `GUIClient.startWithProcess()` 只做了 `download()` + `launch()`,Fabric 的 loader 库
从来没被下载。classpath 里已经有 loader 主类(`addon` 解析成功),库却不在 → 启动即失败。
修复:
- `Client+Fabric.swift`:新增 `extension Client { mutating func downloadFabric(onEvent:) }`,
与 `downloadClient(onEvent:)` 对称(结构化进度 `LaunchProgress`)。
- `Launcher`:删掉重复实现,改为调用共享实现(CLI 行为不变,只是多了 `onEvent` 可选参数)。
验证:swift build / swift test 通过;后续由 app 侧 `GUIClient` 调用它(见 app 同名 PR)。
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.
fix(client): 把
downloadFabric()提升为Client扩展,GUI 也能下载 Fabric 库现象:GUI 里选「客户端 · Fabric」启动失败(CLI 正常)。
根因:
downloadFabric()只写在Launcher(CLI 用的实现)上,不在Client协议扩展里,所以
GUIClient.startWithProcess()只做了download()+launch(),Fabric 的 loader 库从来没被下载。classpath 里已经有 loader 主类(
addon解析成功),库却不在 → 启动即失败。修复:
Client+Fabric.swift:新增extension Client { mutating func downloadFabric(onEvent:) },与
downloadClient(onEvent:)对称(结构化进度LaunchProgress)。Launcher:删掉重复实现,改为调用共享实现(CLI 行为不变,只是多了onEvent可选参数)。验证:swift build / swift test 通过;后续由 app 侧
GUIClient调用它(见 app 同名 PR)。