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

Podfile excluding headers #71

Closed
parrots opened this issue Sep 11, 2014 · 10 comments
Closed

Podfile excluding headers #71

parrots opened this issue Sep 11, 2014 · 10 comments

Comments

@parrots
Copy link

parrots commented Sep 11, 2014

Zipzap has been changed to include a list of public headers in the podspec and the only one listed is zipzap.h. Unfortunately this means that the headers that one references aren't exported. Removing the public_headers line fixes the issue, but I'd assume adding the list of all headers an external project should be able to use would fix this too.

Steps to reproduce:

  • Create a new project in Xcode
  • Add a Podfile with zipzap listed as the only pod
  • Run pod install
  • Add the import for zipzap.h to any class in the project
  • Build
  • Observe error in zipzap.h: "ZZArchive.h file not found"
@laiso
Copy link
Contributor

laiso commented Sep 11, 2014

I am getting the same problem too.

Also, show the build failures at @throw in my code.
I think it's need a rewrite of podspec.

https://github.com/pixelglow/zipzap/blob/master/zipzap.podspec.json

 "public_header_files": "zipzap/zipzap.h",
// ...
"OTHER_CPLUSPLUSFLAGS": "-fno-exceptions"

@pixelglow
Copy link
Owner

@parrots @laiso I'll look into the podspec issue.

@laiso you also have issues with @throw? The library does not support exceptions passing through the code, you would have to use the usual "return nil/NO and set error" paradigm that Cocoa itself uses instead of exceptions. If your callbacks don't let exceptions escape, that should be fine. Please raise a new issue if you can isolate a minimal bad build.

@laiso
Copy link
Contributor

laiso commented Sep 11, 2014

@pixelglow You got that right. I'm considering rewrite a code to an error object handling.

@chrisze
Copy link

chrisze commented Sep 11, 2014

@pixelglow : I'm having the same problems with exceptions and headers in our project as well; the latest zipzap pod disables objective-c exceptions globally, so our app no longer compiles (we have 3rd party code which does use exceptions and it's not feasible for us to re-write it).

The easiest way to reproduce the problem is to create a new project with objective-c exceptions enabled (the default), add some dummy @try @catch block, and add zipzap to the podfile.

Thanks for the great library. It's pleasure to use.

@chrisze
Copy link

chrisze commented Sep 18, 2014

@pixelglow : do you know of a workaround for these two problems?

laiso added a commit to laiso/zipzap that referenced this issue Sep 18, 2014
pixelglow added a commit that referenced this issue Sep 18, 2014
Fix #71 : Add headers to podspec.
@zygoat
Copy link
Contributor

zygoat commented Sep 18, 2014

d2d8454 seems to solve the header include problem, but not the project-wide disabling of Obj-C exceptions. Like @chrisze we have a few @Try / @catches elsewhere in our project and it's not feasible to immediately re-write a bunch of other code simply to satisfy this one unrelated dependency.

@zygoat
Copy link
Contributor

zygoat commented Sep 18, 2014

Actually, my complaint may have been premature. Looking at our build settings, it appears we had been relying on the top-level default of GCC_ENABLE_OBJC_EXCEPTIONS = YES (which was then overridden to be NO in Pods.xcconfig due to zipzap). However, it was not explicitly set at the project or target level. Doing so there seems to resolve the issue.

@laiso
Copy link
Contributor

laiso commented Sep 19, 2014

@chrisze You can manually set the GCC_ENABLE_OBJC_EXCEPTIONS.
2014-09-19 11 55 40 am

@laiso
Copy link
Contributor

laiso commented Sep 19, 2014

I seem somewhat obscure the project-wide disabling of Obj-C exceptions, me too.

@chrisze
Copy link

chrisze commented Sep 19, 2014

Thanks @laiso. Yes, this does solve the problem. The only remaining issue is that those settings get reverted back when your run pod install again, but that's merely a nuisance.

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

5 participants