react-native icon indicating copy to clipboard operation
react-native copied to clipboard

RCTFolly Time.h overriding system time.h

Open vukan-m opened this issue 1 year ago • 3 comments

Description

I am trying to add new pod to my project and when i install it, it fails to compile giving the following error: **/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/api/c-participant.h:25:10: note: in file included from **/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/api/c-participant.h:25: #include "time.h" ^ **/ios/Pods/RCT-Folly/folly/portability/Time.h:22:10: error: 'folly/portability/Config.h' file not found #include <folly/portability/Config.h> ^ **/ios/Pods/linphone-sdk/linphone-sdk/apple-darwin/share/linphonesw/LinphoneWrapper.swift:21:8: error: could not build Objective-C module 'linphone' import linphone

The problem is that #include "time.h" somehow includes folly Time.h instead of system time.h

Im using react native 0.74.3

Steps to reproduce

  1. Create new react native project with version 0.74.3
  2. Add the following to Podfile:source "https://gitlab.linphone.org/BC/public/podspec.git" source "https://github.com/CocoaPods/Specs.git" pod "linphone-sdk", "5.3.71"
  3. Run pod install and try to build the project

React Native Version

0.74.3

Affected Platforms

Runtime - iOS, Build - MacOS

Output of npx react-native info

System:
  OS: macOS 14.5
  CPU: (8) arm64 Apple M1
  Memory: 102.56 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 20.15.0
    path: /usr/local/bin/node
  Yarn:
    version: 1.22.19
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.7.0
    path: /usr/local/bin/npm
  Watchman:
    version: 2024.07.15.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.14.3
    path: /Users/vukan/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "21"
      - "28"
      - "29"
      - "30"
      - "31"
      - "33"
      - "34"
    Build Tools:
      - 26.0.0
      - 30.0.2
      - 30.0.3
      - 31.0.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-21 | Android TV ARM EABI v7a
      - android-21 | Android TV Intel x86 Atom
      - android-21 | ARM 64 v8a
      - android-21 | ARM EABI v7a
      - android-21 | Intel x86 Atom
      - android-21 | Intel x86_64 Atom
      - android-21 | Google APIs ARM 64 v8a
      - android-21 | Google APIs ARM EABI v7a
      - android-21 | Google APIs Intel x86 Atom
      - android-21 | Google APIs Intel x86_64 Atom
      - android-27 | ARM 64 v8a
      - android-27 | Google APIs ARM 64 v8a
      - android-28 | Google ARM64-V8a Play ARM 64 v8a
      - android-31 | Google APIs ARM 64 v8a
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-34 | Google Play ARM 64 v8a
    Android NDK: 25.1.8937393
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11842104
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.2.2
    path: /Users/vukan/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.74.3
    wanted: 0.74.3
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

