fix: exit nonzero when a circuit fails to build correctly - #4718
Closed
billythompsons wants to merge 8 commits into
Closed
fix: exit nonzero when a circuit fails to build correctly#4718billythompsons wants to merge 8 commits into
billythompsons wants to merge 8 commits into
Conversation
Author
|
Closing - #4715 landed just before this and covers the same ground (exit 1 on circuit errors, artifacts retained, failed circuits not counted as passed). Thanks! |
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 #4707.
Problem
tsci buildprinted "Build completed with errors" yet exited 0 and counted the circuit as passed when the circuit itself failed to build - e.g. a trace targeting a nonexistent component (source_trace_not_connected_error). CI cannot detect the invalid design from the process status.Fix
The build now distinguishes an invalid circuit from DRC violations on an otherwise valid one:
circuit-json-diagnosticsgainsisCircuitFailureError, currently matchingsource_trace_not_connected_error: a trace endpoint that resolves to no existing port is an invalid design, never a legitimate partial build.buildFile(and the build worker) reporthasCircuitErrorswhen such an error is present (respecting--ignore-errors, after DRC ignore-category filtering).tsci buildexits 1 when any circuit has a circuit failure (fatal errors still always exit 1), and failed circuits are no longer counted as passed in the summary.Deliberately scoped narrow: routing failures like
pcb_trace_missing_errorstay exit 0 because valid simulation/partial circuits can legitimately leave traces unrouted (covered by the existingbuild-output-flagssimulation tests, which pass unchanged). DRC violations (e.g.pcb_component_outside_board_error) also stay exit 0, as do warnings. Happy to extend the failure set in a follow-up if you want routing failures included.Tests
build-exit-code-circuit-errors.test.ts: the issue's exact repro (trace to a nonexistent component) exits 1 with "0 passed / 1 failed"; with--ignore-errorsexits 0.build-with-drc-error,build-with-ignore-error,build-ignore-drc-categories,build-ignore-placement-drc-routes,build-output-flags.