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

Unexpected className found parsing IDEActivityLogMessage IDEActivityLogActionMessage #187

Closed
mollyIV opened this issue Oct 12, 2023 · 3 comments · Fixed by #189
Closed

Comments

@mollyIV
Copy link
Contributor

mollyIV commented Oct 12, 2023

It seems that with the introduction of Xcode 15, there's a new "class instance" type: IDEActivityLogActionMessage.

An example:

1(27%IDEActivityLogActionMessage6@78"The identity of “XYZ.xcframework” is not recorded in your project.-123213#432423423423423#0#-0#-23%DVTTextDocumentLocation7@93"file:///Users/blob/Projects/foo/Carthage/Build/XYZ.xcframework/0000000000000000^0#0#0#0#13333073712324212#0#0#---110"{"frameworkSigningMismatch":{"_0":{"frameworkPath":"\/Users\/blob\/Projects\/foo\/Carthage\/Build\/XYZ.xcframework"}}}0#0#0#--3333"ProcessXCFramework /Users/blob/Projects/foo/Carthage/Build/XYZ.xcframework /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework ios
    cd /Users/blob/Projects/foo/Projects/foo
    builtin-process-xcframework --xcframework /Users/blob/Projects/foo/Carthage/Build/XYZ.xcframework --platform ios --target-path /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos

    Task input dependencies:
        /Users/blob/Projects/foo/Carthage/Build/XYZ.xcframework/
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos

    Task output dependencies:
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework/Headers
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework/Headers/XYZ.h
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework/XYZ
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework/Info.plist
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework/Modules
        /Users/blob/Library/Developer/Xcode/DerivedData/foo-abc/Build/Products/foo-debug-iphoneos/XYZ.framework/Modules/module.modulemap

According to the XCActivitylog Format documentation, we need to obtain the properties of this class from a private IDEFoundation.framework framework. Unfortunately, I wasn't able to do so.

If anyone could help to get the list of properties we should include in a new IDEActivityLogActionMessage.swift, I'd be happy to implement it 🙏

@BalestraPatrick
Copy link
Collaborator

Hello @mollyIV, I tried using class-dump as mentioned in the documentation, but it's possible that the code in IDEFoundation.framework has been rewritten into Swift as it's not really providing any useful output to me. By using Hopper, I found this.
Screenshot 2023-10-13 at 10 21 56 PM

I'm not exactly sure what "action" refers to (maybe just a string?), but I believe the other 3 fields are similar to others that we have in other model objects. It's worth trying to come up with a model and see if parsing your xcactivitylog parses it correctly.

@mollyIV
Copy link
Contributor Author

mollyIV commented Oct 16, 2023

Hello @BalestraPatrick 👋

Thank you for having a look at the issue.

I've been trying to come up with the model to parse my xcactivitylog and ended up with this:

public class IDEActivityLogActionMessage: IDEActivityLogMessage {
  public let action: String // <-- the only new field
}

It results in getting the following model object from the logs that I attached to the issue:

  > title: (String) The identity of “XYZ.xcframework” is not recorded in your project.
  > shortTitle = (String) ""
  > timeEmitted = (Double) ...
  > rangeEndInSectionText = (UInt64) ...
  > rangeStartInSectionText = (UInt64) ...
  > submessages = [(XCLogParser.IDEActivityLogMessage)] 0 values
  > severity = (Int) 0
  > type = (String) ""
  > location = (XCLogParser.DVTTextDocumentLocation) 0x00...
  > categoryIdent = (String) ""
  > secondaryLocations = ([XCLogParser.DVTTextDocumentLocation]) 0 values
  > additionalDescription = (String) ""
> action: (String) "{"frameworkSigningMismatch":{"_0":{"frameworkPath":"\/Users\/blob\/Projects\/foo\/Carthage\/Build\/XYZ.xcframework"}}}"

I've been moving the iterator.next() to the end when parsing IDEActivityLogActionMessage in parseIDEActivityLogActionMessage function, but couldn't get anything more than the action message and 0, 0, 0 values. After that an iterator was returning null.

I believe getting only an action message should be good enough, no? 🤔

Btw, I called it action, but I am up for other naming suggestions.

I created a draft pull request. I didn't add unit tests yet, because first, I wanted to make sure that it's a good implementation direction we are heading to 😉

Thoughts? 🙇

@danielPeloton
Copy link

I've also been running into this now that we're updated to Xcode 15. Is there anything we can do to get that draft PR through?

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

Successfully merging a pull request may close this issue.

3 participants