a7ex / xcresultparser

Parse the binary xcresult bundle from Xcode builds and testruns
MIT License
93 stars 27 forks source link

Xcode 16 beta 3 tests fail as xcresulttool get object is deprecated #39

Closed mikehouse closed 3 weeks ago

mikehouse commented 1 month ago

Hi. The issue the same as here https://github.com/fastlane/fastlane/issues/22132

These commands are okay

~ xcodebuild -version
Xcode 15.4
Build version 15F31d

~ ./scripts/xcresultparser -o cli /fastlane/test_output/Test-MyApp-2024.07.09_14-57-50-339029-+0700.xcresult

These commands are not okay

~ xcodebuild -version
Xcode 16.0
Build version 16A5202i

~ ./scripts/xcresultparser -o cli /fastlane/test_output/Test-MyApp-2024.07.09_14-57-50-339029-+0700.xcresult
Error: This command is deprecated and will be removed in a future release, --legacy flag is required to use it.
Usage: xcresulttool get object [--legacy] --path <path> [--id <id>] [--version <version>] [--format <format>]
  See 'xcresulttool get object --help' for more information.
Error: argumentError

Thanks for awesome tool, we use it every day on our CI pipelines.

a7ex commented 1 month ago

Thanks for the heads up. I will look into asap.

mangerlahn commented 1 month ago

The issue is with XCResultKit actually. It calls xcrun xcresulttool get/export, which are deprecated with xcresulttool shipped in Xcode 16 beta 3.

a7ex commented 1 month ago

I know. But I will need to investigate, whether I can use xcresultkit in another way or at least give the xcresulttool developers a heads up. Or even consider to ditch xcresulttool...

mangerlahn commented 1 month ago

I have prepared a pull request that adds a temporary workaround: https://github.com/davidahouse/XCResultKit/pull/52

The old/existing commands on xcresulttool will continue to work if a —legacy option is added.

Brett-Best commented 1 month ago

It's rather annoying that Apple didn't provide an environment variable option. Some of the new commands looks like we could use however seems to be missing a way to get the warnings from the report unfortunately.

Brett-Best commented 1 month ago

@a7ex https://github.com/davidahouse/XCResultKit/pull/52 is merged now, would we be able to bump the package to use it?

a7ex commented 1 month ago

Sure, will do that later after work. Stay tuned! :-)

On 23. Jul 2024, at 15:57, Brett Best @.***> wrote:

@a7ex https://github.com/a7ex davidahouse/XCResultKit#52 https://github.com/davidahouse/XCResultKit/pull/52 is merged now, would we be able to bump the package to use it?

— Reply to this email directly, view it on GitHub https://github.com/a7ex/xcresultparser/issues/39#issuecomment-2245331508, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANBA4VQ6NRZEEC7GDO2CADZNZOL3AVCNFSM6AAAAABKSNUFZKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBVGMZTCNJQHA. You are receiving this because you were mentioned.

a7ex commented 1 month ago

There is no new tag. I am waiting for David to make a new tag, so I can update my Package.swift.

Is it so urgent, that we can not wait for the tag an would now reference the commit hash? No…is it?

It’s all still beta early days… I am sure, David will soon make a tag for a new release.

As far as I understand this is anyway only a temporary solution. Once Apple really deprecates the old API, we will need to change a bit more. As far as I could see, that JSON objects are much simpler and nicer AND way smaller. But they also seem to lack information, which we had before with the now deprecated method. But we will see. Maybe the information is hidden behind some switches to the new API calls :-)

On 23. Jul 2024, at 15:57, Brett Best @.***> wrote:

@a7ex davidahouse/XCResultKit#52 is merged now, would we be able to bump the package to use it? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Brett-Best commented 1 month ago

All good, I've made https://github.com/a7ex/xcresultparser/pull/40 which I'll update when a tag is made 😄

Yeah, I think the test summary part looks okay? But getting compile warnings/errors doesn't look okay so probably should raise a feedback with Apple about that removed functionality which I find really useful 😢

a7ex commented 1 month ago

Thank you Brett. I have a few refactoring for Swift 6 compatibility as well. I will add them also to the "Xcode 16 compatibility release" :-)