New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve xcodebuild output hangs #2297
Resolve xcodebuild output hangs #2297
Conversation
Hey @Jake-Prickett, thank you very much for contributing to the project. Few suggestions:
Moreover, I'd update the CHANGELOG to mention that we are fixing a known issue running |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Jake-Prickett. Thank you very much for contributing to the project.
@all-contributors add @Jake-Prickett for code |
@pepibumur I've put up a pull request to add @Jake-Prickett! π |
Thanks for the review @pepibumur and the tips! Up to date with the most recent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very solid work @Jake-Prickett π Thanks a lot for jumping on that π
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, found one small thing (maybe), thanks π
The unit tests seem to have failed, otherwise I think we are good to merge this |
To be honest, I'm not entirely sure what the problem is. π€ It seems as though the 11.5 one is the issue if I'm not mistaken? Which led me to thinking it could be a difference with how But when running locally (using both Xcode and command line) the tests that seem to fail/hang on CI pass without any issues on both Xcode 11.5 & Xcode 12.3. Running the test that hangs:
β tuist git:(resolve-xcodebuild-output-hangs) swift package clean
β tuist git:(resolve-xcodebuild-output-hangs) swift test --filter TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests
# ... compilation warnings, etc.
[1822/1822] Linking tuistPackageTests
Test Suite 'Selected tests' started at 2021-01-16 09:49:14.007
Test Suite 'tuistPackageTests.xctest' started at 2021-01-16 09:49:14.007
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' started at 2021-01-16 09:49:14.007
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_iOS_framework]' started.
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_iOS_framework]' passed (7.622 seconds).
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' passed at 2021-01-16 09:49:21.630.
Executed 1 test, with 0 failures (0 unexpected) in 7.622 (7.623) seconds
Test Suite 'tuistPackageTests.xctest' passed at 2021-01-16 09:49:21.630.
Executed 1 test, with 0 failures (0 unexpected) in 7.622 (7.623) seconds
Test Suite 'Selected tests' passed at 2021-01-16 09:49:21.630.
Executed 1 test, with 0 failures (0 unexpected) in 7.622 (7.624) seconds
Test Suite 'Selected tests' started at 2021-01-16 09:49:21.707
Test Suite 'tuistPackageTests.xctest' started at 2021-01-16 09:49:21.708
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' started at 2021-01-16 09:49:21.708
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_macOS_framework]' started.
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_macOS_framework]' passed (3.211 seconds).
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' passed at 2021-01-16 09:49:24.919.
Executed 1 test, with 0 failures (0 unexpected) in 3.211 (3.212) seconds
Test Suite 'tuistPackageTests.xctest' passed at 2021-01-16 09:49:24.919.
Executed 1 test, with 0 failures (0 unexpected) in 3.211 (3.212) seconds
Test Suite 'Selected tests' passed at 2021-01-16 09:49:24.919.
Executed 1 test, with 0 failures (0 unexpected) in 3.211 (3.212) seconds
Test Suite 'Selected tests' started at 2021-01-16 09:49:24.970
Test Suite 'tuistPackageTests.xctest' started at 2021-01-16 09:49:24.970
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' started at 2021-01-16 09:49:24.970
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_tvOS_framework]' started.
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_tvOS_framework]' passed (5.788 seconds).
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' passed at 2021-01-16 09:49:30.759.
Executed 1 test, with 0 failures (0 unexpected) in 5.788 (5.789) seconds
Test Suite 'tuistPackageTests.xctest' passed at 2021-01-16 09:49:30.759.
Executed 1 test, with 0 failures (0 unexpected) in 5.788 (5.789) seconds
Test Suite 'Selected tests' passed at 2021-01-16 09:49:30.759.
Executed 1 test, with 0 failures (0 unexpected) in 5.788 (5.790) seconds
Test Suite 'Selected tests' started at 2021-01-16 09:49:30.830
Test Suite 'tuistPackageTests.xctest' started at 2021-01-16 09:49:30.831
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' started at 2021-01-16 09:49:30.831
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_watchOS_framework]' started.
Test Case '-[TuistKitIntegrationTests.CacheXCFrameworkBuilderIntegrationTests test_build_when_watchOS_framework]' passed (6.366 seconds).
Test Suite 'CacheXCFrameworkBuilderIntegrationTests' passed at 2021-01-16 09:49:37.198.
Executed 1 test, with 0 failures (0 unexpected) in 6.366 (6.367) seconds
Test Suite 'tuistPackageTests.xctest' passed at 2021-01-16 09:49:37.198.
Executed 1 test, with 0 failures (0 unexpected) in 6.366 (6.367) seconds
Test Suite 'Selected tests' passed at 2021-01-16 09:49:37.198.
Executed 1 test, with 0 failures (0 unexpected) in 6.366 (6.368) seconds Any suggestions on how to approach this one? It looks like the run was stuck for ~3 hours, I don't want to eat up CI resources for that long π€― |
Update:I'm able to run the Unit Tests locally on both Xcode 11.5 and 12.3 without having any issues. Additionally, when running the Acceptance Tests (leveraging It doesn't look to be related to |
I'm looking into this one |
@Jake-Prickett I moved your work to this PR so that I can debug and push a fix to the branch. I also invited you to the organization so that you can push to remote without having to fork the repo. |
Thank you @pepibumur! π I'll continue debugging on my end as well! |
Resolves #2250
Request for comments document (if applies):
Short description π
Initial attempt at resolving the issue! π
Currently when calling
tuist test
ortuist build
, during compilation the output hangs indefinitely when a warning or error is encountered. The reason being, the libraryxcbeautify
leveraged to format thexcodebuild
output was designed to have output piped into it (as opposed to calling the format methods explicitly from the library). With this design, the Library callsreadLine()
when an error or warning is encountered to consume and format a bit more information about the error/warning - because Tuist does not pipe the output,readLine()
hangs indefinitely waiting for input fromstdin
.Solution
Rather than format each line individually, leverage Foundation
Process
andPipe
to Pipe output fromxcodebuild
intoxcbeautify
.Changes
xcbeautify
as a dependency from the projectRakefile
to pull in the repository and build the binary version ofxcbeautify
xcbeautify
binary to theBinaryLocator
Parsing
class to be aFormatter
class that provides arguments for thexcbeautify
command.XcodeBuildController
- when running a command, we now need to know if we should pipe the output through the formatter.isVerbose
from the current environmentSystem
- Created additional method to enable passing a second set of Arguments to pipe the output from the first Argument to.Foundation.Process
vs.swift-tools-support-core
s ThreadXcodeBuildOutput
to now only have a raw string, this is due to the fact that we no longer have access to both the formatted version and the raw version at the same time.TODO:
Checklist β
CHANGELOG.md
has been updated to reflect the changes. In case of a breaking change, it's been flagged as such.