Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
732 views
in Technique[技术] by (71.8m points)

objective c - CoreData model compiler fails because of libwep

Since today, each CoreData-based project I try to build fails during the compilation of the CD model

DataModelVersionCompile /Users/paolo/Library/Developer/Xcode/DerivedData/testCoreDataBuild-fgvttsutxgjcnsdctcceutmrilfn/Build/Products/Debug-iphoneos/testCoreDataBuild.app/testCoreDataBuild.momd testCoreDataBuild/testCoreDataBuild.xcdatamodeld
    cd /Users/paolo/Workspace/Apps/testCoreDataBuild
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/usr/bin/momc -XD_MOMC_SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.3.sdk -MOMC_PLATFORMS iphoneos /Users/paolo/Workspace/Apps/testCoreDataBuild/testCoreDataBuild/testCoreDataBuild.xcdatamodeld /Users/paolo/Library/Developer/Xcode/DerivedData/testCoreDataBuild-fgvttsutxgjcnsdctcceutmrilfn/Build/Products/Debug-iphoneos/testCoreDataBuild.app/testCoreDataBuild.momd

**dyld: Library not loaded: /usr/lib/libwep**
  Referenced from: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Xcode/Agents/cdtool
  Reason: no suitable image found.  Did find:
    /usr/lib/libwep: mach-o, but not built for iOS simulator
    /usr/lib/libwep: mach-o, but not built for iOS simulator
    /usr/lib/libwep: mach-o, but not built for iOS simulator
2015-04-09 12:05:53.827 momc[9451:343369] *** -[NSKeyedUnarchiver initForReadingWithData:]: data is empty; did you forget to send -finishEncoding to the NSKeyedArchiver?
/Users/paolo/Workspace/Apps/testCoreDataBuild/testCoreDataBuild/testCoreDataBuild.xcdatamodeld:0: error: Compilation failed for data model at path '/Users/paolo/Library/Developer/Xcode/DerivedData/testCoreDataBuild-fgvttsutxgjcnsdctcceutmrilfn/Build/Products/Debug-iphoneos/testCoreDataBuild.app/testCoreDataBuild.momd/testCoreDataBuild.mom'

I updated to XCode 6.3, restarted the system, cleaned Derived Data, etc. This error is for a fresh new project with just one dummy entity.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Websense as mentioned is the cause of the issue.

Friday, I spoke with an Apple engineer who was a little less informative than the following link, but non the less made it clear Websense needs to be changed: -

From https://forums.developer.apple.com/thread/7862:

Unfortunately, there's no workaround that I can provide to you. I don't have access to WebSense in order to inspect what it's doing to the system to inject its code. If you could provide more information about how WebSense operates, I could possibly help figure out a workaround for you.

Other software uses DYLD_INSERT_LIBRARIES in order to inject 3rd party code which interposes system libraries. In cases like that, you could work around it by unsetting DYLD_INSERT_LIBRARIES for certain processes. However, the crash log indicates that this isn't the method that WebSense is using to inject its code. The log indicates that the main executable has a dependency on /usr/lib/libwep (which it doesn't), so I wonder if some kext is involved with this.

You're seeing this issue now because certain parts of Xcode are running with tightened security measures called library validation. The system will only allow processes with LV enabled to use libraries that are provided by the OS or which have the same team identifier as the main executable's code signature.

Any executable which requires library validation will fail to run on systems with WebSense. This problem is not unique to Xcode, Simulator, Instruments, and IB. It's just that Xcode 7 is one of the first adopters of library validation.

I suggest that you reach out to WebSense to report the problem and request an update that won't inject their library into LV-enabled processes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...