Fix: Handle non-zero exit codes and capture stdout in fromPathString - #181
Open
Nightwing-007 wants to merge 3 commits into
Open
Fix: Handle non-zero exit codes and capture stdout in fromPathString#181Nightwing-007 wants to merge 3 commits into
Nightwing-007 wants to merge 3 commits into
Conversation
Previously, build commands running through fromPathString ignored the exit code. If a compiler (like MSVC) output its diagnostics to stdout instead of stderr, the build was treated as successful. This fix explicitly checks the exit code and folds the captured stdout into the ProcessRunnerErr.RuntimeErr to display the actual compiler errors to the user.
|
Codecov Report❌ Patch coverage is
... and 8 files with indirect coverage changes 🚀 New features to boost your workflow:
|
- Added Mockito dependency to build.gradle.kts - Created TwoStepProcessFactoryTest to verify runtime error generation and stdout capture for both empty and populated compiler outputs. - This resolves the 0% patch coverage reported by Codecov.
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.
Replaces PR #179.
Description
This PR fixes a silent build failure bug where
fromPathStringwas not checking the build's exit code.Previously, if a compiler (such as MSVC) failed but wrote its diagnostic errors to
stdoutinstead ofstderr,ProcessRunnerwould not throw an exception. The system treated the build as successful and would attempt to run a missing or stale binary.Changes Made
result.exitCode != 0insideTwoStepProcessFactory.kt.stdoutoutput and folded it directly into theProcessRunnerErr.RuntimeErrmessage.stderrwarnings.