soffes / RateLimit

Simple utility for only executing code every so often.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RateLimit is not Bitcode compatible

calebd opened this issue · comments

This one is hard to explain. If I upload a build that both contains RateLimit and has Bitcode enabled I get this:

screen shot 2015-11-25 at 11 31 07 pm

Thanks to @mattbischoff, I found the following message in this developer forum thread:

To see the error, achive/export/developer enable bitcode gen. Then when it errors, click the 'view logs' button to see the problem.

And indeed there it was:

error: Ld: cd /var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/tempdVAWUo
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" "-arch" "armv7" "-dylib" "-compatibility_version" "1.0.0" "-current_version" "1.0.0.0.0" "-install_name" "@rpath/RateLimit.framework/RateLimit" "-ios_version_min" "8.0.0" "-rpath" "@executable_path/Frameworks" "-rpath" "@loader_path/Frameworks" "-dead_strip" "-application_extension" "-syslibroot" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk" "-sdk_version" "9.1.0" "-ignore_auto_link" "-allow_dead_duplicates" "1.o" "2.o" "3.o" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/usr/lib/libSystem.B.tbd" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation.tbd" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd" "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.1.sdk/usr/lib/libobjc.A.tbd" "/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/ipatool20151125-21309-1yedmou/MachOs/iphoneos/armv7/(dylibs)/libswiftCore.dylib" "/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/ipatool20151125-21309-1yedmou/MachOs/iphoneos/armv7/(dylibs)/libswiftDarwin.dylib" "/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/ipatool20151125-21309-1yedmou/MachOs/iphoneos/armv7/(dylibs)/libswiftDispatch.dylib" "/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/ipatool20151125-21309-1yedmou/MachOs/iphoneos/armv7/(dylibs)/libswiftFoundation.dylib" "/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/ipatool20151125-21309-1yedmou/MachOs/iphoneos/armv7/(dylibs)/libswiftObjectiveC.dylib" "-L" "/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/ipatool20151125-21309-1yedmou/MachOs/iphoneos/armv7/(dylibs)" "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/7.0.0/lib/darwin/libclang_rt.ios.a" "-o" "/private/var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/RateLimitkGMPU9/RateLimit.armv7.out" 
-= Output =-
Undefined symbols for architecture armv7:
  "_llvm_gcov_init", referenced from:
      ___hidden#311_ in 3.o
  "_llvm_gcda_start_file", referenced from:
      ___hidden#309_ in 3.o
  "_llvm_gcda_summary_info", referenced from:
      ___hidden#309_ in 3.o
  "_llvm_gcda_end_file", referenced from:
      ___hidden#309_ in 3.o
ld: symbol(s) not found for architecture armv7
Exited with 1


error: Failed to compile bundle: /var/folders/1g/fssqm74d49qb4m09k14h_8780000gn/T/RateLimitkGMPU9/RateLimit.armv7.xar}

I'm now trying to figure out exactly what these symbols are and why they are allegedly referenced from RateLimit. I will post back here when I know more.

Those symbols appear to be related to the GCC_GENERATE_TEST_COVERAGE_FILES build setting which is enabled. Is that needed @soffes? If not I can submit a pull request that disables that build setting.

Go for it

I don't know how to fix this. I disabled the build setting and get the same error. I can't find any other build settings and I don't see anything suspicious in the build log. @soffes can you think of any reason the compiler would emit coverage-related symbols for this framework?

No idea :(

You could try just deleting the project and making a new one maybe. It's such a simple framework. Annoying that it's causing so much trouble.

Ok. I'll take a look at it again later. Thanks!

commented

😄

I don't think that's it. I have coverage turned on in other frameworks and those do not have this problem.

I found another coverage-related build setting that was turned on that is off by default in new Xcode projects.

Both of the build settings referenced in the above commits were added in 3f34224.

Boom. Disabling those settings fixes the problem. Do you still use Slather @soffes? It appears as though these settings and Bitcode are mutually exclusive. If you want I can just revert 3f34224.

@calebd I used too. Good to know. cc @marklarr

Done

@soffes, I remember that an issue was opened for this a while back, SlatherOrg/slather#73. It sounds like we should definitely come up with a solution

Cool. Wanted to make sure you knew about it @marklarr 😄