onmyway133 / Arcane

:trident: CommonCrypto in Swift, and more
https://onmyway133.github.io/
Other
283 stars 22 forks source link

Header '/usr/include/CommonCrypto/CommonCrypto.h' not found #4

Closed fpg1503 closed 8 years ago

fpg1503 commented 8 years ago

Whenever I try to compile a project using Arcane I get the following error on CCommonCrypto/module.modulemap:

(...)/Pods/Arcane/Sources/CCommonCrypto/module.modulemap:2:10: Header '/usr/include/CommonCrypto/CommonCrypto.h' not found

I'm using it as a pod dependecy. What am I doing wrong?

onmyway133 commented 8 years ago

@fpg1503 Hi, I don't get that problem. Can you run

pod repo update
pod install

again with pod 'Arcane', git: 'https://github.com/onmyway133/Arcane' in your Podfile?

Which iOS version are you running on?

fpg1503 commented 8 years ago

I'm running on iOS 9.3. Since I'm using as a dependency so I have s.dependecy 'Arcane in my .podspec. It resolves to this podspec (which points to the 0.2.0 tag).

I've tried updating the repo, deintergrating and reinstalling the pod but it didn't help. I'm running on the iOS Simulator, can that be an issue?

fpg1503 commented 8 years ago

Here's the pod for reference: https://github.com/fpg1503/sinesp-swift (I was checking all the licenses of all my dependencies before making it public)

onmyway133 commented 8 years ago

@fpg1503 Hi, I run your project, although having problem with https://github.com/fpg1503/Regex.swift [!] Unable to find a specification forRegex.swiftdepended upon bysinesp``, but I see that I can build the project successfully, even on the simulator

I'm on cocoapods 1.0.1. Btw, this is another podspec that relies on Arcane https://github.com/hyperoslo/Flasker/blob/master/Flasker.podspec

a

fpg1503 commented 8 years ago

That's pretty weird, I'm also on cocoapods 1.0.1. If you just cloned it and ran it you're using a modified version of your pod (I've hardcoded the simulator CommonCrypto location).

I'll check what's going on with Regex.swift and what Flasker is doing that I'm not.

onmyway133 commented 8 years ago

@fpg1503 Hi, I run pod deintegrate and pod install so that your modified code is cleared. I'm on Xcode 7.3.1

fpg1503 commented 8 years ago

Yeah, I also run into this problem when running Flasker's Example and Arcane's example. I'm on

There's no include directory inside my /usr/.

onmyway133 commented 8 years ago

@fpg1503 Do you see CommonCrypto inside open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include ?

fpg1503 commented 8 years ago

@onmyway133 Yes, I do

fpg1503 commented 8 years ago

It's weird because it doesn't work on my machine but works on Travis

onmyway133 commented 8 years ago

I read on SO that some people have problem with Xcode-beta, so just to double check that my Xcode Command Line Tools is Xcode 7.3.1 and my xcodeselect -p is /Applications/Xcode.app/Contents/Developer

I just see that this https://github.com/stephencelis/SQLite.swift/blob/743530d1e56c86b5cd4df5153839a98ecb05bf5f/SQLite/module.modulemap uses modulemap approach too. Can you run their example successfully?

fpg1503 commented 8 years ago
screen shot 2016-08-22 at 6 24 25 pm

xcode-select -p /Applications/Xcode.app/Contents/Developer

Their example doesn't compile on 743530d (old Swift version) and it the modulemap was removed onmaster.

It probably has something to do with my Xcode but I'm not really sure how to fix it/avoid that other people also have that issue.

fpg1503 commented 8 years ago

Apparently they solved it by special casing for each platform: https://github.com/stephencelis/SQLite.swift/blob/master/SQLite.swift.podspec#L35

cjwirth commented 8 years ago

I don't really remember why I have the separate modulemaps in the SQLite.swift project, but IIRC, there was some Xcode update where you couldn't use the /usr/include headers, and had to use the /Applications/Xcode.app/Contents/Developer/Platforms/... headers. Then, because of that, you had to use the specific one for each platform you were building for.

So I just made the settings point at the modulemaps that were pointing to the right headers.

onmyway133 commented 8 years ago

@cjwirth many thanks. I give the credit in the PR @fpg1503 Hi, I update https://github.com/onmyway133/Arcane/pull/5 and bump to 0.3.0. Can you check if it works for you?

fpg1503 commented 8 years ago

It works beautifully!!! πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰πŸŽ‰ Thanks to all of you for the time, effort and dedication πŸ˜‰

wuf810 commented 7 years ago

Hey. I'm running Xcode 8.3.2. Trying to compile the example project and I'm getting this problem too. Has anything changed since you made this fix last August.

Any suggestions for a workaround?

onmyway133 commented 7 years ago

@wuf810 Hey, I just run the demo again. It builds OK. Can you checkout the latest version from mater?

iwasrobbed-ks commented 7 years ago

@wuf810 @onmyway133 Since the paths are hard-coded, it might break if you have Xcode betas installed or it named something other than Xcode.app (e.g. see https://github.com/onmyway133/Arcane/pull/5/files#diff-fa0f25757a80e18600824be1e1ed0d14R2)

Better to create a run script that swaps that out with whatever the SDK root variable is

wuf810 commented 7 years ago

Thanks. I don’t remember but very likely I had my XCode renamed so this makes sense. Thanks for the reply.