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

Allow podspecs to indicate that they include categories #6

Closed
lukeredpath opened this issue Sep 19, 2011 · 12 comments
Closed

Allow podspecs to indicate that they include categories #6

lukeredpath opened this issue Sep 19, 2011 · 12 comments
Milestone

Comments

@lukeredpath
Copy link
Contributor

If a library includes Objective-C categories and requires them to function correctly, we should be able to specify this in the podspec and have the ObjC and all_load linker flags added automatically.

E.g.:

We can specify which system frameworks are required by adding them to OTHER_LDFLAGS but as this is a common case I'd like to see this as a natural part of the podspec file.

Something like:

Pod::Spec.new do
  ...
  requires_objc_categories true
end
@alloy
Copy link
Member

alloy commented Sep 19, 2011

I’m wondering what the downsides are to just always adding the -ObjC -all_load flags instead of adding a method for it. Any idea if it could be a problem?

@alloy
Copy link
Member

alloy commented Sep 19, 2011

So apparently it will make the binary a bit fatter http://developer.apple.com/library/mac/#qa/qa1490/_index.html. Now the question is, how much does it add? And will most libPods builds have some dependency that enables it anyway, in which case (unless the size is a real issue) we might still be able to enable it by default anyways.

@alloy
Copy link
Member

alloy commented Oct 20, 2011

Almost all specs add these flags atm, so I’m going to make this the standard.

@alloy alloy closed this as completed in 2716b34 Oct 20, 2011
@angelolloqui
Copy link
Contributor

There is a downside that we are facing now with the all_load flag. Fat binaries including armv6 and armv7 do not work properly (duplicated class linking errors).

Please, reopen #39

siuying pushed a commit to siuying/CocoaPods that referenced this issue Apr 27, 2012
Add the '-ObjC -all_load' linker flags by default. Closes CocoaPods#6.
jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013
Reachability works on Mac, so don't restrict its platform
jzapater pushed a commit to jzapater/CocoaPods that referenced this issue Sep 17, 2013
@milesmatthias
Copy link

Has this issue been resolved for other people? I'm seeing it again even though I'm inheriting linking flags from CocoaPods...

@seivan
Copy link
Contributor

seivan commented Nov 8, 2013

Same here

@rivera-ernesto
Copy link
Contributor

I think the original proposal was good: If a Pod specifically sets requires_objc_categories, it would be easy for Cocoapods to set -force_load Pod-<specific_library>.a in a more fine-grained way than just setting -all_load for all libraries.

Also the fact that most projects follow the bad practice of blindly adding -all_load shouldn't be a reason for CocoaPods to do the same. We can do better ;)

@seivan
Copy link
Contributor

seivan commented Nov 11, 2013

I just want to clarify that if anyone else like myself have had any recent issues with like this https://t.co/YgP1Z8Xdqg
then that was because of 5.0.1 being a total douche.
Get 5.0.2

@jasperblues
Copy link

Just installed a library via CocoaPods, and had to add the all_load flag to my project manually. . . Running Xcode 5.0.2

@fabiopelosin
Copy link
Member

@jasperblues Very strange could you replicate in a demo project and open an issue referencing it?

@jasperblues
Copy link

I have a demo project here: https://github.com/jasperblues/Typhoon-example, however I've since updated the .podspec to include:

spec.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2', 'OTHER_LDFLAGS' => '-all_load' }

However, in that project if you set the version of 'Typhoon' to 1.5.3 or earlier, you should be able to observe the issue.

Is this enough info? Can you reproduce? Do you want to reopen this ticket or open a new one?

@fabiopelosin
Copy link
Member

@jasperblues It would be great if you could open a new one.

alloy added a commit that referenced this issue Oct 25, 2014
Add the '-ObjC -all_load' linker flags by default. Closes #6.
dnkoutso referenced this issue in dnkoutso/CocoaPods Sep 14, 2017
…to square-fork

* commit '079c4dc7fcdaa3da2c1be441e97fee82e19725da':
  Deduplicate test specs correctly from pod variants and targets
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

8 participants