Repository navigation
Compute the exit status of tsc -b for the whole build - #65719
Open
Unalivin (unalivin) wants to merge 1 commit into
Open
Unalivin (unalivin) wants to merge 1 commit into
Unalivin (unalivin) wants to merge 1 commit into
Conversation
Build mode reported the largest exit status of any single project. For a build whose only project has a type error that gives DiagnosticsPresent_OutputsGenerated (2), where TypeScript 6 gives DiagnosticsPresent_OutputsSkipped (1). The old numbering happened to produce 1 here until 9222c13 fixed the swapped constants. The rule TypeScript 6 uses for the build as a whole was never ported, so the result changed with the constants. TypeScript 6 reports OutputsGenerated for a build only if at least one project was built without diagnostics. Do the same: record whether each task reported diagnostics, count the projects that were built without any, and when the build ends with a diagnostics status, choose between OutputsGenerated and OutputsSkipped based on that count. Other statuses and tsc -p are not affected. The build mode baselines now record OutputsSkipped where no project was built cleanly, and the two content mapper expectations that run in build mode follow. Fixes microsoft#65668
Author
|
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the build-wide exit-status change.
No open issues 🎉
What changed in this PR
This PR addresses #65668 by computing tsc -b exit status across the whole build, restoring TypeScript 6 behavior while leaving tsc -p unchanged.
Changes:
- Tracks diagnostics per build task and counts projects completed without diagnostics.
- Selects the build’s diagnostic exit status based on whether any project completed successfully.
- Adds exit-status regression tests and updates build-mode expectations and baselines.
| File | Description |
|---|---|
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/target-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/source-edit-after-changing-stripInternal-incremental.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/rewriteRelativeImportExtensions-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/resolvePackageJsonImports-unset-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/resolvePackageJsonImports-unset-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/resolvePackageJsonImports-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/resolvePackageJsonImports-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/reactNamespace-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/preserveConstEnums-namespace-order-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/preserveConstEnums-namespace-merge-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/paths-unset-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/paths-unset-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/paths-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/paths-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/noLib-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/moduleResolution-unset-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/moduleResolution-unset-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/moduleResolution-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/moduleResolution-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/moduleDetection-ambient-module-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/module-top-level-await-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/module-import-attributes-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/module-import-attributes-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/inherited-paths-base-second-to-first-incremental.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/inherited-paths-base-first-to-second-incremental.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/importHelpers-incremental-direction-0.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsc/compilerOptionChanges/allowArbitraryExtensions-incremental-direction-1.js |
Updates forced-build exit status. |
tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js |
Updates watch-build error status. |
tsc/testdata/baselines/reference/tsbuildWatch/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js |
Updates watch-build error status. |
tsc/testdata/baselines/reference/tsbuildWatch/programUpdates/works-when-noUnusedParameters-changes-to-false.js |
Updates watch-build error status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors.js |
Updates syntax-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental.js |
Updates incremental syntax-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/syntax-errors-with-incremental-as-modules.js |
Updates module syntax-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors.js |
Updates semantic-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental.js |
Updates incremental semantic-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/semantic-errors-with-incremental-as-modules.js |
Updates module semantic-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors.js |
Updates declaration-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental.js |
Updates incremental declaration-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/noEmit/dts-errors-with-incremental-as-modules.js |
Updates module declaration-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/moduleResolution/build-mode-watches-missing-package-json-lookups.js |
Updates resolution-error watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/demo/updates-with-bad-reference.js |
Updates bad-reference watch status. |
tsc/testdata/baselines/reference/tsbuildWatch/configFileErrors/reports-syntax-errors-in-config-file.js |
Updates config-error watch status. |
tsc/testdata/baselines/reference/tsbuild/sample/when-target-option-changes.js |
Updates target-change build status. |
tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors.js |
Updates stopped-build exit statuses. |
tsc/testdata/baselines/reference/tsbuild/sample/skips-builds-downstream-projects-if-upstream-projects-have-errors-with-stopBuildOnErrors-when-test-does-not-reference-core.js |
Updates stopped-build exit statuses. |
tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js |
Updates missing-input build status. |
tsc/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js |
Updates missing-input forced-build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/sourcemap-non-composite.js |
Updates JSON-module build statuses. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-with-json-without-rootDir-but-outside-configDirectory-non-composite.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/include-only-non-composite.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-non-composite.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/include-of-json-along-with-other-include-and-file-name-matches-ts-file-non-composite.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/include-and-files-non-composite.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/importing-json-module-from-project-reference.js |
Updates referenced JSON-module build statuses. |
tsc/testdata/baselines/reference/tsbuild/resolveJsonModule/files-containing-json-file-non-composite.js |
Updates JSON-module build status. |
tsc/testdata/baselines/reference/tsbuild/projectReferenceWithRootDirInParent/reports-error-for-same-tsbuildinfo-file.js |
Updates repeated-build error status. |
tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir.js |
Updates root-directory error statuses. |
tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-specified-but-not-all-files-belong-to-rootDir-and-is-composite.js |
Updates composite root-directory error statuses. |
tsc/testdata/baselines/reference/tsbuild/outputPaths/when-rootDir-is-not-specified.js |
Updates output-path error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/syntax-errors.js |
Updates syntax-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental.js |
Updates incremental syntax-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/syntax-errors-with-incremental-as-modules.js |
Updates module syntax-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/semantic-errors.js |
Updates semantic-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental.js |
Updates incremental semantic-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/semantic-errors-with-incremental-as-modules.js |
Updates module semantic-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors.js |
Updates declaration-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental.js |
Updates incremental declaration-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-incremental-as-modules.js |
Updates module declaration-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes.js |
Updates declaration-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-multiple-files.js |
Updates multifile declaration-error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental.js |
Updates incremental declaration-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/dts-errors-with-declaration-enable-changes-with-incremental-as-modules.js |
Updates module declaration-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental.js |
Updates incremental emit-transition error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-incremental-declaration.js |
Updates declaration emit-transition error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/changes-with-initial-noEmit-composite.js |
Updates composite emit-transition error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental.js |
Updates incremental emit-transition error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/changes-incremental-declaration.js |
Updates declaration emit-transition error statuses. |
tsc/testdata/baselines/reference/tsbuild/noEmit/changes-composite.js |
Updates composite emit-transition error statuses. |
tsc/testdata/baselines/reference/tsbuild/noCheck/syntax-errors.js |
Updates syntax-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noCheck/syntax-errors-with-incremental.js |
Updates incremental syntax-error build statuses. |
tsc/testdata/baselines/reference/tsbuild/noCheck/semantic-errors.js |
Updates checked-build semantic-error statuses. |
tsc/testdata/baselines/reference/tsbuild/noCheck/semantic-errors-with-incremental.js |
Updates incremental semantic-error statuses. |
tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors.js |
Updates checked-build error statuses. |
tsc/testdata/baselines/reference/tsbuild/noCheck/dts-errors-with-incremental.js |
Updates incremental checked-build error statuses. |
tsc/testdata/baselines/reference/tsbuild/moduleResolution/type-reference-resolution-uses-correct-options-for-different-resolution-options-referenced-project.js |
Updates type-resolution build status. |
tsc/testdata/baselines/reference/tsbuild/javascriptProjectEmit/loads-js-based-projects-and-emits-them-correctly.js |
Updates JavaScript-project build status. |
tsc/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/reports-errors-in-files-affected-by-change-in-signature-with-isolatedModules.js |
Updates transitive-type error statuses. |
tsc/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module.js |
Updates transitive-type error statuses. |
tsc/testdata/baselines/reference/tsbuild/inferredTypeFromTransitiveModule/inferred-type-from-transitive-module-with-isolatedModules.js |
Updates isolated-module error statuses. |
tsc/testdata/baselines/reference/tsbuild/incremental/reverse-mapped-declaration-consumption.js |
Updates repeated-build error statuses. |
tsc/testdata/baselines/reference/tsbuild/fileDelete/deleted-file-without-composite.js |
Updates deleted-file build status. |
tsc/testdata/baselines/reference/tsbuild/exactOptionalPropertyTypes/declaration-emit-when-exactOptionalPropertyTypes-changes-from-false-to-true.js |
Updates repeated-build error statuses. |
tsc/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-non-circular-imports-project-with-emitDeclarationOnly.js |
Updates declaration-only build statuses. |
tsc/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly.js |
Updates circular-import build statuses. |
tsc/testdata/baselines/reference/tsbuild/emitDeclarationOnly/only-dts-output-in-circular-import-project-with-emitDeclarationOnly-and-declarationMap.js |
Updates declaration-map build statuses. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-missing-dependency-package-json-is-added.js |
Updates dependency-addition error status. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-dependency-package-json-redirects-to-a-different-declaration-file.js |
Updates dependency-redirection error status. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-dependency-in-node_modules-is-updated.js |
Updates dependency-change error statuses. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-when-absolute-non-root-dependency-is-updated.js |
Updates external-dependency error status. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-transitive-dependents-when-dependency-update-batch-includes-a-global-scope-change.js |
Updates global-change rebuild statuses. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-transitive-dependents-when-dependency-update-batch-has-no-global-scope-change.js |
Updates transitive-dependency error status. |
tsc/testdata/baselines/reference/tsbuild/dependencyUpdate/rebuilds-files-using-globals-when-global-scope-dependency-is-updated.js |
Updates global-dependency error status. |
tsc/testdata/baselines/reference/tsbuild/demo/in-master-branch-with-everything-setup-correctly-and-reports-no-error.js |
Updates demo build error statuses. |
tsc/testdata/baselines/reference/tsbuild/demo/in-circular-is-set-in-the-reference.js |
Updates circular-reference build status. |
tsc/testdata/baselines/reference/tsbuild/demo/in-bad-ref-branch-reports-the-error-about-files-not-in-rootDir-at-the-import-location.js |
Updates bad-reference build status. |
tsc/testdata/baselines/reference/tsbuild/contentMapperOptionDiagnostics/rebuild-to-report-mapper-option-diagnostics.js |
Updates mapper-diagnostic build statuses. |
tsc/testdata/baselines/reference/tsbuild/configFileErrors/when-tsconfig-extends-the-missing-file.js |
Updates missing-config build status. |
tsc/testdata/baselines/reference/tsbuild/configFileErrors/reports-syntax-errors-in-config-file.js |
Updates config-syntax error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/target-build-direction-1.js |
Updates target-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/target-build-direction-0.js |
Updates target-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/source-edit-after-changing-stripInternal-build.js |
Updates post-option-edit error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/rewriteRelativeImportExtensions-build-direction-1.js |
Updates import-extension error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/rewriteRelativeImportExtensions-build-direction-0.js |
Updates import-extension error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/resolvePackageJsonImports-unset-build-direction-1.js |
Updates package-import error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/resolvePackageJsonImports-unset-build-direction-0.js |
Updates package-import error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/resolvePackageJsonImports-build-direction-1.js |
Updates package-import error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/resolvePackageJsonImports-build-direction-0.js |
Updates package-import error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/reactNamespace-build-direction-1.js |
Updates JSX namespace error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/reactNamespace-build-direction-0.js |
Updates JSX namespace error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/preserveConstEnums-namespace-order-build-direction-1.js |
Updates namespace-order error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/preserveConstEnums-namespace-order-build-direction-0.js |
Updates namespace-order error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/preserveConstEnums-namespace-merge-build-direction-1.js |
Updates namespace-merge error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/preserveConstEnums-namespace-merge-build-direction-0.js |
Updates namespace-merge error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/paths-unset-build-direction-1.js |
Updates path-mapping error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/paths-unset-build-direction-0.js |
Updates path-mapping error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/paths-build-direction-1.js |
Updates path-mapping error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/paths-build-direction-0.js |
Updates path-mapping error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/noLib-build-direction-1.js |
Updates library-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/noLib-build-direction-0.js |
Updates library-option error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/moduleResolution-unset-build-direction-1.js |
Updates module-resolution error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/moduleResolution-unset-build-direction-0.js |
Updates module-resolution error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/moduleResolution-build-direction-1.js |
Updates module-resolution error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/moduleResolution-build-direction-0.js |
Updates module-resolution error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/moduleDetection-ambient-module-build-direction-1.js |
Updates ambient-module error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/moduleDetection-ambient-module-build-direction-0.js |
Updates ambient-module error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/module-top-level-await-build-direction-1.js |
Updates top-level-await error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/module-top-level-await-build-direction-0.js |
Updates top-level-await error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/module-import-attributes-build-direction-1.js |
Updates import-attribute error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/module-import-attributes-build-direction-0.js |
Updates import-attribute error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/inherited-paths-base-second-to-first-build.js |
Updates inherited-path error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/inherited-paths-base-first-to-second-build.js |
Updates inherited-path error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/importHelpers-build-direction-1.js |
Updates helper-import error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/importHelpers-build-direction-0.js |
Updates helper-import error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/allowArbitraryExtensions-build-direction-1.js |
Updates arbitrary-extension error statuses. |
tsc/testdata/baselines/reference/tsbuild/compilerOptionChanges/allowArbitraryExtensions-build-direction-0.js |
Updates arbitrary-extension error statuses. |
tsc/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration.js |
Updates repeated declaration-only build statuses. |
tsc/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-on-commandline-with-declaration-and-incremental.js |
Updates incremental declaration-only build statuses. |
tsc/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration.js |
Updates emit-option build error statuses. |
tsc/testdata/baselines/reference/tsbuild/commandLine/emitDeclarationOnly-false-on-commandline-with-declaration-and-incremental.js |
Updates incremental emit-option error statuses. |
tsc/internal/execute/tsctests/tscbuild_test.go |
Adds five exit-status regression cases. |
tsc/internal/execute/tsctests/contentmapper_watch_test.go |
Adjusts build-mode diagnostic expectations. |
tsc/internal/execute/build/orchestrator.go |
Computes diagnostic exit status for the whole build. |
tsc/internal/execute/build/buildtask.go |
Tracks task diagnostics and counts successful projects. |
Review effort: Balanced
This branch has not been deployed
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.
Fixes #65668.
tsc -bexits with 2 (DiagnosticsPresent_OutputsGenerated) when a project has a type error. TypeScript 6 exits with 1 (DiagnosticsPresent_OutputsSkipped) for the same project, whiletsc -pexits with 2 in both:Build mode used the largest exit status of the individual projects. For the case above that gave 1 until 9222c13 fixed the swapped exit status constants, and 2 afterwards. TypeScript 6 doesn't decide this per project: a build is
DiagnosticsPresent_OutputsGeneratedonly if at least one project was built without diagnostics, andDiagnosticsPresent_OutputsSkippedotherwise.This does the same. Each build task now remembers whether it reported diagnostics, and the orchestrator counts the projects that were built without any. A project that had nothing to do isn't counted, which matches TypeScript 6. When the build ends with one of the two diagnostics statuses, it becomes
DiagnosticsPresent_OutputsGeneratedif that count is above zero andDiagnosticsPresent_OutputsSkippedotherwise. Every other status is left alone, andtsc -pdoesn't go through this code.Tests
New
TestBuildExitStatusForTypeErrorsintscbuild_test.go:--buildwith a type error givesOutputsSkipped--projectwith the same error still givesOutputsGenerated--buildsucceedsOutputsGeneratedOutputsSkippedTwo expectations in
contentmapper_watch_test.gothat run in build mode now expectOutputsSkippedas well.The rest of the diff is baselines: 150 files (108 under
tsbuild, 15 undertsbuildWatch, 27 undertsc) where only theExitStatus::line changes fromDiagnosticsPresent_OutputsGeneratedtoDiagnosticsPresent_OutputsSkipped. Every one of those lines belongs to a--buildcommand, so notsc -pbaseline moved.go test ./internal/execute/...passes with them.Compared with TypeScript 6.0.3
I ran
typescript@6.0.3and a compiler built from this branch on ten small projects and compared the exit codes. They were the same in all ten:-band with-p-brun after an error-b --noEmitwith an error