Fix package command returning exit code 0 on build failure#76
Draft
shanerbaner82 wants to merge 1 commit intomainfrom
Draft
Fix package command returning exit code 0 on build failure#76shanerbaner82 wants to merge 1 commit intomainfrom
shanerbaner82 wants to merge 1 commit intomainfrom
Conversation
The native:package command returned void from handle(), causing the process to always exit 0 even when builds failed. This caused CI systems (Bifrost) to report successful builds when Gradle silently failed and produced no output file. Three fixes: - handle() returns int (1 on error, 0 on success) - buildAndroid() returns bool and checks handleBuildArtifacts() result - Gradle output streams to stdout in --no-tty mode via process callback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
handle()returnedvoid, sonative:packagealways exited with code 0 — even when Gradle failed or no output file was produced. CI (Bifrost) had no way to detect build failures via exit code.--no-ttymode becauseProcess::run()captured stdout but nothing printed it — builds appeared to hang then silently succeed.handleBuildArtifacts()returningnull(no AAB/APK found) was never checked — the command printed "Signed bundle build complete" regardless.Changes
handle()returnsint(1 on error, 0 on success)buildAndroid()returnsboolsohandle()can propagate failurehandleBuildArtifacts()returns null, error and return falseProcess::run()so Gradle output streams in real-time during--no-ttybuildsTest plan
php artisan native:package android --build-type=bundle --no-tty— confirm Gradle output streams to terminal