Skip to content
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

Error: xcactivitylog is not a valid xcactivitylog file #159

Closed
CraigSiemens opened this issue Jan 31, 2022 · 5 comments
Closed

Error: xcactivitylog is not a valid xcactivitylog file #159

CraigSiemens opened this issue Jan 31, 2022 · 5 comments

Comments

@CraigSiemens
Copy link

We're currently getting the following error after running xclogparser.

Error: /PATH/TO/.../F0DAEBCF-B096-4FAD-917D-1BFED5DC43F4.xcactivitylog is not a valid xcactivitylog file

At first we thought it was from EnableSwiftBuildSystemIntegration in Xcode 13.2+ but disabling it and going down to Xcode 13.1 have the same issue.

The file is created at the shown location and is 15.9 MB. I don't know what else I could look for to troubleshoot the issue. There's previous issues with the same error, but the solutions don't apply (like adding -resultBundlePath since we already have it).

Versions

XCLogParser: 0.2.32
Xcode: 13.1, 13.2.1, 13.3 beta 1

Script we're running

RESULT_BUNDLE_PATH="$HOME/Desktop/Neo.xcresult"
xcodebuild \
  -scheme Neo \
  clean

xcodebuild \
  -scheme Neo \
  -destination "platform=iOS Simulator,name=iPhone SE (2nd generation)" \
  -resultBundlePath "$RESULT_BUNDLE_PATH" \
  OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies -Xfrontend -debug-time-expression-type-checking" \
  build

sleep 10

xclogparser parse \
  --project Neo \
  --reporter html \
  --output ~/Desktop
@ecamacho
Copy link
Collaborator

Hi we also had the same issue when using the -debug-time-function-bodies and -debug-time-expression-type-checking flags with Xcode 13.x. For some reason Xcode was creating truncated log files. But somehow it's working now that we bumped to use Xcode 13.2.1. I'm pinging @aleksandergrzyb since he verified this recently, maybe he can have some insights about it.

@aleksandergrzyb
Copy link
Collaborator

Yes, it is a known problem. 😔 Currently I am investigating why it happens. I will give an update here if I would be able to figure out what's wrong.

@aleksandergrzyb
Copy link
Collaborator

We've noticed that in our case .xcactivitylog is invalid, because xcodebuild didn't finish creating it before exiting. Probably the process terminates, because it takes lots of time to generate .xcactivitylog in our case (it has over 50 MB). We solved this issue by executing clean action after build action to occupy xcodebuild process a little bit longer.

In your case please execute following and check if that helps:

xcodebuild \
  -scheme Neo \
  -destination "platform=iOS Simulator,name=iPhone SE (2nd generation)" \
  -resultBundlePath "$RESULT_BUNDLE_PATH" \
  OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies -Xfrontend -debug-time-expression-type-checking" \
  build clean

@CraigSiemens
Copy link
Author

Interesting, that seems to work most of the time. Through sometimes it looks like the clean is removing the xcactivitylog of the build. It's not all the time though so I'm not sure if it's a race condition or if there's something else causing it.

This also meant that the xclogparser now starts grabbing the xcactivitylog from the clean since it's the newest log. I had to change our script to take the second newest file and pass it using the --file option.

But at least we've got some stats to work with now, thanks! But we're still slightly limited by another issue #148.

@ecamacho
Copy link
Collaborator

Closing this and moving the conversation to #148

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants