diff --git a/Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md b/Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md index fb0b0d77ec..cbb621587c 100644 --- a/Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md +++ b/Packages/src/Editor/CliOnlyTools~/Launch/Skill/SKILL.md @@ -23,7 +23,6 @@ uloop launch [project-path] [options] | `project-path` | string | Optional. Use only when the target Unity project is not in the current directory. | | `-r, --restart` | flag | Kill running Unity and restart | | `-q, --quit` | flag | Kill an existing Unity process for the project without launching | -| `-i, --ignore-compiler-errors` | flag | Continue opening Unity even when the project has compiler errors | | `--editor-version ` | string | Use this Unity Editor version instead of ProjectVersion.txt | | `-p, --platform

` | string | Build target (e.g., StandaloneOSX, Android, iOS) | | `--max-depth ` | number | Search depth when project-path is omitted (default: 3, -1 for unlimited) | @@ -43,9 +42,6 @@ uloop launch -r # Launch with build target uloop launch -p Android -# Launch even when the project has compiler errors -uloop launch -i - # Launch with a specific installed Editor version uloop launch --editor-version 6000.0.0f1 @@ -76,6 +72,6 @@ The final JSON payload includes: - If Unity is already running, focuses the existing window and verifies tool readiness - If process scan is blocked (e.g. sandboxed `ps`), plain launch falls back to IPC probing; `--restart` and `--quit` still fail because they need the process id -- `-i, --ignore-compiler-errors` only affects new Unity processes; it has no effect when reusing an already-running Editor +- New Unity processes ignore project compiler errors during Editor startup by default when run by dispatcher 3.0.1-beta.8 or newer; run `uloop update` first if an older dispatcher is installed - `--editor-version` only affects new Unity processes; use it with `--restart` to replace an already-running Editor - The command waits until Unity finishes startup and the CLI can connect before returning diff --git a/cli/dispatcher-contract.json b/cli/dispatcher-contract.json index 754305f658..a99c6b77df 100644 --- a/cli/dispatcher-contract.json +++ b/cli/dispatcher-contract.json @@ -1,5 +1,5 @@ { "schemaVersion": 1, - "dispatcherVersion": "3.0.1-beta.7", + "dispatcherVersion": "3.0.1-beta.8", "dispatcherContractVersion": 1 } diff --git a/cli/internal/cli/completion_options.go b/cli/internal/cli/completion_options.go index 436057c884..7c0c397da4 100644 --- a/cli/internal/cli/completion_options.go +++ b/cli/internal/cli/completion_options.go @@ -6,12 +6,10 @@ var nativeCommandOptions = map[string][]string{ "--" + projectPathFlagName, "--delete-recovery", "--editor-version", - "--ignore-compiler-errors", "--max-depth", "--platform", "--quit", "--restart", - "-i", }, installCommandName: {"--" + installDirFlagName}, updateCommandName: {"--" + updateToVersionFlagName}, diff --git a/cli/internal/cli/completion_test.go b/cli/internal/cli/completion_test.go index 03a8305862..8c43342e97 100644 --- a/cli/internal/cli/completion_test.go +++ b/cli/internal/cli/completion_test.go @@ -189,11 +189,16 @@ func TestCompletionListOptionsUsesNativeLaunchOptions(t *testing.T) { output := stdout.String() listedOptions := strings.Split(strings.TrimSpace(output), "\n") - for _, option := range []string{"--project-path", "--restart", "--quit", "--delete-recovery", "--platform", "--max-depth", "-i", "--ignore-compiler-errors", "--editor-version"} { + for _, option := range []string{"--project-path", "--restart", "--quit", "--delete-recovery", "--platform", "--max-depth", "--editor-version"} { if !slices.Contains(listedOptions, option) { t.Fatalf("launch option %s was not listed: %s", option, output) } } + for _, option := range []string{"-i", "--ignore-compiler-errors"} { + if slices.Contains(listedOptions, option) { + t.Fatalf("removed launch option %s was listed: %s", option, output) + } + } } func TestCompletionListOptionsUsesNativeUpdateOptions(t *testing.T) { diff --git a/cli/internal/cli/dispatcher_test.go b/cli/internal/cli/dispatcher_test.go index 924f112103..15d951b579 100644 --- a/cli/internal/cli/dispatcher_test.go +++ b/cli/internal/cli/dispatcher_test.go @@ -172,7 +172,7 @@ func TestRunDispatcherLaunchOptionsDoNotRequireProjectPin(t *testing.T) { var stderr bytes.Buffer code := RunDispatcher( context.Background(), - []string{"launch", "-i", "--editor-version", "6000.0.0f1", projectRoot, "--quit"}, + []string{"launch", "--editor-version", "6000.0.0f1", projectRoot, "--quit"}, &stdout, &stderr) diff --git a/cli/internal/cli/help_test.go b/cli/internal/cli/help_test.go index b81f2d7a69..30afb6da76 100644 --- a/cli/internal/cli/help_test.go +++ b/cli/internal/cli/help_test.go @@ -241,7 +241,7 @@ func TestRunProjectLocalLaunchHelpShowsGlobalOptions(t *testing.T) { for _, expected := range []string{ "Usage:", "uloop launch [options] [project-path]", - "-i, --ignore-compiler-errors", + "Compiler errors are ignored by default during Unity startup.", "--editor-version ", "Global options:", "--project-path ", @@ -250,6 +250,11 @@ func TestRunProjectLocalLaunchHelpShowsGlobalOptions(t *testing.T) { t.Fatalf("launch help missing %q:\n%s", expected, output) } } + for _, removed := range []string{"-i, --ignore-compiler-errors", "--ignore-compiler-errors"} { + if strings.Contains(output, removed) { + t.Fatalf("launch help still includes removed option %q:\n%s", removed, output) + } + } } // Tests that first-party tool help is available without Unity project resolution. diff --git a/cli/internal/cli/launch.go b/cli/internal/cli/launch.go index 6f29ce3d42..b563f85e91 100644 --- a/cli/internal/cli/launch.go +++ b/cli/internal/cli/launch.go @@ -43,14 +43,13 @@ var ( var editorVersionPattern = regexp.MustCompile(`(?m)^m_EditorVersion:\s*(.+)$`) type launchOptions struct { - projectPath string - restart bool - quit bool - deleteRecovery bool - ignoreCompilerErrors bool - editorVersion string - platform string - maxDepth int + projectPath string + restart bool + quit bool + deleteRecovery bool + editorVersion string + platform string + maxDepth int } func tryHandleLaunchRequest( @@ -297,9 +296,7 @@ func buildUnityLaunchArgs(projectRoot string, options launchOptions) []string { if options.platform != "" { launchArgs = append(launchArgs, "-buildTarget", options.platform) } - if options.ignoreCompilerErrors { - launchArgs = append(launchArgs, "-ignorecompilererrors") - } + launchArgs = append(launchArgs, "-ignorecompilererrors") return launchArgs } @@ -478,12 +475,12 @@ func printLaunchHelp(stdout io.Writer) { writeLine(stdout, " -r, --restart Kill an existing Unity process for the project before launching") writeLine(stdout, " -q, --quit Kill an existing Unity process for the project without launching") writeLine(stdout, " -d, --delete-recovery Delete Assets/_Recovery before launch") - writeLine(stdout, " -i, --ignore-compiler-errors") - writeLine(stdout, " Continue opening Unity even when the project has compiler errors") writeLine(stdout, " --editor-version ") writeLine(stdout, " Use this Unity Editor version instead of ProjectVersion.txt") writeLine(stdout, " -p, --platform Pass Unity -buildTarget when launching") writeLine(stdout, " --max-depth Accepted for compatibility when searching from the current directory") writeLine(stdout, "") + writeLine(stdout, "Compiler errors are ignored by default during Unity startup.") + writeLine(stdout, "") printGlobalOptionsHelp(stdout) } diff --git a/cli/internal/cli/launch_options.go b/cli/internal/cli/launch_options.go index 9621a2479e..50ba455333 100644 --- a/cli/internal/cli/launch_options.go +++ b/cli/internal/cli/launch_options.go @@ -17,9 +17,6 @@ func applyLaunchOption(options *launchOptions, args []string, index int) (int, e case arg == "-d" || arg == "--delete-recovery": options.deleteRecovery = true return index, nil - case arg == "-i" || arg == "--ignore-compiler-errors": - options.ignoreCompilerErrors = true - return index, nil case arg == "--editor-version" || strings.HasPrefix(arg, "--editor-version="): return applyLaunchEditorVersionOption(options, args, index) case isUnsupportedLaunchHubOption(arg): diff --git a/cli/internal/cli/launch_test.go b/cli/internal/cli/launch_test.go index 961e59b004..1e568984bd 100644 --- a/cli/internal/cli/launch_test.go +++ b/cli/internal/cli/launch_test.go @@ -22,7 +22,6 @@ func TestParseLaunchOptionsSupportsCoreFlags(t *testing.T) { []string{ "--restart", "--delete-recovery", - "--ignore-compiler-errors", "--editor-version", "6000.0.0f1", "--platform", "Android", "--max-depth", "-1", @@ -40,9 +39,6 @@ func TestParseLaunchOptionsSupportsCoreFlags(t *testing.T) { if !options.deleteRecovery { t.Fatal("delete recovery flag was not parsed") } - if !options.ignoreCompilerErrors { - t.Fatal("ignore compiler errors flag was not parsed") - } if options.editorVersion != "6000.0.0f1" { t.Fatalf("editor version mismatch: %s", options.editorVersion) } @@ -57,23 +53,29 @@ func TestParseLaunchOptionsSupportsCoreFlags(t *testing.T) { } } -func TestParseLaunchOptionsSupportsShortIgnoreCompilerErrorsFlag(t *testing.T) { - // Verifies -i is the short alias for --ignore-compiler-errors. - options, err := parseLaunchOptions([]string{"-i", "/tmp/project"}, "") - if err != nil { - t.Fatalf("parseLaunchOptions failed: %v", err) - } +func TestParseLaunchOptionsRejectsRemovedIgnoreCompilerErrorsFlags(t *testing.T) { + // Verifies removed compiler-error ignore flags no longer remain in the launch API. + for _, arg := range []string{"-i", "--ignore-compiler-errors"} { + _, err := parseLaunchOptions([]string{arg}, "") + if err == nil { + t.Fatalf("expected removed ignore compiler errors flag error for %s", arg) + } - if !options.ignoreCompilerErrors { - t.Fatal("short ignore compiler errors flag was not parsed") + var argErr *argumentError + if !errors.As(err, &argErr) { + t.Fatalf("expected argumentError for %s, got %T", arg, err) + } + if argErr.option != arg { + t.Fatalf("option mismatch for %s: %s", arg, argErr.option) + } } } -func TestBuildUnityLaunchArgsIncludesIgnoreCompilerErrors(t *testing.T) { - // Verifies launch maps --ignore-compiler-errors to Unity Editor's native startup argument. +func TestBuildUnityLaunchArgsIncludesIgnoreCompilerErrorsByDefault(t *testing.T) { + // Verifies every Unity launch ignores project compiler errors during Editor startup. args := buildUnityLaunchArgs( "/tmp/project", - launchOptions{platform: "Android", ignoreCompilerErrors: true}, + launchOptions{platform: "Android"}, ) expectedArgs := []string{ "-projectPath", @@ -88,6 +90,23 @@ func TestBuildUnityLaunchArgsIncludesIgnoreCompilerErrors(t *testing.T) { } } +func TestBuildUnityLaunchArgsIncludesIgnoreCompilerErrorsForRestart(t *testing.T) { + // Verifies restarted Unity launches use the same compiler-error ignore startup argument. + args := buildUnityLaunchArgs( + "/tmp/project", + launchOptions{restart: true}, + ) + expectedArgs := []string{ + "-projectPath", + "/tmp/project", + "-ignorecompilererrors", + } + + if !slices.Equal(args, expectedArgs) { + t.Fatalf("Unity launch args mismatch: got %#v want %#v", args, expectedArgs) + } +} + func TestParseLaunchOptionsSupportsEditorVersionEqualsValue(t *testing.T) { // Verifies --editor-version=value matches Unity CLI's value form. options, err := parseLaunchOptions([]string{"--editor-version=6000.0.1f1", "/tmp/project"}, "")