[local-build-plugin][build-tools][eas-build-job] copy Xcode build logs to target destination on local iOS build failure to simplify debuging#447
Draft
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @szdziedzic and the rest of your teammates on |
Comment on lines
+35
to
+40
| ): artifactSpec is TSpec & { type: ManagedArtifactType } => { | ||
| if (Object.values(ManagedArtifactType).includes(artifactSpec.type as ManagedArtifactType)) { | ||
| return true; | ||
| } | ||
| return false; | ||
| }; |
Contributor
There was a problem hiding this comment.
): artifactSpec is TSpec & { type: ManagedArtifactType } => Object.values(ManagedArtifactType).includes(artifactSpec.type as ManagedArtifactType)
?
radoslawkrzemien
approved these changes
Oct 15, 2024
sjchmiela
reviewed
Oct 17, 2024
…s to target destination on local iOS build failure to simplify debuging
73b604c to
b14f074
Compare
sjchmiela
approved these changes
Oct 22, 2024
| if (isManagedArtifact(artifact)) { | ||
| if ( | ||
| artifact.type === ManagedArtifactType.XCODE_BUILD_LOGS && | ||
| artifact.runStatus !== 'errored' |
Contributor
There was a problem hiding this comment.
Would it make sense to just always upload Xcode build logs? It would simplify code greatly (no tracking of runStatus, uploading artifact in finally)
Contributor
Author
There was a problem hiding this comment.
Maybe it would. Would it be ok for you as a user if they were always uploaded for you local builds (copied to project dir) 🤔
| l?.info({ phase: 'PREPARE_ARTIFACTS' }, `Writing application archive to ${destPath}`); | ||
| } else if (artifactType === ManagedArtifactType.BUILD_ARTIFACTS) { | ||
| l?.info({ phase: 'PREPARE_ARTIFACTS' }, `Writing build artifacts to ${destPath}`); | ||
| } else { |
Contributor
There was a problem hiding this comment.
Prefer switch over enums. This way if we add more managed types we won't forget to add handling.
| ? `build-${Date.now()}${suffix}` | ||
| : artifactType === ManagedArtifactType.BUILD_ARTIFACTS | ||
| ? `artifacts-${Date.now()}${suffix}` | ||
| : `xcode-logs-${Date.now()}${suffix}`; |
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.

Why
Usually, the most useful info for iOS build failures is present within Xcode build logs. They are always uploaded for cloud builds and are easy to access there. When it comes to local builds they are not copied to the target destination by default and are deleted together with temp working dir. One needs to use
EAS_LOCAL_BUILD_SKIP_CLEANUP=1to prevent this behavior in the next build and inspect Xcode logs then, to be able to learn what happened.This seems unintuitive for some users who think
RUN_FASTLANElogs are the source of truth. It's also kind of inconvenient.How
When the iOS local build fails always move Xcode logs to the target destination to save users work and make it easier to see the root cause of an issue.
Test Plan
Test locally.