cpisciotta / xcbeautify Goto Github PK
View Code? Open in Web Editor NEWA little beautifier tool for xcodebuild
License: MIT License
A little beautifier tool for xcodebuild
License: MIT License
I see in Package.swift https://github.com/thii/xcbeautify/blob/master/Package.swift#L6 we specify macOS 10.14+? Can you lower the deployment target?
First I use xcodebuild
to build my project, duplicated symbols are displayed with full path:
ld: warning: duplicate symbol '_ZSTD_copyCCtx' in:
/Volumes/test_result/Build/Products/DailyBuild-iphonesimulator/XCFrameworkIntermediates/Btts/libbtts.a(zstd_compress.o)
/Volumes/est_result/Build/Products/DailyBuildiphonesimulator/XCFrameworkIntermediates/Diagnose/DefaultLogger/mars.framework/mars(zstd_compress.c.o)
I use xcbeautify
to filter my xcodebuild
logs like below:
set -o pipefail && xcodebuild build-for-testing -workspace xxx -quiet | xcbeautify -qq
❌ duplicate symbol '_ZSTD_copyCCtx' in
❌ duplicate symbol '_ZSTD_getCParams' in
Only symbol name is printed. That's not easy to findout where are the duplicated objects.
I think it is a bug.
Hi 👋
Would you accept a PR adding junit test report generation?
Context:
So the only thing available seems to be the test log. If the output of xcbeautify is reliable enough, generating a junit report from it may be a good alternative
We have thousands of tests and it's very difficult to see which one(s) failed when we encounter a failure. A summary at the end of the output with these failed tests would be incredibly helpful.
Is there a way to disable color codes for outputs that don't support it?
Thanks.
Hey there!
First of all, this project really seems promising. I've been using XCPretty for quite a while and I would love to replace it with a more up to date framework that is also more performant.
However, before I jump on that boat, I'd like to find out whether I can get to the same results as I want. We're currently using https://github.com/marcelofabri/xcpretty-json-formatter so we can use https://github.com/f-meloni/danger-swift-xcodesummary.
Is there any way to get to the same JSON result with xcbeautify? It allows us to parse the warnings, errors, and messages, to show them in Pull Requests.
Thanks!
👋
This may be a bit of a dumb question, but I cannot figure it out: how to pipe an already existing xcodebuild log to xcbeautify?
I tried this:
cat xcodebuild.log | xcbeautify
But it does not work, returns nothing
Origin log:
/Users/xxxxx/Example/Pods/Pods.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'XXPay' from project 'Pods')
/Users/xxxxx/Example/AAAA.xcodeproj: warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 9.0, but the range of supported deployment target versions is 11.0 to 16.0.99. (in target 'AAAA_Example' from project 'AAAA')
/Users/xxxxx/Example/AAAA.xcodeproj: error: The file "/Users/xxxxx/AAAA/Example/configs/domestic/ueaws/app.entitlements" could not be opened. Verify the value of the CODE_SIGN_ENTITLEMENTS build setting for target "AAAA_Example" is correct and that the file exists on disk. (in target 'AAAA_Example' from project 'AAAA')
But no error show me from xcbeautify
I am writing a package for compiling and running apps using Emacs and I pipe the output from xcodebuild to xcbeautify but Emacs wont recognize the errors when this tool adds warning/info and error emojis. Is it possible to disable them somehow for just when an error occurs?
The swift CLI on macOS prints to the error output, so swift test 2>&1 | xcbeautify
will work correctly.
Fastlane ships with xcpretty but when running tests in parallel, it doesnot create correct output. Hence we want to use xcbeautify with fastlane.
Is there any way we can use that with action run_tests? https://docs.fastlane.tools/actions/run_tests/
This was a weekend hack a few years ago to work around the parallel testing feature in Xcode 9 not being supported by xcpretty. Even though I don't use this anymore, it seems like there are still people that depends on it. I don't have time in maintaining this project for much longer, but also don't want to break anyone's builds. If you're interested in taking it over, please contact me.
When an error message is multiline, like this:
/redacted/path/to/file.swift:31: error: -[redacted.package.testfile testRedactedName] : failed: caught error: "code: 1, Error: code: 1, FAILURE: Build failed with an exception.
* What went wrong:
Some problems were found with the
multiple lines here
BUILD FAILED in 1s"
then xcbeautify output only displays:
Redacted
✖ testRedactedName, failed: caught error: "code: 1, Error: code: 1, FAILURE: Build failed with an exception.
Is it possible to add a command line options to display warnings or errors only? Because for a huge project, most of output "[XXX] Compiling YYY.cpp" are of less importance and they would hide real issues.
Errors in Storyboards are swallowed by xcbeautify. (I am use with Xcode12.4). For example: error: Did not find view controller with identifier "AccountPoint" in Home.storyboard, referenced from Dashboard.storyboard
I paste a part of my log (the 4th line is super long)
LinkStoryboards (in target 'MyBankIphone' from project 'MyBankIphone')
cd /Path/to/Project/apps/thebank/iphone/native
export XCODE_DEVELOPER_USR_PATH\=/Applications/Xcode12.4.app/Contents/Developer/usr/bin/..
/Applications/Xcode12.4.app/Contents/Developer/usr/bin/ibtool --errors --warnings --notices --module TheBank --target-device iphone --minimum-deployment-target 11.0 --output-format human-readable-text --link /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Products/Debug-iphonesimulator/TheBank.app /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/TransferBranchSelect.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/Debit.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/ApplePayPromotion.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/LoginOTPW.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/Login.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/EULA.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/QuickSetting.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/LoginSetting.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/Main.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/Dashboard.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/Home.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/TransferAndTrade.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/TransferLimitPop.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/NewCredit.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/TransferDateSelect.storyboardc /Path/to/DerivedData/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/MyBankIphone-ekalchahdgkmpvgslorsudbagmck/Build/Intermediates.noindex/MyBankIphone.build/Debug-iphonesimulator/MyBankIphone.build/Web30CardDetail.storyboardc
/* com.apple.ibtool.errors */
: error: Did not find view controller with identifier "AccountPoint" in Home.storyboard, referenced from Dashboard.storyboard
Command LinkStoryboards failed with a nonzero exit code
In case someone is interested on how to re-create this error on an Xcode project just create a Storyboard segue in that points to another Storyboard. Then delete the target view controller but do not delete the reference in the segue.
We run our Xcode builds on GitHub actions and use xcbeautify to make the logs better. However if a test fails or there is a compile error we have to dig through the logs to find the issue. It is possible for tools to emit log messages in a format that Github Actions can interpret.
See https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#logging-commands
SwiftLint has a --reporter
option that causes it to emit issues in this format (https://github.com/realm/SwiftLint/blob/master/Source/SwiftLintFramework/Reporters/GitHubActionsLoggingReporter.swift) this makes running SwiftLint in Github Actions work really well.
It would are great it xcbeautify
also had the option of reporting errors like this.
Hello!
I am sorry I can't provide many more debug details.
We are using bitrise
with fastlane
and xcbeautify
to run our iOS builds.
all of our builds had extreme High CPU usage, and UI tests were getting completely stuck.
We checked the Bitrise VMs with a VNC and by checking the activity monitor we realized the cause of the freeze was the
xcbeautify
consuming all resources.
This is not causing a hang on our local machine, it's more tied to a VM environment.
Do you have any performance issue report regarding similar issues?
or any way we can enable some performance logs/monitoring for improving this report?
thanks
The current one seems expired, and I don't have access to setting secrets in this repo.
https://github.com/tuist/xcbeautify/actions/runs/4213952579/jobs/7314070522
cc @tuist/core
Current there're only quiet
and quieter
options to only show warnings and errors. However, I would like to know which module is currently building to get to know the approximate progress.
It's just like the effect in the Xcode's build log viewer, when I filtered it with All Issues
or Error only
, not only warnings and errors are shown, but also the modules currently building is also shown, which will disappear when build finished.
\r
is something that I know to clear part of the console output. But I'm not sure whether there're better ways to achieve it.
Got a bit of a weird one here!
In my Xcode project, I've got a run script build phase that just contains export
. This is to print out the environment variables to the log.
For some reason, in version 0.21.0 of xcbeautify, the build gets hung up on that build phase.
I went through the process of git bisecting between 0.20.0 and 0.21.0, and the commit that seems to be the cause of the issue is this one: 215be3c.
I'm not sure why that change is causing things to hang, but in my testing, it does cause the problem.
Here's an example project you can use for testing: xcbeautify-test-project.zip
xcbeautify
0.21.0 is installedxcrun xcodebuild | xcbeautify
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
Warning
Renovate failed to look up the following dependencies: Could not determine new digest for update (github-releases package bazelbuild/rules_swift)
.
Files affected: WORKSPACE
These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.
WORKSPACE
build_bazel_rules_swift 410d8ed546e3e43dd06f01cb3916ede6632a6d71
Colorizer 0.2.1
ArgumentParser 1.3.0
.github/workflows/release.yml
actions/create-release v1
battila7/get-version-action v2
actions/checkout v4
swift-actions/setup-swift v1
actions/upload-release-asset v1.0.2
actions/upload-release-asset v1.0.2
actions/upload-release-asset v1.0.2
actions/checkout v4
swift-actions/setup-swift v1
actions/upload-release-asset v1.0.2
.github/workflows/stale.yml
actions/stale v9
.github/workflows/style.yml
actions/checkout v4
.github/workflows/xcbeautify.yml
swift-actions/setup-swift 61a116f4030ac34fb5731aab0eff5a0aed94ba29
actions/checkout v4
swift-actions/setup-swift 61a116f4030ac34fb5731aab0eff5a0aed94ba29
actions/checkout v4
Formula/xcbeautify.rb
.ruby-version
ruby 3.2.2
Package.swift
apple/swift-argument-parser from: "1.3.0"
getGuaka/Colorizer from: "0.2.1"
MaxDesiatov/XMLCoder from: "0.17.1"
Fatal error: ["build/CocoaLumberjack.framework"]: file /Users/admin/dev/xcbeautify/Sources/XcbeautifyLib/String+Beautify.swift, line 164
I can provide you with more info if required
Looks like JUnit support for parallel testing was added in 0.16.0, but it was not published to cocoapods. The latest version available there is 0.15.0, any chance it could be published?
Thanks!
Hi 👋
Would be nice to support the generation of compilation databases. Xcpretty seems to support this already: https://github.com/xcpretty/xcpretty#reporters
Thanks!
Hi there,
I upgraded the XCode 11.1, Unfortunately, there is no output for each file building status.
Thanks
Where can i find more information on the usage of xcbeautify?
For e.g. xcodebuild [flags] | xcbeautify
How to generate a JUnit report from xcbeautify?
output with xcbeautify: https://github.com/Cyberbeni/TypedNotificationCenter/runs/314794146
output without xcbeautify: https://github.com/Cyberbeni/TypedNotificationCenter/runs/303631505
My project in xcode14 would build with some error like this:
❌ error: Dependency for P1:target-MyApp-fce55c0e14fedcc57d73ec039f604d040bdc1e3e5eb2ad770e53e15b1d5e91df-:Ad-Hoc-Mirror:SwiftDriver Compilation Requirements xiaoheihe normal arm64 com.apple.xcode.tools.swift.compiler is not absolute (Pods/Headers/Public/ActionSheetPicker_3_0/ActionSheetPicker-3.0.modulemap). (in target 'MyApp' from project 'MyApp')
And xcbeautify
will stock after encounter such error.
I've been trying xcbeautify
out with a parallel test suite, but the tests are not being matched. Below is some of the unparsed output from xcodebuild
. Might be worth noting that the test suite is written in Objective-C, but I doubt it makes a difference.
Testing started on 'My Mac'
Test suite 'MyControllerTests' started on 'xctest (49438)'
Test suite 'MyTests' started on 'xctest (49440)'
Test case '-[MyControllerTests testErrorReported]' passed on 'xctest (49438)' (0.301 seconds)
Test case '-[MyControllerTests testTheThingIsChanged]' passed on 'xctest (49438)' (0.005 seconds)
Test case '-[MyControllerTests testAllTheThings]' passed on 'xctest (49438)' (0.001 seconds)
Test suite 'MyServiceTests' started on 'xctest (49438)'
Test case '-[MyServiceTests testServiceActuallyWorks]' passed on 'xctest (49438)' (0.004 seconds)
The regex pattern matching the passed tests doesn't expect the on 'xctest (49438)'
part and there is no arbitrary character at the end of the line. Does it make sense to simply ignore the process part and make the arbitrary character optional? Personally I don't care about the process ID of the test, but happy to discuss that.
I'm also happy to put in a PR for this. Seems fair because I'd like to see this fixed 🙂
"All command-line software which outputs text with ANSI color added should check for the presence of a NO_COLOR environment variable that, when present (regardless of its value), prevents the addition of ANSI color."
If the simulator fails for whatever reason then the output isn't captured. Here's a sample (test names and classes replaced with snipped
):
Test Case '-[snipped]' passed (0.416 seconds).
Test Suite 'snipped' passed at 2020-09-30 03:49:19.794.
Executed 1 test, with 0 failures (0 unexpected) in 0.416 (0.418) seconds
Test Suite 'snipped.xctest' passed at 2020-09-30 03:49:19.796.
Executed 1 test, with 0 failures (0 unexpected) in 0.416 (0.421) seconds
Test Suite 'All tests' passed at 2020-09-30 03:49:19.797.
Executed 1 test, with 0 failures (0 unexpected) in 0.416 (0.423) seconds
2020-09-30 03:49:23.416 xcodebuild[13914:99691] [MT] IDETestOperationsObserverDebug: 335.611 elapsed -- Testing started completed.
2020-09-30 03:49:23.416 xcodebuild[13914:99691] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start
2020-09-30 03:49:23.416 xcodebuild[13914:99691] [MT] IDETestOperationsObserverDebug: 335.611 sec, +335.611 sec -- end
Test session results, code coverage, and logs:
/Users/runner/work/1/s/app-ios/Builds/xcresults/snipped.xcresult
Testing failed:
snipped:
The test runner encountered an error (Failed to prepare device 'Test - f204ffed - 20200930' for impending launch. If you believe this error represents a bug, please attach the result bundle at /Users/runner/work/1/s/app-ios/Builds/xcresult. (Underlying Error: Unable to boot the Simulator. launchd failed to respond. (Underlying Error: Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding)))
** TEST EXECUTE FAILED **
The actual output of this is:
Test Suite snipped.xctest started
snipped
✔ snipped (0.416 seconds)
Tests Passed: 0 failed, 1 total (0.423 seconds)
I'd have expected to see something more like:
Test Suite snipped.xctest started
snipped
✔ snipped (0.416 seconds)
Tests Passed: 0 failed, 1 total (0.423 seconds)
❌The test runner encountered an error (Failed to prepare device 'Test - f204ffed - 20200930' for impending launch. If you believe this error represents a bug, please attach the result bundle at /Users/runner/work/1/s/app-ios/Builds/xcresult. (Underlying Error: Unable to boot the Simulator. launchd failed to respond. (Underlying Error: Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding)))
I can share the full log privately if that's more helpful.
Hi,
xcbeautify works really great but i would like to see which files are actually compiled like xcpretty did.
The default option shows only which targets are build + warnings and errors. -q
and -qq
show even less.
An extra verbose mode in between which also shows the compiled files would be great.
xcodebuild test -project "MyApp.xcodeproj" -scheme "MyApp" -sdk iphonesimulator -destination "OS=16.0,name=iPhone 13 mini,platform=iOS Simulator" -derivedDataPath "~/temp2" -destination-timeout 300 -parallel-testing-worker-count 4 -parallel-testing-enabled YES | ~/.mint/bin/xcbeautify --is-ci --quiet --report junit --junit-report-filename junitresult.xml --report-path .
The resulting file junitresult.xml
shows 0 tests run :(
xcbeautify prints a \
before each whitespace in the names of my "Run Script" build phases.
For example :
❯ xcodebuild build -showBuildTimingSummary -workspace Redacted.xcworkspace -scheme Redacted-Debug | xcbeautify
[NotificationExtension] Running script Nullability\ Check
[NotificationExtension] Processing Info.plist
Signing Redacted.NotificationExtension.appex (in target: NotificationExtension)
[Pods-Redacted] Compiling Pods-Redacted-dummy.m
[Pods-Redacted] Building library libPods-Redacted.a
[ShareExtension] Processing Info.plist
Signing Redacted.ShareExtension.appex (in target: ShareExtension)
[Redacted] Running script [CP]\ Check\ Pods\ Manifest.lock
[Redacted] Running script Nullability\ Check
[Redacted] Running script Error\ codes\ check
[Redacted] Running script Linters
[Redacted] Compiling ISConsultationViewController.m
[Redacted] Compiling ISNewDocumentViewController.m
[Redacted] Linking Redacted-Debug
[Redacted] Compiling Consultation.storyboard
[Redacted] Processing Info.plist
[Redacted] Copying Redacted.ShareExtension.appex
[Redacted] Copying Redacted.NotificationExtension.appex
[Redacted] Running script [CP]\ Embed\ Pods\ Frameworks
[Redacted] Running script [CP]\ Copy\ Pods\ Resources
[Redacted] Running script Validate\ Payment\ Pickers\ XML
Signing Redacted-Debug.app (in target: Redacted)
Signing (3 tasks) | 24.000 seconds
Build Succeeded
I can probably look at this when I have more time and submit a PR.
Update:
I have noticed xcbueatify cannot properly handle output from Xcode 11.2.1. So it may be a good idea to support different format of Xcode.
#################################
Could xcbeautify support different versions of OS and Xcode? If not yet, could these be implemented as new command line options?
Thanks!
When I use the XcbeautifyLib from Swift code it "stops" if it encounters a compile warning. This happens because of the call to readLine()
in formatCompileWarning
.
Could we only call readLine
when the lib is used from the command line tool? Maybe by setting an environment variable in main.swift
?
Based on the Homebrew docs, this should be the correct way to do it:
depends_on cask: "thii/swift-runtime/swift-runtime" if MacOS.version < "10.14.4"
Hi there. Thanks for this handy tool :)
I want to create a problem matcher for vscode in a custom task where i pipe the build output from xcodebuild
through xcbeautify
. In order to distinguish between and error and a warning i need to match the words as a string with a regex. VSCode can then present the errors and warnings in the problems tab and i can jump to them.
At the moment this is not working quite well since warning and error are printed by xcbeautify as \u{9888}
and \u{26A0}
. It would be nice if there were an option i can pass in and then warning
and error
is printed instead of the special unicode character.
Is there a recommended installation method for xcbeautify on Linux other than building from source? I’d like to integrate this into the CI pipeline for my Vapor project but couldn’t find an installation method easy enough for a Docker setup. I’m probably missing something obvious, since I don’t have a lot of experience with Swift on Linux and Docker in general.
Hi, thanks for the great project.
One thing I'm missing from it is the warnings suppression - Travis cancel jobs after 4MB of logs and building React Native projects for IOS often generates many warnings for the third party libraries.
Using some flag like --errors-only
would be very helpful in that case
Hi there. Not knocking the tool or anything I really like it and want to make it better. I was trying it out on our build's output and noticed it was very very slow. Was going to open an issue now and dig into profiling it. I imagine its something simple like regex's being created more often than necessary or something similar. Below is a comparison of timing on our unittest output between xcpretty
and xcbeautify
.
~/dev > du -hs xcodebuild.log
3.0M xcodebuild.log
~/dev > cat xcpretty.sh xcbeautify.sh
#!/bin/bash
cat xcodebuild.log | xcpretty > /dev/null
#!/bin/bash
cat xcodebuild.log | xcbeautify > /dev/null
~/dev > time ./xcpretty.sh
1.34 real 1.18 user 0.14 sys
~/dev > time ./xcbeautify.sh
52.34 real 52.23 user 0.06 sys
NSArray *lines = [log componentsSeparatedByString:@"\n"];
Parser *parser = [[Parser alloc] init];
for (NSString *line in lines) {
NSString *beautyLog = [parser parseWithLine:line colored:NO];
if (beautyLog.length) {
DDLogInfo(@"%@", beautyLog);
}
}
ibsystem_kernel.dylib 0x7fff6c5b4afe read$NOCANCEL + 10
libsystem_c.dylib 0x7fff6c500b25 __srefill1 + 24
libsystem_c.dylib 0x7fff6c4fd017 getdelim + 251
libswiftCore.dylib 0x7fff6bc18903 swift_stdlib_readLine_stdin + 35
libswiftCore.dylib 0x7fff6b9a9465 $ss8readLine16strippingNewlineSSSgSb_tF + 37
OCObfuscator 0x10004497a $sSS12OCObfuscatorE8beautify7pattern7coloredSSSgAA7PatternO_SbtF + 7242
OCObfuscator 0x1000396d2 $s12OCObfuscator6ParserC5parse4line7coloredSSSgSS_SbtF + 1826
OCObfuscator 0x10003ae9c $s12OCObfuscator6ParserC5parse4line7coloredSSSgSS_SbtFTo + 92
OCObfuscator 0x10000b2cd -[ObfuscatorTool receivedData:] + 1101
CoreFoundation 0x7fff34d9a35f __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
CoreFoundation 0x7fff34d9a2f3 ___CFXRegistrationPost1_block_invoke + 63
CoreFoundation 0x7fff34d9a268 _CFXRegistrationPost1 + 372
CoreFoundation 0x7fff34d99ebe ___CFXNotificationPost_block_invoke + 97
CoreFoundation 0x7fff34d697e2 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1575
CoreFoundation 0x7fff34d68c82 _CFXNotificationPost + 1351
Foundation 0x7fff373eea22 -[NSNotificationCenter postNotificationName:object:userInfo:] + 59
Foundation 0x7fff375271f3 _performFileHandleSource + 1106
CoreFoundation 0x7fff34da4b21 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
CoreFoundation 0x7fff34da4ac0 __CFRunLoopDoSource0 + 103
CoreFoundation 0x7fff34da48d4 __CFRunLoopDoSources0 + 209
CoreFoundation 0x7fff34da3740 __CFRunLoopRun + 1272
CoreFoundation 0x7fff34da2bd3 CFRunLoopRunSpecific + 499
HIToolbox 0x7fff338f865d RunCurrentEventLoopInMode + 292
HIToolbox 0x7fff338f82a9 ReceiveNextEventCommon + 356
HIToolbox 0x7fff338f8127 _BlockUntilNextEventMatchingListInModeWithFilter + 64
AppKit 0x7fff31f68ba4 _DPSNextEvent + 990
AppKit 0x7fff31f67380 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1352
AppKit 0x7fff31f5909e -[NSApplication run] + 658
AppKit 0x7fff31f2b465 NSApplicationMain + 777
OCObfuscator 0x100017e1f main + 47
libdyld.dylib 0x7fff6c4727fd start + 1
then i get the dead lock code
private func formatCompileWarning(pattern: Pattern) -> String? {
let groups = capturedGroups(with: pattern)
let filePath = groups[0]
let reason = groups[2]
// Read 2 additional lines to get the warning line and cursor position
let line: String = readLine() ?? "" // ===>this is the dead lock !!!!!!!!!!!!!
let cursor: String = readLine() ?? ""
....
.....
}
I'm not sure whether it's worth while, but it seems to be more safe (and performant?). As all, NSRegularExpression seems would be replaced by Swift Regex in the future, which is heavily used to matching xcodebuild's output in this repo.
Not all precompile headers necessarily end in the .pch
suffix.
For example, precompiled headers generated by CMake are of the form cmake_pch.h|xx
(https://cmake.org/cmake/help/latest/command/target_precompile_headers.html)
For a pure ObjC CMake target, the generated PCH could also be cmake_pch.objc.h
This causes the ProcessPCH line to get swallowed, which is unfortunate especially for projects with large precompiled headers that take a while to compile
Someone other than the project maintainer has to do this.
Xcode supports more stuff to performance test than just "wall clock time", it would be cool to also see those in the formatted output
https://indiestack.com/2018/02/xcodes-secret-performance-tests/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.