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

Swift-Nio-SSL podspec issue #492

Open
ayush-yadav001 opened this issue Nov 20, 2024 · 7 comments
Open

Swift-Nio-SSL podspec issue #492

ayush-yadav001 opened this issue Nov 20, 2024 · 7 comments

Comments

@ayush-yadav001
Copy link

Hi ,
Our project still support Cocoapods and addition of PrivacyInfo.xcprivacy will make us to move the latest version of swift nio ssl else it may reject the application . due to that i am trying to create podspec of swift nio ssl with latest version but facing issue while trying to push at private url hosting using pod repo push .
After trying so many thing i still facing an error i am posting the podspec and error please help me to create a working podspec.

Pod::Spec.new do |s|
  s.name = 'CNIOBoringSSL'
  s.version = '2.29.0'
  s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
  s.summary = 'TLS Support for SwiftNIO, based on BoringSSL.'
  s.homepage = 'https://github.com/apple/swift-nio-ssl'
  s.author = 'Apple Inc.'
  s.source = { :git => 'https://github.com/apple/swift-nio-ssl.git', :tag => s.version.to_s }
  s.documentation_url = 'https://apple.github.io/swift-nio-ssl/'
  s.module_name = 'CNIOBoringSSL'

  s.swift_version = '5.4'
  s.cocoapods_version = '>=1.6.0'
  s.ios.deployment_target = '12.0'
  s.osx.deployment_target = '10.13'

  s.compiler_flags = '-D_GNU_SOURCE', '-D_POSIX_C_SOURCE=200112L','-D_DARWIN_C_SOURCE'

  s.source_files = 'Sources/CNIOBoringSSL/**/*.{swift,c,h,cc}'
  s.ios.source_files = 'Sources/CNIOBoringSSL/**/*.S'
  s.osx.source_files = 'Sources/CNIOBoringSSL/**/*.S'
  s.tvos.source_files = 'Sources/CNIOBoringSSL/**/*.S'

 
  s.public_header_files = 'Sources/CNIOBoringSSL/include/**/*.h'
  
  s.libraries = 'c++'
  s.pod_target_xcconfig = { 'HEADER_SEARCH_PATHS' => 'Sources/CNIOBoringSSL/include', 'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14', 'CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES' => 'YES' }
end

**ERROR **

CNIOBoringSSL/Sources/CNIOBoringSSL/ssl/ssl_key_share.cc:28:10: fatal error: 'experimental/CNIOBoringSSL_kyber.h' file not found

@Lukasa
Copy link
Contributor

Lukasa commented Nov 20, 2024

It’s likely that the header in question hasn’t been included. Check the source files directives to confirm whether that path is actually included.

@ayush-yadav001
Copy link
Author

path for experimental/CNIOBoringSSL_kyber.h is Sources/CNIOBoringSSL/include/experimental/CNIOBoringSSL_kyber.h it should include with this path s.source_files = 'Sources/CNIOBoringSSL/**/*.{swift,c,h,cc}' am i missing something here?

@Lukasa
Copy link
Contributor

Lukasa commented Nov 20, 2024

I would expect it to be included, yes. The next question is whether the include path has been set up appropriately. Do you have the compile invocation that failed?

@ayush-yadav001
Copy link
Author

ayush-yadav001 commented Nov 28, 2024

@Lukasa i have tried checking in framework headers directory s.public_header_files = 'Sources/CNIOBoringSSL/include/**/*.h' this includes all the header files.
the problem looks like with s.source_files = 'Sources/CNIOBoringSSL/**/*.{swift,c,h,cc}' it includes all the files but it flatten the hierarchy of directory can be a issue .
since removing experimental from include <experimental/CNIOBoringSSL_kyber.h>.h> will resolving the compiling issue. what can be the possible solution here any help will be really helpful.
Thank you.

i have tried this already which didn't help me removing error so far : (and this will be applicable on all pod dependency can lead other issue)

 install! 'cocoapods',
  :preserve_pod_file_structure => true

cc: @glbrntt

@Lukasa
Copy link
Contributor

Lukasa commented Nov 28, 2024

I'm afraid I'm not sure how to prevent the flattening. The easiest thing to do might be to modify the source code by using sed to remove the extra nesting.

@ayush-yadav001
Copy link
Author

@Lukasa how to use sed in podspec do you have any example for this or where i can add this to resolve this issue.
i dont have any exposure to sed command
thanks in advance.

@Lukasa
Copy link
Contributor

Lukasa commented Dec 6, 2024

You wouldn't use sed in the podspec, I don't think, but in the actual submitted code. Otherwise this has to be a question for the Cocoapods community: we stopped supporting Cocoapods for distribution some time ago, and I'm afraid I'm not an expert so I don't know how to fix it.

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

2 participants