johnno1962 / SwiftTrace

Trace Swift and Objective-C method invocations
Other
707 stars 52 forks source link

Building error with Xcode 15 b3 #46

Closed skrew closed 1 year ago

skrew commented 1 year ago

Hi,

ld: null objc class data for '_OBJC_METACLASS_$_DYLookup' in '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-cvblaumrruyvbifmgnvwtimblmro/Build/Products/Debug-appletvsimulator/SwiftTraceGuts.o'
johnno1962 commented 1 year ago

Hi, that's a new one - They continue to work on the linker.. May have been because that ObjC class shared it's name with a C++ class. I'm away from my "work" machine at the moment so I can't verify the problem/fix with beta3. Can you try branch include-entitlements of the HotReloading project or main/8.4.5 on SwiftTrace please which separates the two names?

skrew commented 1 year ago

Hi, Tested with include-entitlements branch, same problem

Null objc class data for '_OBJC_METACLASS_$_ObjcDYLookup' in '/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-cvblaumrruyvbifmgnvwtimblmro/Build/Products/Debug-appletvsimulator/SwiftTraceGuts.o'
johnno1962 commented 1 year ago

Oh well, I'll fix it when I get back. I've commented out the class completely now. Can you refresh the branch and try again please?

johnno1962 commented 1 year ago

Any reason you're building from source instead of using the tvOSInjection.bundle in the InjectionIII.app?

skrew commented 1 year ago

You asked me, while a teamviewer session a few months ago, why i'm not using HotReloading package instead of InjectionIII 😅

johnno1962 commented 1 year ago

I meant well. Injection itself is easier to develop using the package. You get the freshest, quality HotReloading experience using the package but at the end of the day it's far easier to manage the binary releases, particularly when there are betas floating about. Did the last commit fix the problem?

skrew commented 1 year ago

Building is OK with the latest commit.

BTW, just tested in 2 classes, i got an error:

🔥 Selecting Xcode /Applications/Xcode-15.0.0-beta.3.app/Contents/Developer
🔥 Loading .dylib ...
🔥 ⚠️ dlopen() error: dlopen(/Users/skrew/Library/Developer/CoreSimulator/Devices/DDC81F77-3E6C-4D5E-B232-8C01DF8DB725/data/Containers/Data/Application/740253C0-FDD5-41FF-A65B-6CB50E01D97F/tmp/eval101.dylib, 0x0002): tried: '/Users/skrew/Library/Developer/Xcode/DerivedData/xxx-cvblaumrruyvbifmgnvwtimblmro/Build/Products/Debug-appletvsimulator/eval101.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/tvOS_21J5303f/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS 17.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/eval101.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/tvOS_21J5303f/Library/Developer/CoreSimulator/Profiles/Runtimes/tvOS 17.0.simruntime/Contents/Resources/RuntimeRoot/Users/xxx/Library/Developer/CoreSimulator/Devices/DDC81F77-3E6C-4D5E-B232-8C01DF8DB725/data/Containers/Data/Application/740253C0-FDD5-41FF-A65B-6CB50E01D97F/tmp/eval101.dylib' (no such file), '/Users/xxx/Library/Developer/CoreSimulator/Devices/DDC81F77-3E6C-4D5E-B232-8C01DF8DB725/data/Containers/Data/Application/740253C0-FDD5-41FF-A65B-6CB50E01D97F/tmp/eval101.dylib' (code signature in <1EF16681-89DD-3B21-9169-EF7F8B73333B> '/Users/xxx/Library/Developer/CoreSimulator/Devices/DDC81F77-3E6C-4D5E-B232-8C01DF8DB725/data/Containers/Data/Application/740253C0-FDD5-41FF-A65B-6CB50E01D97F/tmp/eval101.dylib' not valid for use in process: Trying to load an unsigned library)

Same classes inject properly with bundles / InjectionIII.app Take you time to fix it properly, i'm using InjectionIII.app now

Thanks.

johnno1962 commented 1 year ago

This is a separate new problem. They have re-introduced the requirement to code sign the .dylib which means you'll have to use the app now; just when I re-wrote the README :S. Will look at all this next week.

johnno1962 commented 1 year ago

Hi, I wasn't able to replicate the problem loading an unsigned .dylib you mention above with beta3. What simulator is this? iOS, tvOS?

skrew commented 1 year ago

tvOS

johnno1962 commented 1 year ago

OK, replicated and fixed if you have the time to try the include-entitlements branch of the HotReloading project again without using the app. Very much a new edge case on an edge case but if they introduce the requirement to sign iOS at least I have the fix at hand.

johnno1962 commented 1 year ago

I've rolled a new release candidate https://github.com/johnno1962/InjectionIII/releases/tag/4.7.1 if you want to download and try it. It should work tvOS on beta3 loading the bundle with or without running the app itself. Thanks for the report. Keep 'em coming!

skrew commented 1 year ago

Ok thanks, i will tell you if i'm find something :) But for the moment, it's ok for me 👍🏻