SwiftEmitModule normal arm64 Emitting\ module\ for\ linphonesw (in target 'linphone-sdk' from project 'Pods')
    cd /Users/vukan/Documents/Projects/linphoneTest/ios/Pods
    builtin-swiftTaskExecution -- /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types /Users/vukan/Documents/Projects/linphoneTest/ios/Pods/linphone-sdk/linphone-sdk/apple-darwin/share/linphonesw/LinphoneWrapper.swift -target arm64-apple-ios13.4 -Xllvm -aarch64-use-tbi -enable-objc-interop -stack-check -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -I /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/linphone-sdk -F /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/linphone-sdk -F /Users/vukan/Documents/Projects/linphoneTest/ios/Pods/linphone-sdk/linphone-sdk/apple-darwin/XCFrameworks -F /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk -no-color-diagnostics -enable-testing -g -import-underlying-module -module-cache-path /Users/vukan/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -swift-version 4 -enforce-exclusivity\=checked -Onone -D DEBUG -D COCOAPODS -serialize-debugging-options -const-gather-protocols-file /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphone-sdk_const_extract_protocols.json -enable-bare-slash-regex -empty-abi-descriptor -validate-clang-modules-once -clang-build-session-file /Users/vukan/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/vukan/Documents/Projects/linphoneTest/ios/Pods -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -fmodule-map-file\=/Users/vukan/Documents/Projects/linphoneTest/ios/Pods/Headers/Public/linphonesw/linphone-sdk.modulemap -Xcc -ivfsstatcache -Xcc /Users/vukan/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos17.5-21F77-f6b513226ab75d8b6e514a3d72c62b80.sdkstatcache -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/linphone-sdk-generated-files.hmap -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/linphone-sdk-own-target-headers.hmap -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/linphone-sdk-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/linphone-sdk-project-headers.hmap -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/linphone-sdk/include -Xcc -I/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/usr/include -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/DerivedSources-normal/arm64 -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/DerivedSources/arm64 -Xcc -I/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/DerivedSources -Xcc -DPOD_CONFIGURATION_DEBUG\=1 -Xcc -DDEBUG\=1 -Xcc -DCOCOAPODS\=1 -module-name linphonesw -disable-clang-spi -target-sdk-version 17.5 -target-sdk-name iphoneos17.5 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/usr/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/usr/local/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/local/lib/swift/host/plugins\#/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins -emit-module-doc-path /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphonesw.swiftdoc -emit-module-source-info-path /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphonesw.swiftsourceinfo -emit-objc-header-path /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphonesw-Swift.h -serialize-diagnostics-path /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphone-sdk-master-emit-module.dia -emit-dependencies-path /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphone-sdk-master-emit-module.d -parse-as-library -o /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphonesw.swiftmodule -emit-abi-descriptor-path /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/linphone-sdk.build/Objects-normal/arm64/linphonesw.abi.json

<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Modules/swift-umbrella.h"
        ^
/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Modules/swift-umbrella.h:28:9: note: in file included from /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Modules/swift-umbrella.h:28:
#import "linphone/core.h"
        ^
/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/core.h:67:10: note: in file included from /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/core.h:67:
#include "linphone/api/c-api.h"
         ^
/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/api/c-api.h:64:10: note: in file included from /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/api/c-api.h:64:
#include "linphone/api/c-participant.h"
         ^
/Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/api/c-participant.h:25:10: note: in file included from /Users/vukan/Library/Developer/Xcode/DerivedData/linphoneTest-cjhywuyzeugruxdthesguejymwjq/Build/Products/Debug-iphoneos/XCFrameworkIntermediates/linphone-sdk/linphone.framework/Headers/api/c-participant.h:25:
#include "time.h"
         ^
/Users/vukan/Documents/Projects/linphoneTest/ios/Pods/RCT-Folly/folly/portability/Time.h:22:10: error: 'folly/portability/Config.h' file not found
#include <folly/portability/Config.h>
         ^
/Users/vukan/Documents/Projects/linphoneTest/ios/Pods/linphone-sdk/linphone-sdk/apple-darwin/share/linphonesw/LinphoneWrapper.swift:21:8: error: could not build Objective-C module 'linphone'
import linphone
       ^

Reproducer

https://github.com/vukan-m/follyReproduce

Screenshots and Videos

No response

vukan-m avatar Sep 05 '24 06:09 vukan-m

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - 0.74.5. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

react-native-bot avatar Sep 05 '24 06:09 react-native-bot

:warning: Newer Version of React Native is Available!
:information_source: You are on a supported minor version, but it looks like there's a newer patch available - undefined. Please upgrade to the highest patch for your minor or latest and verify if the issue persists (alternatively, create a new project and repro the issue in it). If it does not repro, please let us know so we can close out this issue. This helps us ensure we are looking at issues that still exist in the most recent releases.

react-native-bot avatar Sep 05 '24 06:09 react-native-bot

By changing linphone-sdk pod build settings, changing "Use Header Maps" to No, build succeeds

vukan-m avatar Sep 05 '24 10:09 vukan-m

Closing as the author found a solution

cipolleschi avatar Sep 09 '24 11:09 cipolleschi