From 1396499776f7ecf581db16407c629d0da5720d9d Mon Sep 17 00:00:00 2001 From: lick <2188718831@qq.com> Date: Mon, 16 Nov 2026 02:59:51 -0800 Subject: [PATCH] =?UTF-8?q?fix(desktop):=20Windows=20=E4=B8=8A=E8=AF=86?= =?UTF-8?q?=E5=88=AB=20PATH/JAVA=5FHOME=20=E7=9A=84=20JDK=EF=BC=8C?= =?UTF-8?q?=E5=B8=A6=E7=A9=BA=E6=A0=BC=E8=B7=AF=E5=BE=84=E7=9A=84=20.cmd?= =?UTF-8?q?=20=E6=9E=84=E5=BB=BA=E5=B7=A5=E5=85=B7=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #2032 - 工具链:toolchains.candidates 传入 commandHomes(Core #67),JAVA_HOME 和 PATH 上的 安装以 host:shell 进入安装列表;新建项目的 JDK 选择器不再显示“未找到已安装的版本”。 设置页的 shell 行区分环境变量和 PATH 命令。PINNED_CORE_REVISION 升到 Core #67。 - buildprocess:Windows 上的 .cmd/.bat 由宿主构造 cmd.exe /d /c ""脚本" 参数" 命令行, 参数按 BatBadBut 修复后的规则转义。此前脚本路径和参数都带空格时,cmd 会去掉首尾引号, Maven 模型加载报 'C:\Program' 不是命令并以 exit 1 失败。 - 构建模型和依赖命令失败时,错误附带工具输出的最后 12 行(去掉终端控制符), 构建树的警告行悬停显示全文。 Co-Authored-By: Claude Opus 5.5 --- desktop/internal/buildprocess/batch.go | 111 ++++++++++++++++++ desktop/internal/buildprocess/batch_test.go | 73 ++++++++++++ .../buildprocess/batch_windows_test.go | 97 +++++++++++++++ desktop/internal/buildprocess/process.go | 7 +- desktop/internal/buildprocess/process_unix.go | 3 +- .../internal/buildprocess/process_windows.go | 20 +++- desktop/internal/core/toolchain.go | 13 +- .../settingswindow/toolchains_view.go | 9 +- desktop/internal/toolchain/load.go | 1 + desktop/internal/toolchain/toolchain_test.go | 56 +++++++++ desktop/internal/workbench/build.go | 59 +++++++++- .../workbench/build_command_output_test.go | 65 ++++++++++ .../workbench/build_command_record_test.go | 5 + .../internal/workbench/build_dependencies.go | 1 + desktop/internal/workbench/build_tree.go | 8 +- desktop/internal/workbench/build_tree_view.go | 3 + scripts/desktop/build-desktop-core.sh | 8 +- .../features/build-system-plugins.json | 13 +- .../features/plugin-injected-toolchains.json | 8 +- 19 files changed, 540 insertions(+), 20 deletions(-) create mode 100644 desktop/internal/buildprocess/batch.go create mode 100644 desktop/internal/buildprocess/batch_test.go create mode 100644 desktop/internal/buildprocess/batch_windows_test.go create mode 100644 desktop/internal/workbench/build_command_output_test.go diff --git a/desktop/internal/buildprocess/batch.go b/desktop/internal/buildprocess/batch.go new file mode 100644 index 0000000000..65dad14e16 --- /dev/null +++ b/desktop/internal/buildprocess/batch.go @@ -0,0 +1,111 @@ +package buildprocess + +import ( + "errors" + "path/filepath" + "strings" +) + +// Windows runs a .cmd or .bat file through cmd.exe, which parses the whole command line again +// by its own rules. When Windows starts the script itself (os/exec on Windows does), the line +// becomes `cmd.exe /c `, and cmd removes the first and the last quote of a line that holds +// more than two. A script under a directory with a space (C:\Program Files\...\mvn.cmd) then +// fails as soon as one argument is quoted too: cmd runs `C:\Program` (#2032). cmd also expands +// %VAR% and acts on & | < > ^ in an argument that is not quoted, so an argument can run a +// command (BatBadBut, CVE-2024-24576). +// +// batchCommandLine builds the line the host gives cmd.exe instead: the script and its arguments +// wrapped in one more pair of quotes, which cmd's /c removes, so the quotes inside stay as +// written. Arguments are quoted and escaped as Rust's standard library does since that +// advisory: every argument with a character other than letters, digits and #$*+-./:?@\_ is +// quoted, a quote is doubled, backslashes before a quote are doubled, and % is broken up so +// cmd never sees a variable. + +// errBatchArgument is a script path or argument that cmd.exe cannot be given safely. +var errBatchArgument = errors.New("buildprocess: a batch file cannot be given this argument") + +// isBatchFile says whether Windows would run executable through cmd.exe. +func isBatchFile(executable string) bool { + switch strings.ToLower(filepath.Ext(executable)) { + case ".cmd", ".bat": + return true + } + return false +} + +// batchCommandLine is the command line for cmd.exe that runs script with arguments, each of +// which the script receives exactly as given. +func batchCommandLine(script string, arguments []string) (string, error) { + // A Windows file name holds no quote and does not end in a separator; either would end + // the script's quotes early. + if script == "" || strings.ContainsAny(script, "\"\x00\r\n") || strings.HasSuffix(script, `\`) { + return "", errBatchArgument + } + var line strings.Builder + // /d skips AutoRun commands, /e:ON keeps the %cd:~,% expansion below working and /v:OFF + // keeps ! literal, whatever the user's registry defaults are. + line.WriteString(`cmd.exe /e:ON /v:OFF /d /c ""`) + line.WriteString(script) + line.WriteByte('"') + for _, argument := range arguments { + // A line break ends cmd's command, so the rest would be a second command. + if strings.ContainsAny(argument, "\x00\r\n") { + return "", errBatchArgument + } + line.WriteByte(' ') + appendBatchArgument(&line, argument) + } + line.WriteByte('"') + return line.String(), nil +} + +func appendBatchArgument(line *strings.Builder, argument string) { + // An empty argument would vanish unquoted, and a trailing backslash would otherwise + // escape the closing quote of a script that quotes "%~1". + quote := argument == "" || strings.HasSuffix(argument, `\`) + for _, r := range argument { + if r < 0x80 { + if !isUnquotedBatchByte(byte(r)) { + quote = true + } + } else if r < 0xa0 { + // C1 control characters. + quote = true + } + } + if quote { + line.WriteByte('"') + } + backslashes := 0 + for _, r := range argument { + if r == '\\' { + backslashes++ + line.WriteRune(r) + continue + } + switch r { + case '"': + // Backslashes before a quote are doubled, and the quote itself is doubled. + line.WriteString(strings.Repeat(`\`, backslashes)) + line.WriteByte('"') + case '%': + // %cd:~,% is an empty substring of a variable that always exists, so cmd expands it + // to nothing and the % that follows can no longer start a variable name. + line.WriteString(`%%cd:~,`) + } + backslashes = 0 + line.WriteRune(r) + } + if quote { + line.WriteString(strings.Repeat(`\`, backslashes)) + line.WriteByte('"') + } +} + +func isUnquotedBatchByte(c byte) bool { + switch { + case c >= 'a' && c <= 'z', c >= 'A' && c <= 'Z', c >= '0' && c <= '9': + return true + } + return strings.IndexByte(`#$*+-./:?@\_`, c) >= 0 +} diff --git a/desktop/internal/buildprocess/batch_test.go b/desktop/internal/buildprocess/batch_test.go new file mode 100644 index 0000000000..bcb27b8632 --- /dev/null +++ b/desktop/internal/buildprocess/batch_test.go @@ -0,0 +1,73 @@ +package buildprocess + +import ( + "errors" + "testing" +) + +func TestBatchCommandLineQuotesTheWholeLineOnce(t *testing.T) { + // The shape of Maven's model load (#2032): a script and an argument that both hold a space. + line, err := batchCommandLine(`C:\Program Files\maven\bin\mvn.cmd`, []string{ + "-B", `-Dmaven.ext.class.path=C:\Users\me\AppData\Local\Lithe Desktop\x.jar`, "pre-clean", + }) + if err != nil { + t.Fatal(err) + } + want := `cmd.exe /e:ON /v:OFF /d /c ""C:\Program Files\maven\bin\mvn.cmd" -B "-Dmaven.ext.class.path=C:\Users\me\AppData\Local\Lithe Desktop\x.jar" pre-clean"` + if line != want { + t.Fatalf("line =\n%s\nwant\n%s", line, want) + } +} + +func TestBatchArgumentsCannotReachCmdSyntax(t *testing.T) { + for _, tc := range []struct{ argument, want string }{ + {"plain-arg_1.0", `plain-arg_1.0`}, + {"", `""`}, + {`trailing\`, `"trailing\\"`}, + {`a&b`, `"a&b"`}, + {`x|y^`, `"x|y^"`}, + {`%PATH%`, `"%%cd:~,%PATH%%cd:~,%"`}, + {`say "hi"`, `"say ""hi"""`}, + {`back\"slash`, `"back\\""slash"`}, + {`(group)!`, `"(group)!"`}, + {`ünïcode`, `ünïcode`}, + } { + line, err := batchCommandLine(`C:\s.cmd`, []string{tc.argument}) + if err != nil { + t.Fatalf("%q: %v", tc.argument, err) + } + want := `cmd.exe /e:ON /v:OFF /d /c ""C:\s.cmd" ` + tc.want + `"` + if line != want { + t.Fatalf("%q:\n got %s\nwant %s", tc.argument, line, want) + } + } +} + +func TestBatchCommandLineRefusesWhatWouldEndTheCommand(t *testing.T) { + for _, tc := range []struct { + script string + arguments []string + }{ + {`C:\s.cmd`, []string{"one\ntwo"}}, + {`C:\s.cmd`, []string{"one\rtwo"}}, + {`C:\s.cmd`, []string{"nul\x00"}}, + {`C:\dir\`, nil}, + {`C:\a"b.cmd`, nil}, + {"", nil}, + } { + if _, err := batchCommandLine(tc.script, tc.arguments); !errors.Is(err, errBatchArgument) { + t.Fatalf("%q %q: err = %v", tc.script, tc.arguments, err) + } + } +} + +func TestIsBatchFile(t *testing.T) { + for name, want := range map[string]bool{ + `C:\m\mvn.cmd`: true, `C:\m\MVN.CMD`: true, `C:\g\gradlew.bat`: true, + `C:\j\java.exe`: false, `/usr/bin/mvn`: false, `C:\m\mvn.cmd.exe`: false, + } { + if got := isBatchFile(name); got != want { + t.Fatalf("isBatchFile(%q) = %v", name, got) + } + } +} diff --git a/desktop/internal/buildprocess/batch_windows_test.go b/desktop/internal/buildprocess/batch_windows_test.go new file mode 100644 index 0000000000..acac8a2f85 --- /dev/null +++ b/desktop/internal/buildprocess/batch_windows_test.go @@ -0,0 +1,97 @@ +//go:build windows + +package buildprocess + +import ( + "context" + "encoding/json" + "fmt" + "os" + "path/filepath" + "slices" + "strings" + "sync" + "testing" + "time" +) + +const batchArgumentsMode = "LITHE_TEST_BATCH_ARGUMENTS" + +// TestBatchArgumentsHelper prints the arguments after "--" as JSON. A test script passes its +// own arguments on to it with %*, as mvn.cmd passes them to Java. +func TestBatchArgumentsHelper(t *testing.T) { + if os.Getenv(batchArgumentsMode) != "1" { + return + } + index := slices.Index(os.Args, "--") + if index < 0 { + os.Exit(21) + } + data, err := json.Marshal(os.Args[index+1:]) + if err != nil { + os.Exit(22) + } + fmt.Println(string(data)) + os.Exit(0) +} + +// A script under a directory with a space receives every argument as written, including ones +// with spaces, quotes and cmd syntax, the way Maven's model load runs mvn.cmd (#2032). +func TestBatchFileUnderASpacedDirectoryReceivesItsArguments(t *testing.T) { + directory := filepath.Join(t.TempDir(), "Program Files", "tool home") + if err := os.MkdirAll(filepath.Join(directory, "bin"), 0o755); err != nil { + t.Fatal(err) + } + script := filepath.Join(directory, "bin", "tool.cmd") + body := "@echo off\r\n\"" + os.Args[0] + "\" \"-test.run=^TestBatchArgumentsHelper$\" -- %*\r\nexit /b %ERRORLEVEL%\r\n" + if err := os.WriteFile(script, []byte(body), 0o644); err != nil { + t.Fatal(err) + } + marker := filepath.Join(t.TempDir(), "injected") + arguments := []string{ + "-B", + `-Dmaven.ext.class.path=C:\Users\me\AppData\Local\Lithe Desktop\plugins\x.jar`, + "-Dlithe.modelOutput=" + filepath.Join(directory, "model out.json"), + "", + `trailing\`, + `say "hi"`, + "%" + batchArgumentsMode + "%", + "a&echo injected>" + marker, + `x|y^`, + "pre-clean", + } + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + var output strings.Builder + var mu sync.Mutex + process, err := Start(ctx, Spec{ + Executable: script, + Arguments: arguments, + WorkingDirectory: directory, + Environment: map[string]string{batchArgumentsMode: "1"}, + }, func(_ Stream, text string) { + mu.Lock() + output.WriteString(text) + mu.Unlock() + }) + if err != nil { + t.Fatal(err) + } + waitErr := process.Wait() + mu.Lock() + text := output.String() + mu.Unlock() + if waitErr != nil { + t.Fatalf("script failed: %v\n%s", waitErr, text) + } + var got []string + if err := json.Unmarshal([]byte(strings.TrimSpace(text)), &got); err != nil { + t.Fatalf("output is not the helper's JSON: %v\n%s", err, text) + } + if !slices.Equal(got, arguments) { + t.Fatalf("arguments =\n%q\nwant\n%q", got, arguments) + } + if _, err := os.Stat(marker); err == nil { + t.Fatal("an argument ran a command") + } +} diff --git a/desktop/internal/buildprocess/process.go b/desktop/internal/buildprocess/process.go index e4b88556e8..284a0c9276 100644 --- a/desktop/internal/buildprocess/process.go +++ b/desktop/internal/buildprocess/process.go @@ -108,8 +108,11 @@ func Start(ctx context.Context, spec Spec, observe func(Stream, string)) (*Proce command.Stdout = stdoutWrite command.Stderr = stderrWrite platform := &processPlatform{} - platform.configure(command) - if err := command.Start(); err != nil { + err = platform.configure(command) + if err == nil { + err = command.Start() + } + if err != nil { for _, file := range []*os.File{stdoutRead, stdoutWrite, stderrRead, stderrWrite} { _ = file.Close() } diff --git a/desktop/internal/buildprocess/process_unix.go b/desktop/internal/buildprocess/process_unix.go index 3b13f61108..0a95519415 100644 --- a/desktop/internal/buildprocess/process_unix.go +++ b/desktop/internal/buildprocess/process_unix.go @@ -21,8 +21,9 @@ type processPlatform struct { // configure puts the process in its own group so Stop can end the whole build // tree, including wrappers that start child compilers. -func (*processPlatform) configure(command *exec.Cmd) { +func (*processPlatform) configure(command *exec.Cmd) error { command.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} + return nil } func (p *processPlatform) adopt(process *os.Process) error { diff --git a/desktop/internal/buildprocess/process_windows.go b/desktop/internal/buildprocess/process_windows.go index dadd1c4458..c11c71d056 100644 --- a/desktop/internal/buildprocess/process_windows.go +++ b/desktop/internal/buildprocess/process_windows.go @@ -6,6 +6,7 @@ import ( "errors" "os" "os/exec" + "path/filepath" "sync" "syscall" "unsafe" @@ -29,10 +30,27 @@ type processPlatform struct { active bool } -func (p *processPlatform) configure(command *exec.Cmd) { +func (p *processPlatform) configure(command *exec.Cmd) error { command.SysProcAttr = &syscall.SysProcAttr{ CreationFlags: windows.CREATE_NO_WINDOW | windows.CREATE_SUSPENDED | windows.CREATE_NEW_PROCESS_GROUP, } + // A program that was not found keeps its lookup error for Start to report. + if command.Err != nil || !isBatchFile(command.Path) { + return nil + } + // A script runs through cmd.exe; the host starts cmd.exe itself with a line it built, so + // the script's path and arguments reach it as written (batch.go). + line, err := batchCommandLine(command.Path, command.Args[1:]) + if err != nil { + return err + } + system, err := windows.GetSystemDirectory() + if err != nil { + return err + } + command.Path = filepath.Join(system, "cmd.exe") + command.SysProcAttr.CmdLine = line + return nil } func (p *processPlatform) adopt(process *os.Process) error { diff --git a/desktop/internal/core/toolchain.go b/desktop/internal/core/toolchain.go index 538b52125f..50643f188d 100644 --- a/desktop/internal/core/toolchain.go +++ b/desktop/internal/core/toolchain.go @@ -207,14 +207,19 @@ type ToolchainCandidatesRequest struct { SystemInstallations []ToolchainSystemInstallation `json:"systemInstallations,omitempty"` ProviderInstallations []ToolchainProviderInstallation `json:"providerInstallations,omitempty"` Environment map[string]string `json:"environment,omitempty"` - Fixed *ToolchainFixed `json:"fixed,omitempty"` - ProjectCodeAllowed bool `json:"projectCodeAllowed,omitempty"` + // CommandHomes maps each declared command found on the PATH to its home, as for + // toolchains.resolve; Core lists those homes as shell candidates too. + CommandHomes map[string]string `json:"commandHomes,omitempty"` + Fixed *ToolchainFixed `json:"fixed,omitempty"` + ProjectCodeAllowed bool `json:"projectCodeAllowed,omitempty"` } -// ToolchainShellCandidate is one login-shell home variable candidate. +// ToolchainShellCandidate is one login-shell home: a declared variable's value, or +// where a declared command was found on the PATH (Command set, Variable empty). type ToolchainShellCandidate struct { CandidateID string `json:"candidateID"` - Variable string `json:"variable"` + Variable string `json:"variable,omitempty"` + Command string `json:"command,omitempty"` Home string `json:"home"` Executable string `json:"executable,omitempty"` Version *string `json:"version,omitempty"` diff --git a/desktop/internal/settingswindow/toolchains_view.go b/desktop/internal/settingswindow/toolchains_view.go index 84a341284a..df888b8424 100644 --- a/desktop/internal/settingswindow/toolchains_view.go +++ b/desktop/internal/settingswindow/toolchains_view.go @@ -500,14 +500,19 @@ func (w *window) toolchainTool(c ui.C, language i18n.Language, tool toolchain.To }) } for _, shell := range tool.Shell { - version := shell.Variable + // A variable's name, or the command found on the PATH: both are the user's own words. + source := shell.Variable + if source == "" { + source = shell.Command + } + version := source if shell.Version != nil { version += " " + *shell.Version } else if shell.Reason != "" { version += " " + shell.Reason } ui.Text(c, i18n.SharedFormat(language, "desktop.toolchains.installation", map[string]string{ - "home": shell.Home, "version": version, "provider": shell.Variable, + "home": shell.Home, "version": version, "provider": source, })).FontSize(11).Color(w.pal.muted) } if tool.ProviderQueriesUnsupported { diff --git a/desktop/internal/toolchain/load.go b/desktop/internal/toolchain/load.go index 121cf8b046..bb85b6333d 100644 --- a/desktop/internal/toolchain/load.go +++ b/desktop/internal/toolchain/load.go @@ -366,6 +366,7 @@ func prepareTool(ctx context.Context, kernel Kernel, workspace *workspace, regis MinimumVersion: options.MinimumVersion, SystemInstallations: prepared.installations, Environment: prepared.environment, + CommandHomes: prepared.commandHomes, Fixed: prepared.fixed, } candidates, err := kernel.ToolchainCandidatesOf(ctx, request) diff --git a/desktop/internal/toolchain/toolchain_test.go b/desktop/internal/toolchain/toolchain_test.go index 3803dfcfae..2d28c95e9d 100644 --- a/desktop/internal/toolchain/toolchain_test.go +++ b/desktop/internal/toolchain/toolchain_test.go @@ -85,6 +85,62 @@ func TestAutomaticHomeIncludesTheResolvedEnvironment(t *testing.T) { } } +// A home reached only through the PATH or a declared variable is one the runtime +// runs, so it must be an installation a picker can offer even when no discovery +// scan covers it (#2032: a JDK on the Windows PATH, where the plugin declares no scan). +func TestShellHomesAreInstallationsWithoutADiscoveryScan(t *testing.T) { + root, home := t.TempDir(), t.TempDir() + pathHome, variableHome := t.TempDir(), t.TempDir() + onPath := filepath.Join(pathHome, "jre", "bin", "vm") + writeExecutable(t, onPath) + onPath = canonical(t, onPath) + byVariable := filepath.Join(variableHome, "jre", "bin", "vm") + writeExecutable(t, byVariable) + byVariable = canonical(t, byVariable) + options := fixtureOptions(home, variableHome, map[string]string{onPath: "vm 8.0\n", byVariable: "vm 7.1\n"}) + options.Lookup = func(command string) (string, error) { + if command != "fictional-vm" { + return "", errors.New("no command") + } + return onPath, nil + } + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + snapshot, err := Load(ctx, core.NewClient(), root, ".", []json.RawMessage{readManifest(t, "runtime.plugin.json")}, options) + if err != nil { + t.Fatal(err) + } + if len(snapshot.Tools) != 1 { + t.Fatalf("tools = %+v", snapshot.Tools) + } + tool := snapshot.Tools[0] + got := map[string]string{} + for _, installation := range tool.Installations { + got[filepath.Clean(installation.Home)] = installation.Version + " " + installation.Provider + } + want := map[string]string{ + filepath.Dir(filepath.Dir(filepath.Dir(onPath))): "8.0 host:shell", + filepath.Dir(filepath.Dir(filepath.Dir(byVariable))): "7.1 host:shell", + } + if len(got) != len(want) { + t.Fatalf("installations = %+v, want %v", tool.Installations, want) + } + for home, entry := range want { + if got[home] != entry { + t.Fatalf("installation %s = %q, want %q (all: %+v)", home, got[home], entry, tool.Installations) + } + } + commands := 0 + for _, shell := range tool.Shell { + if shell.Command == "fictional-vm" { + commands++ + } + } + if commands != 1 { + t.Fatalf("shell rows = %+v, want one for the PATH command", tool.Shell) + } +} + func TestLoadDiscoversTwoSemanticallyDifferentTools(t *testing.T) { root := t.TempDir() home := t.TempDir() diff --git a/desktop/internal/workbench/build.go b/desktop/internal/workbench/build.go index fc8deaca68..8036ecf0b1 100644 --- a/desktop/internal/workbench/build.go +++ b/desktop/internal/workbench/build.go @@ -9,6 +9,7 @@ import ( "os" "os/exec" "path/filepath" + "regexp" "runtime" "slices" "strconv" @@ -670,6 +671,7 @@ func (a *App) commandModel(ctx context.Context, p *project, instance buildInstan } workingDirectory := filepath.Join(p.root, filepath.FromSlash(plan.WorkingDirectory)) output, runErr := captureBuildProcess(ctx, execution.Executable, plan.Arguments, workingDirectory, applyToolchainSelection(plan.Environment, execution.selection())) + runErr = withBuildOutput(runErr, output) request := core.BuildDecodeModelRequest{WorkspaceRoot: p.root, Root: instance.Root, Options: instance.Options} if plan.Output == "outputFile" { request.OutputFile = outputFile @@ -704,6 +706,60 @@ func buildCommandStage(runErr error) core.PluginStage { } } +// A failed build command's error ends with the last lines the tool printed, which say why it +// failed (a JAVA_HOME that is no JDK, a network error, a plugin it could not resolve); the exit +// status alone does not. The tool's words are shown as written, not translated. +const ( + buildFailureOutputLines = 12 + buildFailureOutputLineBytes = 400 +) + +// terminalEscape matches a terminal control sequence, such as the colors a build tool prints. +var terminalEscape = regexp.MustCompile("\x1b\\[[0-?]*[ -/]*[@-~]") + +// buildCommandFailure is a build command that ran and failed, with the end of its output. +type buildCommandFailure struct { + cause error + output string +} + +func (e *buildCommandFailure) Error() string { return e.cause.Error() + "\n" + e.output } +func (e *buildCommandFailure) Unwrap() error { return e.cause } + +// withBuildOutput gives err, a build command's end, the last lines the command printed. A +// command that did not start printed nothing, and one that succeeded needs no explanation. +func withBuildOutput(err error, output string) error { + var launch *buildLaunchError + if err == nil || errors.As(err, &launch) { + return err + } + tail := buildOutputTail(output) + if tail == "" { + return err + } + return &buildCommandFailure{cause: err, output: tail} +} + +// buildOutputTail is the last non-empty lines of output, without terminal control sequences +// and each bounded in length. +func buildOutputTail(output string) string { + output = strings.ToValidUTF8(terminalEscape.ReplaceAllString(output, ""), "\uFFFD") + lines := strings.Split(output, "\n") + kept := make([]string, 0, buildFailureOutputLines) + for index := len(lines) - 1; index >= 0 && len(kept) < buildFailureOutputLines; index-- { + line := strings.TrimRight(strings.ReplaceAll(lines[index], "\r", ""), " \t") + if strings.TrimSpace(line) == "" { + continue + } + if len(line) > buildFailureOutputLineBytes { + line = strings.ToValidUTF8(line[:buildFailureOutputLineBytes], "") + "…" + } + kept = append(kept, line) + } + slices.Reverse(kept) + return strings.Join(kept, "\n") +} + // buildLaunchError is a build command whose process did not start, as opposed to one that ran // and failed. Its text is the start's own. type buildLaunchError struct{ cause error } @@ -786,7 +842,8 @@ func (a *App) finishBuildModel(p *project, id string, model core.BuildModel, err } if err != nil { p.build.instances[index].modelError = a.launchFailureText(err) - p.build.status = p.build.instances[index].modelError + // The status line has room for one line; the tree row shows the rest on hover. + p.build.status, _, _ = strings.Cut(p.build.instances[index].modelError, "\n") a.settleTitleAction(p) return } diff --git a/desktop/internal/workbench/build_command_output_test.go b/desktop/internal/workbench/build_command_output_test.go new file mode 100644 index 0000000000..6e60696c07 --- /dev/null +++ b/desktop/internal/workbench/build_command_output_test.go @@ -0,0 +1,65 @@ +package workbench + +import ( + "errors" + "strings" + "testing" +) + +// A failed model or dependency command's error ends with what the tool printed, so the user +// sees why it failed rather than only its exit status (#2032, #2027). +func TestBuildCommandFailureCarriesTheToolsExplanation(t *testing.T) { + h, _, p := buildCommandHarness(t) + installBuildTool(t) + writeBuildCommandMarker(t, p.root, "explain") + const explanation = "[ERROR] The JAVA_HOME environment variable is not defined correctly" + check := func(name string, err error) { + t.Helper() + if err == nil { + t.Fatalf("%s: a failed command loaded", name) + } + text := err.Error() + // stdout and stderr are two pipes, so their lines may arrive in either order. + if !strings.Contains(text, "exit status 1") || !strings.Contains(text, "\nScanning\n") || !strings.Contains(text, explanation) { + t.Fatalf("%s: error = %q, want the exit status and the tool's last lines", name, text) + } + if strings.ContainsAny(text, "\x1b\r") { + t.Fatalf("%s: error keeps terminal control characters: %q", name, text) + } + var launch *buildLaunchError + if errors.As(err, &launch) { + t.Fatalf("%s: a command that ran is a launch failure", name) + } + } + _, err := h.app.commandModel(buildLoadContext(t, "action-61", pluginOperationWait), p, buildCommandInstance(".", false), h.app.kernel, h.app.text.Build) + check("model", err) + kernel := h.app.kernel.(buildDependencyKernel) + _, err = h.app.buildDependencyTree(buildLoadContext(t, "action-62", pluginOperationWait), p, buildCommandInstance(".", false), kernel, nil, false) + check("dependencies", err) +} + +func TestBuildOutputTailKeepsTheLastBoundedLines(t *testing.T) { + var output strings.Builder + for index := range buildFailureOutputLines + 5 { + output.WriteString(strings.Repeat("x", index) + "line\r\n\r\n") + } + output.WriteString(strings.Repeat("界", buildFailureOutputLineBytes) + "\n\n") + tail := buildOutputTail(output.String()) + lines := strings.Split(tail, "\n") + if len(lines) != buildFailureOutputLines { + t.Fatalf("tail has %d lines, want %d: %q", len(lines), buildFailureOutputLines, tail) + } + if !strings.HasSuffix(lines[len(lines)-2], "xline") || strings.HasPrefix(lines[0], "line") { + t.Fatalf("tail is not the last lines in order: %q", lines) + } + last := lines[len(lines)-1] + if len(last) > buildFailureOutputLineBytes+len("…") || !strings.HasSuffix(last, "…") || !strings.HasPrefix(last, "界") { + t.Fatalf("long line = %q, want it cut at a character boundary", last) + } + if got := withBuildOutput(errors.New("exit status 2"), " \n\r\n"); got.Error() != "exit status 2" { + t.Fatalf("a failure without output = %q", got) + } + if got := withBuildOutput(nil, "printed"); got != nil { + t.Fatalf("a success became %v", got) + } +} diff --git a/desktop/internal/workbench/build_command_record_test.go b/desktop/internal/workbench/build_command_record_test.go index 1fe1d5ee78..4972846d7f 100644 --- a/desktop/internal/workbench/build_command_record_test.go +++ b/desktop/internal/workbench/build_command_record_test.go @@ -72,6 +72,11 @@ func TestBuildCommandRunner(t *testing.T) { fmt.Print(`{"format":"litheDependencies","version":0,"dependencies":[{"name":"fixture-dependency","children":[]}]}`) case "fail": os.Exit(3) + case "explain": + // A tool that says why it failed, in color, as Maven does with -Dstyle.color=always. + fmt.Print("\x1b[1mScanning\x1b[m\r\n\r\n") + fmt.Fprint(os.Stderr, "\x1b[1;31m[ERROR]\x1b[m The JAVA_HOME environment variable is not defined correctly\r\n") + os.Exit(1) case "hang": // The host kills the tool when the load's deadline passes; this only outlives it. time.Sleep(pluginOperationWait) diff --git a/desktop/internal/workbench/build_dependencies.go b/desktop/internal/workbench/build_dependencies.go index e4d4991707..30f23a251c 100644 --- a/desktop/internal/workbench/build_dependencies.go +++ b/desktop/internal/workbench/build_dependencies.go @@ -211,6 +211,7 @@ func (a *App) buildDependencyTree(ctx context.Context, p *project, instance buil func (a *App) commandDependencies(ctx context.Context, p *project, instance buildInstance, kernel buildDependencyKernel, attempt *core.PluginAttempt, plan core.BuildPlan, execution buildExecution, decode core.BuildDecodeDependenciesRequest, outputFile string) (core.BuildDependencyTree, error) { workingDirectory := filepath.Join(p.root, filepath.FromSlash(plan.WorkingDirectory)) output, runErr := captureBuildProcess(ctx, execution.Executable, plan.Arguments, workingDirectory, applyToolchainSelection(plan.Environment, execution.selection())) + runErr = withBuildOutput(runErr, output) if plan.Output == "outputFile" && outputFile != "" { decode.OutputFile = outputFile } else { diff --git a/desktop/internal/workbench/build_tree.go b/desktop/internal/workbench/build_tree.go index 1c6188fd1f..0305f37253 100644 --- a/desktop/internal/workbench/build_tree.go +++ b/desktop/internal/workbench/build_tree.go @@ -190,7 +190,13 @@ func (a *App) appendBuildGroup(rows []buildRow, p *project, index int, query str switch { case filtering: case instance.modelError != "": - rows = append(rows, buildRow{kind: buildRowEmpty, instance: index, level: 1, label: t.ModelFailed(instance.modelError), warning: true}) + // The row has one line; the tool's own explanation that follows is its tooltip. + first, _, more := strings.Cut(instance.modelError, "\n") + row := buildRow{kind: buildRowEmpty, instance: index, level: 1, label: t.ModelFailed(first), warning: true} + if more { + row.tooltip = t.ModelFailed(instance.modelError) + } + rows = append(rows, row) default: rows = append(rows, buildRow{kind: buildRowEmpty, instance: index, level: 1, label: t.LoadingModel, loading: true}) } diff --git a/desktop/internal/workbench/build_tree_view.go b/desktop/internal/workbench/build_tree_view.go index 43d922bec5..99e1cc2c94 100644 --- a/desktop/internal/workbench/build_tree_view.go +++ b/desktop/internal/workbench/build_tree_view.go @@ -394,6 +394,9 @@ func (a *App) buildNoteRow(row ui.ListRow, p *project, instance *buildInstance, ui.Icon(c, icons.CircleAlert).Size(14, 14).Shrink(0).Color(color) } ui.Text(c, spec.label).FontSize(treeFontSize - 1).Color(color).Ellipsis().Shrink(1).MinWidth(0) + if spec.tooltip != "" { + element = element.Tooltip(spec.tooltip) + } if spec.dependencies { a.buildDependencyMenu(c, element, p, instance, spec.project) return diff --git a/scripts/desktop/build-desktop-core.sh b/scripts/desktop/build-desktop-core.sh index b94852e8e0..2382c29d3a 100755 --- a/scripts/desktop/build-desktop-core.sh +++ b/scripts/desktop/build-desktop-core.sh @@ -27,7 +27,11 @@ native_path() { fi } -# Lithe-core-rust main at 957a349, #64 squash-merged: gitExecution.consoleQueries names the query +# Lithe-core-rust #67 (branch fix/toolchain-candidates-command-homes at 16d17b1), on top of main +# at 957a349: toolchains.candidates takes the optional commandHomes, lists the commands found on +# the PATH as shell rows, and offers each shell home that checks out as an installations entry +# with provider host:shell, once per canonical home (#2032). That main is +# #64 squash-merged: gitExecution.consoleQueries names the query # categories the Git console records and queryCategory names a read the command does not tell # apart; git.consolePresentation takes display options, all false by default as in IDEA; output # folds only past ten lines and a deletion never folds; a failed unrecorded query still reports its @@ -135,7 +139,7 @@ PINNED_CORE_REPOSITORY="https://github.com/Lithe-IDEA/Lithe-core-rust.git" # the contract, plugin guides, reference and SDKs live only in shared/plugins; on top of #16 (reported Git queries folded in the console), # #15 (git.write cherryPick, revert and reset fields), #14 (word-level changed ranges of diff # rows), #13, #8, #7, #6 and #4. -PINNED_CORE_REVISION="957a349a5d8b571d416925c8231509572c2053f5" +PINNED_CORE_REVISION="16d17b19922ba636db506d28bdedd13ed88bed47" PROFILE="debug" while [[ $# -gt 0 ]]; do case "$1" in diff --git a/shared/platform-feature-matrix/features/build-system-plugins.json b/shared/platform-feature-matrix/features/build-system-plugins.json index 64aa444e1a..2a5731f7ec 100644 --- a/shared/platform-feature-matrix/features/build-system-plugins.json +++ b/shared/platform-feature-matrix/features/build-system-plugins.json @@ -33,7 +33,10 @@ "desktop/internal/workbench/catalog.go", "desktop/internal/core/build_options.go", "desktop/internal/workbench/build_options.go", - "desktop/internal/workbench/build_ignored_paths_test.go" + "desktop/internal/workbench/build_ignored_paths_test.go", + "desktop/internal/buildprocess/batch.go", + "desktop/internal/buildprocess/batch_test.go", + "desktop/internal/workbench/build_command_output_test.go" ] }, "windows": { @@ -66,12 +69,16 @@ "desktop/internal/workbench/catalog.go", "desktop/internal/core/build_options.go", "desktop/internal/workbench/build_options.go", - "desktop/internal/workbench/build_ignored_paths_test.go" + "desktop/internal/workbench/build_ignored_paths_test.go", + "desktop/internal/buildprocess/batch.go", + "desktop/internal/buildprocess/batch_test.go", + "desktop/internal/workbench/build_command_output_test.go", + "desktop/internal/buildprocess/batch_windows_test.go" ] }, "owner": "Extensions", "verification": "macOS 已接入 static、command、hostIntegration、provider 四种模型来源:宿主向 Core 声明 buildSystems 与 buildProviders 能力,插件市场因此列出兼容的 API 3 声明式和 Provider 版本;Provider 进程按插件、构建系统和工作区各自独立,经各自 stdio 用 JSON-RPC(LSP 基础协议)与宿主通信,initialize 协商 capabilities.experimental.litheBuild 后宿主才经 lsp.buildRequest 发送 lithe/build/model、lithe/build/dependencies,回复交给 Core 解码;共享写法只复用同一插件的语言服务器会话;进程只在用户加载模型或依赖时启动,切换工作区、关闭项目窗口、停止执行模块、停用或更新插件、退出应用时停止;ExecutionFeatureGraph.stop 经 BuildSystemService.stop 同时回收已就绪和初始化中的 Provider,停止后的初始化完成也不得重新登记会话;状态写入插件状态目录;每个已启用的构建系统插件在打开工作区后各有一个右侧工具窗口(标题为 displayName、图标为 icon),不依赖识别结果,工作区没有对应工程时窗口内显示未检测到该构建系统,工具栏放运行、参数任务、刷新和 presentation=toolbar 的开关,树顶部是 presentation=tree 的勾选选项,工程下按 category(缺省按 group)分级列出任务,再列测试、目标和依赖;旧客户端内置的构建窗口与共享 Build 窗口已删除,Build Output 显示输出、诊断与测试结果。窗口恢复先激活所属插件模块,激活中的命令面板项禁用;参数任务遵守 workspace/project/target 作用范围与目标标签,模型或工作区变化后清除旧选择。隔离回归覆盖这些边界、窗口布局恢复及包内图标读取前后文件清单与字节不变;多实例的根目录选择器保留每个实例的模型候选和生效值,编辑多选时保留兄弟实例独有的已选值;显式清空按实例根持久化为空覆盖,检测、同步指纹、任务计划和语言服务器导入使用同一覆盖,兄弟编辑或重开不会恢复非空默认值,非空编辑清当前实例标记而共享编辑/重置清该选项全部标记;真实 Core、生产存储与服务回归核对最终 argv 和导入值;列表单选与多选支持 allowCustom 原生输入和移除已选自定义值,文本/文件/目录清空提交显式空字符串,只有重置删除覆盖。运行时准备后再等一次,覆盖等待期间失效。命令模型 run 配置尚未接入;buildProviders 2 已接入原生任务 lithe/build/execute,复用工作区进程并校验协议版本、进度/结果、取消/超时和旧结果隔离,真实安装包/工具工作流仍待验收,Provider 无操作系统级沙盒;Windows 宿主尚未调用 build.* 命令。自动化:cargo test -p lithe-core --lib build_systems、cargo test -p lithe-core --lib lsp、scripts/architecture/verify-shared-contracts.sh、./scripts/macos/test/test-macos.sh --filter 'BuildSystemToolWindowTests|RustBuildSystemOperationsTests|BuildSystemServiceTests|PluginMarketplaceServiceTests'。手动验证:安装 fixtures 中 build-static-file、build-command-stdout 形态的插件包,确认每个构建系统各出现一个工具窗口,列出工程、分级任务、选项和依赖,停用插件后窗口消失;执行任务与测试的 argv 与 build-plans.json 一致,停止与输出上限生效;JUnit 报告与 lineMatcher 诊断可跳转到源码;命令模型和项目内 Wrapper 只在用户点击加载或运行后启动;禁用插件后实例消失;Windows 接入后另需验证未信任工作区不启动任何模型命令或 Wrapper;build-provider 形态的自有 Provider 只在用户操作或工作区信任后启动、停用插件时停止,build-provider-language-server 形态复用语言服务器会话而不启动第二个进程;运行前后 app bundle 文件清单不变(scripts/desktop/verify/verify-runtime-bundle-immutability.sh)。;新路径选择使用 executableResolution 1 + settings 2,已发布 buildSystems 2 旧字段只作统一候选输入适配:MacBuildToolResolverTests 验证带空格绝对路径、权限与版本失败不回退,BuildSystemServiceTests 验证 Provider 失败不独立发现,RustBuildSystemOperationsTests 验证全局值接入。发布前需把独立仓库 sdk.lock.json 的宿主 pin 更新到包含该能力的已发布提交。;回归增加非法存储值不回默认、数组/priority/插入顺序与拒绝循环、宿主注入发现、空设置跳过和被动选择不探测;Language Server/Execution Provider 新清单语法尚未开放,Windows 不声明 executableResolution。;真实 Core + macOS resolver + BuildSystemService 组合回归覆盖前置 Runtime 缺失/版本不足时保留工具或后置 Runtime 的非空 setting 约束,Provider 不发送独立发现请求;全部设置为空时仍可回退。自定义 Runtime 先构造含所选目录的 PATH,再以同一环境探测与执行,同目录 helper 的带空格路径回归通过。;buildProviders 3 增加原生测试执行 lithe/build/test,筛选参数保持类型化,报告复用 JUnit/标准结果解析;旧协议明确拒绝测试,报告解析期间配置失效会取消操作并丢弃迟到结果。原生树已接入按需测试发现,Core 校验完整清单并保留模块身份,运行前重查当前清单;配置/源码/包变化、停用/重开使缓存或进行中的发现失效。Windows 工作流仍待验收。;buildProviders 4 应用目标准备接入原生 Build 树,构建进度在 Build Output 展示,验证后转交 RunService 解析工具与启动/停止应用;准备期间源码、选项、工作区或停用变化拒绝迟到启动,旧操作 ID 不得停止替换进程;Core 拒绝绝对可执行路径、越界目录/符号链接及超限参数环境。服务编排与调试尚未完成;真实插件/发行包和 Windows 工作流仍待验收。;Run v2 本地层显式保存 Provider 选择器,参数保持原始数组;无 generated.json 也能读回/显示,重复保存保留 ID/其他配置/项目环境;重启重新进入当前 Provider,停止与晚到结果按身份隔离。原生入口保存工作区文档后再准备,Run 窗口在未生成旧配置时仍显示 Provider 输出。;Agent 入口回归从真实本地配置启动,验证准备到进程退出保持公开操作 ID、准备中停止与重启重新准备,旧 ID 不能停止替换操作;Provider 与进程为可控替身,真实插件端到端验收仍待完成。;Core 的 Node/Java SDK 补齐协议 2/3/4 的处理器、版本准入与进度;无页面示例经真实 Core 验证非零构建退出码、精确筛选、运行前构建及准备计划、并行工作区、取消工具清理和完整包不变,另保留锁定旧契约的兼容场景与 TypeScript 调用方编译检查。SDK 尚未发布,Windows 验收仍待完成。 原生 Debug:运行声明引用同包适配器,点击 Build 树 Debug 或保存配置的 Debug 后先保存并构建,验证程序路径/参数/环境交给注册表;停止、源码或配置变化、模型重载、插件停用与工作区切换均丢弃过期结果,解码后的文件别名变化和不可执行文件在平台交接前拒绝。Node/Java SDK 进程的准备协议与 Core 解码有端到端覆盖;真实适配器、跨插件协作和 Windows 尚未验收。 正式包、完整 macOS UI 与 Windows 验收未完成,保持 partial/pending。 真实原生调试集成:公开 Node SDK Provider 用 Clang 编译 C 程序,经生产 macOS 会话、Core 准备、Registry 明确身份、生产 stdio 传输和 LLDB 命中源码断点、读取 main 栈帧、保留空格参数后继续并退出码 0;包 SHA-256/权限不变,所有本次进程回收。测试显式选择 SDK/工具,完整 UI、正式发行与 Windows 尚未验收,verification 保持 pending。 Build 树应用从文档保存阶段起持有同一可取消运行 ID;保存 gate 下启动新任务/测试或停止、切换工作区、选项/源码/模型/插件失效后,旧保存返回不得启动 Provider、替换新运行或清空新输出;保存失败不启动,成功后才准备。 原生视图隔离回归用真实 Core 与受控 Provider 数据检查深浅主题的测试发现、Debug 入口和 Run 输出;截图仅验证该视图状态,不代替完整发行包或 Windows 实机验收。 实例作用域:用同一工作区的两个独立根验证 Profiles、文件/目录、布尔与文本值独立持久化;编辑、清空或重置 A 不影响 B,重开后任务、静态运行入口、同步和语言导入读取相同根的配置;未声明作用域的插件保留共享行为。Windows 运行验收另行完成,保持 partial/pending。 作用域变更的旧 Build 偏好先复制并验证目标,再删除共享源;写入失败阻止默认配置发布并允许重试,已有实例值优先,暂未检测到根的空标记也迁移保留。 工具链候选通过真实 Core 与生产本地文档验证按实例选择工具,Provider 环境保留选中工具的环境变量与 PATH 且不转发无关测试凭据;被动导入不探测版本或运行 Wrapper,显式路径失败不能独立发现。Windows 不声明 executableResolution 2。 共享 Build 文档验证工作区/实例默认值、逐根覆盖和本机差异合并;重开和检测不改共享字节,重置本机值恢复继承,外部修改冲突或文档损坏明确失败并保留原始数据。 未选中的自定义候选仅在 allowCustom 选项中展示,不改变选择和模型;真实 Core、生产存储和服务回归通过,新增实例静态入口继承团队默认值。 协议 8 回归覆盖协商拒绝、随执行返回的报告、缺失/损坏失败、模块同名测试隔离、取消/配置变更后拒绝晚到解码,以及普通任务中的测试结果。Java/Node SDK 同步,正式发布尚未完成。 本机选项、逐根映射和空多选标记中存在非 Data 存储值时,检测失败并保留原始偏好,不得当缺失键发布默认值。 本机实例默认值继承、逐根覆盖与重置通过真实 Core 和生产存储验证,团队文档字节不变;本机默认值不进入资源复用。 正式发行组合仍待验证。 协议 10 接通带版本协商的类型化运行选项与服务/任务准备(Core、Swift、Node/Java SDK)。原生 Run/Start All 为每个 Provider 服务独立准备,配置 ABA/Stop/重置拒绝旧回复,已停进程输出不能覆盖新会话;Build 树按服务/任务类型发请求;停用和包更新在删除包前停止准备及进程,旧启动注册更新后不可再次使用。macOS 无调用者的旧内置构建桥和工程模型已删除;Windows 当前旧命令消费者、Core 旧实现和正式发行/完整 UI 验收仍待完成。 保存 Provider service/task 引用保留执行类型、稳定配置 ID 和参数,重开后按当前声明重验;独立准备至进程交接保留 Agent 操作身份。 服务所有者使用完整插件包身份;停用其中一个插件不会停止同名构建系统下另一插件的进程。preview 内存检测层保留 Provider 模型摘要,自动识别不写工作区。 Windows Build 选项编辑与 Agent 共用原生本机存储:开页只读,修改草稿后显式保存/恢复继承;隐藏重开保留草稿。团队/本机两层版本同时检查,冲突、关闭、插件撤销拒绝迟到写入。实例选择独立,工作区多选保留兄弟实例值和显式空选择;无关系统/根/记忆选项与团队文件字节保持。保存后重新检测并使旧模型失效。长选项/模型选择使用有界视口,不启动工具或 Provider。产品能力准入仍关闭,不能据此认定 Windows 迁移完成。 Viva 2026-11-09:Tests 工具窗口经 build.testPlan 计划工作区测试,宿主只启动 Core 展开的命令或 Provider 请求;报告由 Core build.decodeTestResults 解码,最终判定由 build.resolveTestRunOutcome 归约,宿主不解析报告格式、不按退出码自行判定。结果树按 suite/case 分组并有界虚拟化,失败项按解码出的 workspace-relative path/line 打开;停止、工作区关闭和过期结果按 run generation 丢弃。desktop/internal/workbench/tests_test.go 以隔离 fixture 插件、真实测试进程和 JUnit fixture 覆盖运行→解码→结果树→失败定位、停止取消和关闭项目停止运行;desktop/internal/workbench/tests_provider_test.go 用真实 Provider 进程(lithe/build/test 返回规范报告)覆盖 Provider 运行→Core 解码→结果树、Provider 取消和关闭项目停止 Provider 会话;原生窗口与 Windows 实机仍 pending。 Viva 聚合 Build 窗口:build_tree_test.go 覆盖默认只展开选中实例、用户展开/折叠的记忆、全部展开时依赖保持折叠、筛选按分组/根目录/行匹配且不触发加载、同时最多加载 4 个模型、失败和折叠的分组不加载,以及点击其他分组的行切换构建系统并能运行选中的目标;build_menus_test.go 覆盖从右键菜单运行目标后打开 Run 窗口的构建控制台;runconfig_browser_test.go 覆盖 Build 窗口中的运行配置列表:范围与计数、固定写入客户端存储而不写项目、分组折叠展开、双击运行和行内停止。运行 scripts/desktop/desktop-go.sh test ./internal/workbench -run 'TestBuild|TestRunConfiguration' -count=1。真实插件组合与 Windows 实机仍待验收。 Viva 2026-11-14 任务范围:构建树的任务行不带项目,从树里运行时按任务声明的范围推断,不再把只能在项目上运行的任务当作工作区请求(Core 会报 plugin.build.invalidSelection)。模型任务用它所属的项目;声明任务依次用选中的目标、选中的项目(或目标所在的项目)、工作区;什么都没选时取构建根目录的项目或唯一的项目、唯一适用的目标;推断不出时提示先选择项目或目标,不发请求。选中项目时,任务分组只列出这个项目的模型任务。IDE API 仍按请求原样交给 Core 校验。build_tree_test.go 的 TestBuildTaskSelectionFitsDeclaredScopes、TestBuildTreeTasksRunOnTheScopeTheyDeclare 覆盖这些规则,后者在修复前失败(Project 为空);真实插件组合与 Windows 实机仍待验收。", - "notes": "Viva 已接入 buildSystems 1 / buildProviders 1–2 的纵向切片:Build 工具窗口用 Core 检测实例、加载 provider 模型或执行 command 模型,列出项目、目标、command/provider 任务;command 任务按 build.invocationPlan 的候选顺序解析并做版本检查,provider 任务经 lsp.buildRequest 执行,共享 provider 复用同插件语言服务器;输出有界、支持停止,关闭项目回收 provider 与进程树。GitHub Release 原始包按契约 / 目录布局发布,当前 pluginpkg 只接受解压根目录的 plugin.json,安装器布局问题单独记录。未声明 buildProviders 4、settings、executableResolution、测试与 Debug:工具链运行引用、需设置插件、测试/诊断面板仍缺失。Windows Job Object 已实现并交叉编译,但无实机验证,保持 pending。Viva 客户端尚未逐项盘点;legacy 是迁移前基线,不代表当前实现。 Viva 运行设置接线:build.invocationPlan 携带真实全局插件层,显式无效工具路径直接失败并保留自动候选顺序;有效显式工具父目录进入 PATH。Provider 启动携带独立全局/项目层,工作区 URI 由 Core 生成。此接线不表示通用设置界面、原生配置页或完整 Build 协议迁移已验收。 Viva 2026-11-14:构建系统改为一个聚合的 Build 工具窗口,放在右侧工具栏上方(与 IDEA 的位置一致),不再为每个实例开标签页。窗口里是一棵树,每个检测到的构建系统实例是一个分组,显示构建系统名称、徽标和相对根目录;分组下是项目、目标、任务、测试和依赖。默认只展开当前选中的实例,用户手动展开或折叠过的分组保持该状态;依赖分组默认折叠,因为加载依赖要运行构建工具。筛选框按分组名称、根目录和行名称过滤,匹配的行固定展开在所属分组下;筛选只读已加载的模型,不会触发加载。展开的分组按需加载模型,同时最多加载 4 个,加载失败的不会自动重试,折叠的分组不加载。点击其他分组的行会切换到该构建系统并选中这一行,工具栏的运行按钮会执行选中的目标或任务。运行配置列表放在右侧 Build 窗口顶部,和下面的构建树之间有可拖动的分隔条,按范围、固定和执行类型筛选,双击运行、行内按钮停止。目标的名称以其路径结尾时(如包的导入路径以所在目录结尾),目标行只显示路径,鼠标悬停显示完整名称;其他目标仍显示名称并在旁边显示路径,筛选仍按名称和路径匹配。底部原先的 Build 窗口改为 Run 窗口,只显示运行输出:构建控制台,以及插件启动的运行各自的标签页;Build 窗口发起的任务或运行会打开 Run 窗口并切到构建控制台。 Viva 2026-11-14:参照 IDEA 的 Make 窗口,每个任务和有运行入口的目标行首常驻绿色运行按钮,不必先选中,点一下就选中该行并运行,构建进行中按钮变暗不可点;没有运行入口的目标和项目保留类型图标,调试按钮仍只在选中的行上。名称与路径放不下时路径先省略、名称以省略号结尾,悬停提示显示完整名称和路径(只显示路径的目标显示完整名称);依赖标题旁的 ⓘ 说明依赖树在第一次展开时才由构建工具读取,以及何时重新读取。自动化:TestBuildTreeRunMarksRunTheirRowsAtOnce;截图 docs/assets/build-panels/build-go-targets-*.png。 Viva 2026-11-14:Core 固定版本升到 Lithe-core-rust#33,构建检测和自动运行项发现跳过被 Git 忽略的目录(工作区内的 .gitignore 与仓库的 info/exclude),代理工作树、生成目录和本地副本不再被列成构建系统,同一模块不再出现两遍;Core 自动化:tests::build_systems::detection_skips_directories_git_ignores。 Viva 2026-11-14:Core 固定版本升到 Lithe-core-rust#35,构建选项新增“检测”分区的忽略路径:一行一条 .gitignore 写法的规则,相对项目根目录、只匹配文件夹,默认忽略所有以 . 开头的文件夹(如 .claude/worktrees),以 ! 开头的规则可以让文件夹(包括被 Git 忽略的)重新参与检测。列表按本机、团队文件 .lithe/build/options.json、默认值的顺序取第一个,对话框写明当前来源;修改只保存在本机,恢复默认删除本机列表,保存后重新检测。Build 窗口标题栏的齿轮打开只含忽略路径的构建选项,构建系统行的齿轮和右键菜单在忽略路径下方显示该构建系统的选项;Core 拒绝的规则标出所在行,对话框保持打开、不写入。自动化:TestBuildOptionsIgnoredPathsAreSavedOnThisMachineAndRestored、TestBuildOptionsNameTheLineOfARefusedIgnoredPath、core 包 TestBuildIgnoredPathsResolveFromTheLayersAndEditTheLocalList、TestBuildDetectSkipsTheIgnoredPaths。", + "notes": "Viva 已接入 buildSystems 1 / buildProviders 1–2 的纵向切片:Build 工具窗口用 Core 检测实例、加载 provider 模型或执行 command 模型,列出项目、目标、command/provider 任务;command 任务按 build.invocationPlan 的候选顺序解析并做版本检查,provider 任务经 lsp.buildRequest 执行,共享 provider 复用同插件语言服务器;输出有界、支持停止,关闭项目回收 provider 与进程树。GitHub Release 原始包按契约 / 目录布局发布,当前 pluginpkg 只接受解压根目录的 plugin.json,安装器布局问题单独记录。未声明 buildProviders 4、settings、executableResolution、测试与 Debug:工具链运行引用、需设置插件、测试/诊断面板仍缺失。Windows Job Object 已实现并交叉编译,但无实机验证,保持 pending。Viva 客户端尚未逐项盘点;legacy 是迁移前基线,不代表当前实现。 Viva 运行设置接线:build.invocationPlan 携带真实全局插件层,显式无效工具路径直接失败并保留自动候选顺序;有效显式工具父目录进入 PATH。Provider 启动携带独立全局/项目层,工作区 URI 由 Core 生成。此接线不表示通用设置界面、原生配置页或完整 Build 协议迁移已验收。 Viva 2026-11-14:构建系统改为一个聚合的 Build 工具窗口,放在右侧工具栏上方(与 IDEA 的位置一致),不再为每个实例开标签页。窗口里是一棵树,每个检测到的构建系统实例是一个分组,显示构建系统名称、徽标和相对根目录;分组下是项目、目标、任务、测试和依赖。默认只展开当前选中的实例,用户手动展开或折叠过的分组保持该状态;依赖分组默认折叠,因为加载依赖要运行构建工具。筛选框按分组名称、根目录和行名称过滤,匹配的行固定展开在所属分组下;筛选只读已加载的模型,不会触发加载。展开的分组按需加载模型,同时最多加载 4 个,加载失败的不会自动重试,折叠的分组不加载。点击其他分组的行会切换到该构建系统并选中这一行,工具栏的运行按钮会执行选中的目标或任务。运行配置列表放在右侧 Build 窗口顶部,和下面的构建树之间有可拖动的分隔条,按范围、固定和执行类型筛选,双击运行、行内按钮停止。目标的名称以其路径结尾时(如包的导入路径以所在目录结尾),目标行只显示路径,鼠标悬停显示完整名称;其他目标仍显示名称并在旁边显示路径,筛选仍按名称和路径匹配。底部原先的 Build 窗口改为 Run 窗口,只显示运行输出:构建控制台,以及插件启动的运行各自的标签页;Build 窗口发起的任务或运行会打开 Run 窗口并切到构建控制台。 Viva 2026-11-14:参照 IDEA 的 Make 窗口,每个任务和有运行入口的目标行首常驻绿色运行按钮,不必先选中,点一下就选中该行并运行,构建进行中按钮变暗不可点;没有运行入口的目标和项目保留类型图标,调试按钮仍只在选中的行上。名称与路径放不下时路径先省略、名称以省略号结尾,悬停提示显示完整名称和路径(只显示路径的目标显示完整名称);依赖标题旁的 ⓘ 说明依赖树在第一次展开时才由构建工具读取,以及何时重新读取。自动化:TestBuildTreeRunMarksRunTheirRowsAtOnce;截图 docs/assets/build-panels/build-go-targets-*.png。 Viva 2026-11-14:Core 固定版本升到 Lithe-core-rust#33,构建检测和自动运行项发现跳过被 Git 忽略的目录(工作区内的 .gitignore 与仓库的 info/exclude),代理工作树、生成目录和本地副本不再被列成构建系统,同一模块不再出现两遍;Core 自动化:tests::build_systems::detection_skips_directories_git_ignores。 Viva 2026-11-14:Core 固定版本升到 Lithe-core-rust#35,构建选项新增“检测”分区的忽略路径:一行一条 .gitignore 写法的规则,相对项目根目录、只匹配文件夹,默认忽略所有以 . 开头的文件夹(如 .claude/worktrees),以 ! 开头的规则可以让文件夹(包括被 Git 忽略的)重新参与检测。列表按本机、团队文件 .lithe/build/options.json、默认值的顺序取第一个,对话框写明当前来源;修改只保存在本机,恢复默认删除本机列表,保存后重新检测。Build 窗口标题栏的齿轮打开只含忽略路径的构建选项,构建系统行的齿轮和右键菜单在忽略路径下方显示该构建系统的选项;Core 拒绝的规则标出所在行,对话框保持打开、不写入。自动化:TestBuildOptionsIgnoredPathsAreSavedOnThisMachineAndRestored、TestBuildOptionsNameTheLineOfARefusedIgnoredPath、core 包 TestBuildIgnoredPathsResolveFromTheLayersAndEditTheLocalList、TestBuildDetectSkipsTheIgnoredPaths。 Viva 2026-11-16(#2032):Windows 上由宿主启动的 .cmd/.bat(构建工具、版本探测、Run、Tests 共用 buildprocess)改为宿主自己构造 cmd.exe /d /c \"\"脚本\" 参数\" 命令行,参数按 BatBadBut 修复后的规则转义;此前脚本目录和参数都含空格时 cmd 去掉首尾引号,Maven 模型加载报 C:\\Program 不是命令并以 exit 1 失败。模型和依赖命令失败时,错误附带工具最后 12 行输出(去掉终端控制符),构建树行悬停显示全文。Windows 11 ARM64 来宾(x64 仿真)实机:TestBatchFileUnderASpacedDirectoryReceivesItsArguments 修复前失败、修复后通过,buildprocess 全部用例通过;同一来宾用真实 mvn.cmd 跑模型命令,修复前 exit 1,修复后写出模型。完整客户端界面验收尚未执行,状态保持 pending。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": { diff --git a/shared/platform-feature-matrix/features/plugin-injected-toolchains.json b/shared/platform-feature-matrix/features/plugin-injected-toolchains.json index 3a40fda92a..ff37896bf6 100644 --- a/shared/platform-feature-matrix/features/plugin-injected-toolchains.json +++ b/shared/platform-feature-matrix/features/plugin-injected-toolchains.json @@ -27,7 +27,8 @@ "desktop/internal/toolchain/catalog.go", "desktop/internal/toolchain/catalog_test.go", "desktop/internal/settingswindow/visual_capture_test.go", - ".github/workflows/desktop-ci.yml" + ".github/workflows/desktop-ci.yml", + "desktop/internal/toolchain/load.go" ] }, "windows": { @@ -48,12 +49,13 @@ "desktop/internal/toolchain/catalog.go", "desktop/internal/toolchain/catalog_test.go", "desktop/internal/settingswindow/visual_capture_test.go", - ".github/workflows/desktop-ci.yml" + ".github/workflows/desktop-ci.yml", + "desktop/internal/toolchain/load.go" ] }, "owner": "Plugin Platform", "verification": "共享 Core:cargo test --manifest-path rust/Cargo.toml -p lithe-core --lib toolchain,核对定义独占与官方短 ID、第二种通用工具、旧候选边界、答案身份/代次、Windows 路径大小写、工作区排除、固定值失效不回落、最近项目要求、冲突选择、最低版本、环境隔离和纯声明扫描;按逐项计时工具生成 HTML/JUnit。macOS 继续补齐下列消费者与保存验收,Windows 须先实现对应 adapter:启动提供方并协商、取消/超时和过期结果隔离、输入新建/删除后整体重查、目录固定保存/取消/冲突回读、插件停用撤回、真实 Build/LSP/Run 消费者取得同一选择、发行目录哈希不变与子进程清理。未完成原生流程前保持 pending,不以 Core 测试代替实机验证。 提供方查询:cargo test -p lithe-core --lib toolchain(含 lsp 引擎脚本后端:只有插件后端被提供 litheToolchains、未协商的提供方不写请求、错误回复原样返回;别名链接只有链接路径事实时仍选中规范 home);MacToolchainDiscoveryTests 用真实临时目录与注入的查询验证全局与目录查询各带独立 operationID/代次、链接 home 规范化、工作区内 home 整份拒绝;ToolchainSettingsFeatureTests 验证监视文件连续变化只重载一次、外部输入观察随关闭释放。真实 mise 插件端到端尚未在应用内验证。 原生布局回归 ToolchainSettingsLayoutTests:同一设置宿主按900/1180/1400/900重复缩放,真实分隔条拖动;来源页按500/666/946/500缩放,检查AX控件边界、卡片不重叠、选择和快照不改变。此几何验证不代表提供方查询或保存功能已完成。 声明式扫描 MacToolchainDiscoveryTests:真实临时目录、注入的用户目录与探测,覆盖 homeLayouts 首个匹配、隐藏与未匹配条目、链接到工作区的条目不探测、只探测 Core 返回的可执行文件、同版本冲突、被拒声明不扫描,以及隔离预览样例清单通过 Core 准入;不运行本机安装的工具。 固定集成新增 MacToolchainDiscoveryTests 的运行前解析回归和 MacBuildToolResolverTests,验证两个目录使用各自 pin、最低版本、独立环境与失败不回落;RunLaunchEnvironmentTests 证明操作返回值不会留下共享执行许可槽。该测试不是完整应用 UI 验收。 生产准入回归 installedToolDeclarationsPassTheProductionHostAdmission 经 RustDeclarativePluginOperations 验证工具定义和提供者。Build PATH 保留声明的附加目录,拒绝空目录项。 Windows 原生解析基础:lithe-project::defined_toolchain 逐项计时覆盖两个工具、声明式扫描、固定目录、最近继承、同版本冲突、最低版本、显式 Wrapper、输入撤销及宿主秘密不进入 RPC。真实 Windows 命令包装和进程清理继续由现有 CI 验证;准入仍关闭。 本次回归另核对同目录两个 Run 独立选择、团队/本机逐项合并和显式清空、私有环境隔离、失效固定值不回落、工作区启动器被动零探测,以及未知默认值迁移失败保留源文件。 本批显式 LITHE_TEST_NODE 驱动真实 Core/Node 会话,逐项计时覆盖单次协商、多次查询、原始错误、无协商拒绝、静默超时、后端意外退出与撤销清理;原生解析验证查询与当前事实、来源在探测中变化及稳定模型摘要。安装状态按 plugin/operation/workspace 隔离且不可跨工作树复制。 #1581 最终合入回归包含固定值与未扫描目录、同轮次/上下文、冲突及提供方超时和不可用的来源展示。 通用默认增量:更改工作区工具 home 后,消费者继承读取新值,按 Run 固定值保持独立;失效明确路径不回落,来源在探测期间改变或越出工作区时拒绝。旧编辑保存保留通用偏好,显式空 v1 文档清除。矩阵保持 pending,未把手写测试文档当成设置页或旧配置迁移验收。 macOS Build 偏好编辑:ToolchainPreferencesTests 验证打开/草稿/取消/空重置不建文件、明确保存/回读与权限保留、外部冲突保留原始草稿基线、仅偏好文档不阻断旧默认迁移、缺失子目录的父链接/最终链接/只读安装目录拒绝及主动取消;原生 Save/Reset 按钮在深浅主题通过实际存储执行。ToolchainSettingsLoaderTests 验证使用方来自当前 Core invocation 并随停用撤回。运行全量 Core 与相关 macOS 逐项计时;完整产品、全局默认、旧消费者和 Windows 设置页仍待验收。 tool 引用验证:共享 fixture/Core 覆盖最近通用目录、根目录、跳过父消费者、目录与工作区默认变化、显式 Run 优先和禁止通用工具反向引用;MacToolchainDiscoveryTests 与 lithe-project::defined_toolchain 的真实临时安装/注入探测验证运行前重读,不冻结安装路径。 本机目录/重载回归覆盖仅消费者偏好、父目录连接、重置撤回、链接/非法层级拒绝、单次重试与可刷新错误、未修改表单更新、冲突草稿保留及自身保存通知不等待/撤销保存。该集成不代替完整 GUI。 运行前来源审计 missingPreferenceLeafBehindAParentAliasIsRejectedBeforeToolWork 覆盖两级父目录及存在/悬空链接,四种情况均在工具探测前拒绝。 ToolchainPluginAdmissionTests 使用正式契约 fixture 与真实 Core 验证市场可安装、完整安装审查、清单加载,以及无后端纯工具定义插件的启用模块和工厂登记;本地编译验证不代替真实 mise 与 Windows 工作流验收。 2026-11-02 本机 Swift 6.4.2:准入、后端、发现和加载器 42 项通过,新增两个准入用例分别 4/6 ms;Swift 6.3.3 在本机 Xcode 27.2 SDK 下编译依赖清单崩溃,不能作为固定工具链通过。真实 mise 0.2.1 发布包 SHA-256 与市场一致,Core 证明修复前 unsupported、修复后 available;真实后端完成协商、查询并停止销毁,当前环境未安装 mise,查询真实返回 miseNotFound,未验证安装列表和应用内工作流。 增补来源保存验收:不存在的 pin 重置不创建状态;拒绝逃出工作区的符号链接/junction;有界 UTF-8 与重复键、未知字段和 dormant pin 校验;Git 后续否定规则、换行/评论/权限保留;公开字节基线不可替代私有快照;已提交但回读失败必须重新加载后才能重试。 Viva 全局 SDK 页:运行 TestVisualSettings/33-settings-toolchains,使用 en、zh-Hans 和 dark/light 的生产无头窗口,核对无项目模式、自动实际值、多版本登记与全局默认选择。通过 run-go-tests-with-timing.mjs 记录单测试 HTML/JUnit;desktop-ci 的 macOS/Windows 每次上传四张图和计时报告。2026-11-15 本机 macOS 与 Windows 11 ARM64 来宾的 GNU x64 系统仿真均通过两个语言各 3 个计时结果,Windows 49 个 SDK/来源/诊断/资源定向用例通过;该证据不替代工具提供方与完整产品工作流验收,整体保持 partial/pending。", - "notes": "Viva:共享 Core toolchain 命令已接入 desktop/internal/core/toolchain.go;声明式扫描、文件事实、有界版本探测、toolchains.candidates/resolve 与目录 pin 保存位于 desktop/internal/toolchain/ 并有真实 Core 测试;设置窗口 Build 页可按插件声明展示工具、生效值与来源,显式 Save/Reset 写 .lithe/toolchains/local.json,Cancel 不写;Build 命令和 Provider Run 的 toolchain 候选使用 Core 解析出的可执行文件、环境导出和 PATH。提供方后端查询(toolchainProviders)未接入,因此未声明该能力;Windows 与完整 GUI/原生工作流未验收,状态保持 pending,legacy 证据不代表 Viva。 本轮通过外部 Core Draft PR #3 的精确提交接入 toolchains.editPins:平台不再编辑 pin schema;Core/Go 共用 fixture、批量保存和取消/外部并发修改回归通过。命令型 Tests 同样消费解析后的工具链环境。原生 Windows、提供方工具查询、完整 GUI 与发行验收仍 pending。 Windows 原生回归确认保存前后的文件模式以及真实访问控制描述符(所有者、组、DACL/继承保护)保留;元数据先准备到临时文件,再核对取消/冲突并原子发布。此证据不代表提供方查询或 GUI 已验收。 Viva 设置保存前核对读取项目的原生目录身份;项目关闭或切换后旧草稿拒绝写入,已确认保存的发布与回读固定捕获来源。冲突通过共享 i18n 显示并保留草稿,加载/保存失败进入目录日志;macOS 先失败后通过的回归已有计时,新增作用域行为的 Windows 验收尚未执行。 Windows 原生探测统一 Core 正斜杠路径与本机反斜杠/大小写别名,防止重复事实使目录 pin 解析遭拒绝;选择与校验规则仍由原有 Core 决定。 全局 SDK 登记与默认值可在未打开项目时编辑;项目范围保留独立覆盖,读取不创建文件,确认保存后按实际探测回显。新增合成工具原生与无头测试,不改变历史完整验收状态。 Viva 2026-11-16:Build 页每个工具改为一个下拉框,默认回显当前选择(未固定时为“自动(实际目录)”),列出识别到的其他安装、已保存固定值和已校验目录;选“自定义…”才显示目录输入、浏览和“使用此目录”,校验通过后该目录成为列表项并被选中。无版本的安装不可选,在列表下以说明文字列出。自动化:TestToolchainListShowsAutomaticAndHidesTheDirectoryUntilCustom 及原有草稿/保存/冲突用例;截图 TestVisualSettings/33-settings-toolchains、m44-toolchain-directory-menu、m45-toolchain-custom-directory。原生验收仍 pending。", + "notes": "Viva:共享 Core toolchain 命令已接入 desktop/internal/core/toolchain.go;声明式扫描、文件事实、有界版本探测、toolchains.candidates/resolve 与目录 pin 保存位于 desktop/internal/toolchain/ 并有真实 Core 测试;设置窗口 Build 页可按插件声明展示工具、生效值与来源,显式 Save/Reset 写 .lithe/toolchains/local.json,Cancel 不写;Build 命令和 Provider Run 的 toolchain 候选使用 Core 解析出的可执行文件、环境导出和 PATH。提供方后端查询(toolchainProviders)未接入,因此未声明该能力;Windows 与完整 GUI/原生工作流未验收,状态保持 pending,legacy 证据不代表 Viva。 本轮通过外部 Core Draft PR #3 的精确提交接入 toolchains.editPins:平台不再编辑 pin schema;Core/Go 共用 fixture、批量保存和取消/外部并发修改回归通过。命令型 Tests 同样消费解析后的工具链环境。原生 Windows、提供方工具查询、完整 GUI 与发行验收仍 pending。 Windows 原生回归确认保存前后的文件模式以及真实访问控制描述符(所有者、组、DACL/继承保护)保留;元数据先准备到临时文件,再核对取消/冲突并原子发布。此证据不代表提供方查询或 GUI 已验收。 Viva 设置保存前核对读取项目的原生目录身份;项目关闭或切换后旧草稿拒绝写入,已确认保存的发布与回读固定捕获来源。冲突通过共享 i18n 显示并保留草稿,加载/保存失败进入目录日志;macOS 先失败后通过的回归已有计时,新增作用域行为的 Windows 验收尚未执行。 Windows 原生探测统一 Core 正斜杠路径与本机反斜杠/大小写别名,防止重复事实使目录 pin 解析遭拒绝;选择与校验规则仍由原有 Core 决定。 全局 SDK 登记与默认值可在未打开项目时编辑;项目范围保留独立覆盖,读取不创建文件,确认保存后按实际探测回显。新增合成工具原生与无头测试,不改变历史完整验收状态。 Viva 2026-11-16:Build 页每个工具改为一个下拉框,默认回显当前选择(未固定时为“自动(实际目录)”),列出识别到的其他安装、已保存固定值和已校验目录;选“自定义…”才显示目录输入、浏览和“使用此目录”,校验通过后该目录成为列表项并被选中。无版本的安装不可选,在列表下以说明文字列出。自动化:TestToolchainListShowsAutomaticAndHidesTheDirectoryUntilCustom 及原有草稿/保存/冲突用例;截图 TestVisualSettings/33-settings-toolchains、m44-toolchain-directory-menu、m45-toolchain-custom-directory。原生验收仍 pending。 Viva 2026-11-16(#2032):toolchains.candidates 改为同时接收宿主找到的 PATH 命令所在目录(commandHomes),JAVA_HOME 等声明变量和 PATH 上的安装校验通过后以 host:shell 并入安装列表并按规范目录去重,新建项目的工具选择、设置页和运行配置因此能选到只配置在 PATH 或环境变量上的 JDK;自动层的选择不变。Core 回归 toolchain_candidates_offer_shell_homes_that_no_discovery_scan_covers(Lithe-core-rust#67),宿主回归 TestShellHomesAreInstallationsWithoutADiscoveryScan;两者都确认修复前失败。Windows 0.8.0 实机复现了缺陷,修复后的完整 Windows 客户端尚未实机验收,状态保持 pending。", "legacy": { "revision": "5a54c41aa37a4e6e6b68918a4b05765b9dd07a36", "macos": {