a7ex / xcresultparser

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

`xcresultparser` errors out with code 133 when executed #21

Closed alexzagu closed 9 months ago

alexzagu commented 10 months ago

I've tried running the parser from brew and the binary from the latest release (1.4.2) and they both error out with the same error message/code combo:

XcresultparserLib/resource_bundle_accessor.swift:40: Fatal error: unable to find bundle named Xcresultparser_XcresultparserLib

The command I'm running follows the following pattern:

xcresultparser -p my-dir -o cobertura results/result.xcresult > output/coverage.xml

The weird thing to me is that I was running the parser successfully yesterday, using the exact same command, but today it just doesn't work. This makes me think that I'm the one making the error, but I can't figure out any difference between yesterday and today. One thing that I do notice is that the Package.swift declares a XcresultparserLib library and target, but there is no such directory with that name in Sources, only xcresultparser. I'm left wondering if that might be the issue.

squarefrog commented 10 months ago

We're getting the same issue. Just started today.

squarefrog commented 10 months ago

I had previously installed xcresultparser through homebrew. If I run this through mint run I dont get the error. You may need to install mint first:

$ brew install mint
$ mint run a7ex/xcresultparser -p my-dir -o cobertura results/result.xcresult > output/coverage.xml 
a7ex commented 10 months ago

I will have a look into it later. I have no experience with mint. I always use brew. At the office now and will reply later, when I am back on "spare time" :-)

squarefrog commented 10 months ago

I’m not sure why it would work with mint and not brew, my gut feeling is mint compiles from source but brew uses a precompiled binary.

Mint is great for swift command line tools though, you can pin specific versions easily, ensuring your whole team is using the same version of said tools.

hisaac commented 10 months ago

We're running into this too. I rebuilt a version of the tool locally, and it works fine, so I think you're onto something @squarefrog about it needing to be compiled from source. Super strange.

a7ex commented 10 months ago

Brew can also compile from source, but it isn't setup at the moment to do so. For comevenience it is setup to use the compiled binary, just so that CI build chains don't need to compile the thing over and over again. Brew is setup to use the following notarized compiled app: https://github.com/a7ex/xcresultparser/archive/1.4.2.tar.gz

As for mint compiling from source, it should do, if it does when checking out the source and compiling, right? So I am not sure, what I can do about it?

Brew uses the MakeFile in the root of the Repo, when compiling from source. Does mint use that MakeFile? It builds a universal binary. I think that can only be done on a ARM (M1, M2) Mac. Are you trying to do it on an Intel Mac?

hisaac commented 10 months ago

@a7ex As a test, could you rebuild and re-notarize a fresh binary of 1.4.2 and upload it here for us to try? I wonder if there's some issue with notarization or something.

squarefrog commented 10 months ago

You don’t need to do anything with mint, it caches builds so don’t worry about that. Mint doesn’t use the make file. It just uses the swift tool chain to build the binary.

a7ex commented 10 months ago

The result should not be different from: https://github.com/a7ex/xcresultparser/archive/1.4.2.tar.gz

But yes, I can do that.

a7ex commented 10 months ago

xcresultparser.zip

Freshly built and notarized

hisaac commented 10 months ago

Well wait a second now, the homebrew version and the version downloaded from the release are working for me now… What the heck?

@alexzagu @squarefrog Are they working for you today as well?

alexzagu commented 10 months ago

@hisaac I just ran the brew version (1.4.2) and it is working... it is so odd. Why would the same binary work one day and not the next day and then again 🤔 Nothing changed AFAIK. You guys have any insight?

alexzagu commented 9 months ago

I've been using it solidly since last comment, so it looks like it only flopped for a day or so. @a7ex up to you to close or keep this issue open for further investigation.

a7ex commented 9 months ago

Thanks @alexzagu I'll close this ticket