-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
How to remove compiler warnings on Pods project? #209
Comments
Regarding the warnings, can you give me a list of all the build settings required to silence those? It’s probably time to add an option to the Podfile that will set those settings. Regarding Xcode compiling the library every time, I personally have not noticed this. Afaik the first build takes longer than subsequent ones, but I could be wrong. This would be an Xcode issue, though. |
I found one interesting build property: btw, in this twit you have mentioned
Does it mean that I could set value for
does it mean that in your projects pods compiled only once? What version of xcode and cocoapods do you use? |
That sounds like a good enough solution yes. Let’s add this in 0.6.1.
Something like this should do the trick: post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['GCC_WARN_INHIBIT_ALL_WARNINGS'] = 'YES'
end
end
end (If you are using cocoapods 0.5.1, then |
cool! It works now with this post_install hook! thanks! =) |
I think that the pods should not generate warnings. I think that the warnings should be suppressed by the podspec and the library maintainer should be asked to suppress them. |
I agree with you) |
@irrationalfab how current version should be working? As I see warnings from Pods not preventing now. Should it be fixed in current version? Or should I open a new ticket for this? btw, warnings presence could be checked with |
The podspec needs to update with the appropriate compiler flags that silence the warnings. |
see compiler_flags - https://github.com/CocoaPods/CocoaPods/wiki/The-podspec-format |
Should I do this for all specs where I meet warnings? It's not very clear imho. Than I prefer @alloy's method with post_install hook. Maybe it will be good to disable pods warnings from podfile in this way: platform :ios
silent_warnings!
dependency 'MTStatusBarOverlay' Or maybe better to disable warnings by default and enable only if What do you think guys? |
Reasonable point lets see @alloy opinion on this. |
Yeah I do think we should be able to just disable them all in one go like with |
I could do this. But I will have time only on next week (or even after next week). When release 0.6 should be released? |
Well, this is more of a feature, so it shouldn't even really be added before 0.6.0, as we should not add features during RCs imo. But any time thereafter is fine, see https://github.com/CocoaPods/CocoaPods/wiki/Release-process. |
Ok, assigned to me) |
I get the same compiler warnings as yas375 after adding the ZBarSDK Podspec to my project: https://github.com/CocoaPods/Specs/blob/master/ZBarSDK/1.2.2/ZBarSDK.podspec Inhibiting all warnings for the entire Pods project doesn't seem like an ideal solution. I'd prefer contacting the author for a patch before accepting the Podspec. |
After experiencing a bit with warnings I think that the best solution would be to add To enable the warnings to see if they meet the needs of the standards of the final user we should add the @alloy What do you think? |
@irrationalfab I don’t think it should be enabled by default. We want users to know that there are in fact warnings, because the user might find that important to know and/or might fix it and submit a patch and they can make in an informed decision. |
@alloy After I gave some thought to comment, I agree with you. |
alloy's post_install quickfix doesn't seem to work for header file warnings. I get Multiple declarations warnings from the RestKit and MagicalRecord pods. |
Mhmm, what is you issue specifically? |
@Zyphrax Any update on this? I will add this feature tonight, so it would be nice to have as much info as possible :) |
I'm a bit new to Xcode and objective-C so it might be just my noobism, but: My project is using a few Pods: RestKit, ActiveRecord and KeychainItemWrapper. Probably the best solution is to try and get the maker of the piece of code to resolve the warnings. |
@Zyphrax Ah, I see. Unfortunately I don’t know a solution for that issue… As headers aren’t compiled directly themselves, there is no way to set compiler flags for them. Your best bet is to submit a patch to the authors with the warnings fixed. |
Fixed! |
Sorry guys that I promised and didn't implement this( |
@yas375 Enjoy! :) |
* master: (21 commits) Release 0.13.0 Changelog [UserProjectIntegrator] Don't warn about overridden build settings if silent. [OpenURI] Reworked support for http to https redirects. [Podfile#podspec] Changelog and added disabled tests. [Podfile] Added Podfile#podspec. [Changelog] [UserProjectIntegrator] Check if the xcconfig files is overridden. [Linter] Detect warning disabling compiler flags. [OpenURI] Support for unsafe redirects. [inhibit_all_warningsDon't affect the final project. Release 0.12.0 [Examples] Update RKTwitter Podfile.lock [CHANGELOG] Add entry about namespacing subspecs in Pods.xcodeproj [CHANGELOG] Update for 0.12.0 [Project] Namespace subspecs in groups. Document Podfile#inhibit_all_warnings! Add Podfile#inhibit_all_warnings! to silence warnings, but not by default. #209 Changelog "[Specification] Allow to require_arc in subspecs." ...
Coult it be possbiel to inhibit warnings on specific pods? Like it is possible with specific files in xcode? http://stackoverflow.com/questions/6921884/xcode-4-how-to-suppress-all-warning-in-specific-source-file |
That would be really great when working with local pods.... |
@hfossli I didn't try it yet, but documentation says you can inhibit warnings per pod: pod 'SSZipArchive', :inhibit_warnings => true Happy coding ;) |
Sweet!! What about in a podspec with dependencies? |
@hfossli what do you mean? Could you please give a real example? |
@yas375 Ok. I'll tell you about my setup. :) AGCore uses AGServices as a pod A bit tricky to explain in a simple way... |
So basically if it is possible to write something like this in the podspec that would be sufficient.
|
@hfossli I see. Unfortunately I can't help here. Maybe someone else will answer to your question... |
If you inhibit warnings per pod, it's dependencies should also have inhibited warnings (unless you include one of them manually as well). |
@yas375 and @mneorr Well.. It's not pretty, but it works :)
I have to know every single pod AGServices is using in order for this to work. Thanks for the tip! |
If I only could do the opposite? :) |
In an ideal world users of open source libraries would just fix the warnings and submit the patch to the original project, as in 99% of the cases is trivial to do. This is one of the reason why I think that the current support for this feature is more than enough. |
@hfossli well, we might have what you need :)
|
SSToolkit 1.0.1
* master: (21 commits) Release 0.13.0 Changelog [UserProjectIntegrator] Don't warn about overridden build settings if silent. [OpenURI] Reworked support for http to https redirects. [Podfile#podspec] Changelog and added disabled tests. [Podfile] Added Podfile#podspec. [Changelog] [UserProjectIntegrator] Check if the xcconfig files is overridden. [Linter] Detect warning disabling compiler flags. [OpenURI] Support for unsafe redirects. [inhibit_all_warningsDon't affect the final project. Release 0.12.0 [Examples] Update RKTwitter Podfile.lock [CHANGELOG] Add entry about namespacing subspecs in Pods.xcodeproj [CHANGELOG] Update for 0.12.0 [Project] Namespace subspecs in groups. Document Podfile#inhibit_all_warnings! Add Podfile#inhibit_all_warnings! to silence warnings, but not by default. #209 Changelog "[Specification] Allow to require_arc in subspecs." ...
In Podfile
|
I wouldn't see warning from some pods in my workspace.
Here is my Podfile:
And when I build my application Pods project also compiled every time. Is it good? Or I missed something?
Thanks.
The text was updated successfully, but these errors were encountered: