birdofpreyru / react-native-static-server

Embedded HTTP server for React Native
https://dr.pogodin.studio/docs/react-native-static-server
Other
142 stars 22 forks source link

Mac M1 start ios compilation failed #25

Closed ZoeLeee closed 1 year ago

ZoeLeee commented 1 year ago

CompileC /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/Objects-normal/arm64/RCTImageEditingManager.o /Users/lizhou/projects/react-native-static-server/example/node_modules/react-native/Libraries/Image/RCTImageEditingManager.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-RCTImage' from project 'Pods')
    cd /Users/lizhou/projects/react-native-static-server/example/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target arm64-apple-ios12.4-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=c++1z -stdlib\=libc++ -fobjc-arc -fmodules -fmodules-cache-path\=/Users/lizhou/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/lizhou/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -fobjc-abi-version\=2 -fobjc-legacy-dispatch -index-store-path /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Index.noindex/DataStore -iquote /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/React-RCTImage-generated-files.hmap -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/React-RCTImage-own-target-headers.hmap -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/React-RCTImage-all-non-framework-target-headers.hmap -ivfsoverlay /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/all-product-headers.yaml -iquote /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/React-RCTImage-project-headers.hmap -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Products/Debug-iphonesimulator/React-RCTImage/include -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/DoubleConversion -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/FBLazyVector -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/RCT-Folly -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/RCTRequired -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/RCTTypeSafety -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-Codegen -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-Core -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-callinvoker -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-cxxreact -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-hermes -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-jsi -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-jsiexecutor -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-jsinspector -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-logger -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-perflogger -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-runtimeexecutor -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/ReactCommon -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/Yoga -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/fmt -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/glog -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/hermes-engine -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/libevent -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/RCT-Folly -I/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React-Codegen/react/renderer/components -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Products/Debug-iphonesimulator/React-Codegen/React_Codegen.framework/Headers -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/DerivedSources-normal/arm64 -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/DerivedSources/arm64 -I/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/DerivedSources -F/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Products/Debug-iphonesimulator/React-RCTImage -F/Users/lizhou/projects/react-native-static-server/example/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -fmodule-map-file\=/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -fmodule-map-file\=/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React/React-Core.modulemap -fmodule-map-file\=/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -fmodule-map-file\=/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/React_Codegen/React-Codegen.modulemap -fmodule-map-file\=/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -fmodule-map-file\=/Users/lizhou/projects/react-native-static-server/example/ios/Pods/Headers/Public/yoga/Yoga.modulemap -DFOLLY_NO_CONFIG -DFOLLY_MOBILE\=1 -DFOLLY_USE_LIBCPP\=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness -include /Users/lizhou/projects/react-native-static-server/example/ios/Pods/Target\ Support\ Files/React-RCTImage/React-RCTImage-prefix.pch -MMD -MT dependencies -MF /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/Objects-normal/arm64/RCTImageEditingManager.d --serialize-diagnostics /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/Objects-normal/arm64/RCTImageEditingManager.dia -c /Users/lizhou/projects/react-native-static-server/example/node_modules/react-native/Libraries/Image/RCTImageEditingManager.mm -o /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTImage.build/Objects-normal/arm64/RCTImageEditingManager.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/React-RCTImage.build/Objects-normal/arm64/RCTImageEditingManager.o

warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ReactNativeStaticServerExample' from project 'ReactNativeStaticServerExample')
warning: Run script build phase 'Bundle React Native code and images' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ReactNativeStaticServerExample' from project 'ReactNativeStaticServerExample')
warning: Run script build phase '[CP-User] Build native dependencies' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'dr-pogodin-react-native-static-server' from project 'Pods')

** BUILD FAILED **

The following build commands failed:
        PhaseScriptExecution [CP-User]\ Build\ native\ dependencies /Users/lizhou/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-etvurltdxamzwabsxvfqdydflxzs/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/dr-pogodin-react-native-static-server.build/Script-46EB2E00019540.sh (in target 'dr-pogodin-react-native-static-server' from project 'Pods')
(1 failure)
System:
    OS: macOS 13.2.1
    CPU: (8) arm64 Apple M1
    Memory: 117.09 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
    Watchman: 2023.03.13.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.12.0 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: Not Found
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.4 => 0.71.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
birdofpreyru commented 1 year ago

Hey @ZoeLeee , can you get detailed logs from the failed build step (like that)? From what you posted so far, it is non-obvious, why exactly it failed for you.

charlyschulte commented 1 year ago

i have the same problem, but cant click on the error message. if i click on the "Command PhaseScriptExecution failed with a nonzero exit code" i get nothing. event clicking on "open build log" does nothing

birdofpreyru commented 1 year ago

Hey guys, can you try again with v0.7.4, which I just released? For me iOS builds were also working in previous versions, but while working on v0.7.4 I found and fixed a subtle bug in CMake config, which caused PCRE2 and Lighttpd libraries being built only for a single architecture (effectively, for the first one in the list of target archs specified by Xcode). I wonder that was causing problems for you.

charlyschulte commented 1 year ago

yes, it works for me. thanks :)

birdofpreyru commented 1 year ago

Awesome! :partying_face: Thanks for confirming, I'll close the issue then.

owen800q commented 1 year ago

@birdofpreyru I found this issue happened again after upgraded to v0.7.5, you can reproduce it with example project.

And I just downgraded to 0.7.4, then can build the project without any issue

System:
    OS: macOS 12.3.1
    CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 802.61 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.11.1 - ~/Programming/Javascript/node-16.11.1/bin/node
    Yarn: 1.22.17 - ~/Programming/Javascript/node-16.11.1/bin/yarn
    npm: 8.0.0 - ~/Programming/Javascript/node-16.11.1/bin/npm
    Watchman: 2022.03.21.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/kwan/.rvm/gems/ruby-3.0.0/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
    Android SDK:
      API Levels: 31, 33, 33
      Build Tools: 30.0.2, 33.0.2, 34.0.0
      System Images: android-28 | Google APIs Intel x86 Atom, android-30 | Google APIs Intel x86 Atom, android-33 | Google APIs Intel x86_64 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: Electric Eel 2022.1.1 Patch 2 Electric Eel 2022.1.1 Patch 2
    Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.7 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.4 => 0.71.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
 Argument not separated from preceding token by whitespace.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:1 (project):
  cmake_minimum_required() should be called prior to this top-level project()
  call.  Please see the cmake-commands(7) manual for usage documentation of
  both commands.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- The C compiler identification is AppleClang 13.1.6.13160021
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
CMake Warning:
  Ignoring extra path from command line:

   "/Users/kwan/Programming/Javascript/react/react-native/react-native-static-server/pcre2"

CMake Error: The source directory "/Users/kwan/Programming/Javascript/react/react-native/react-native-static-server/pcre2" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: /Users/kwan/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-bdtrahgwvhpetqahjbuzcopsvdjn/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/dr-pogodin-react-native-static-server.build/pcre2 is not a directory
CMake Error at CMakeLists.txt:114 (add_subdirectory):
  The source directory

    /Users/kwan/Programming/Javascript/react/react-native/react-native-static-server/lighttpd1.4

  does not contain a CMakeLists.txt file.

-- Configuring incomplete, errors occurred!
Command PhaseScriptExecution failed with a nonzero exit code
birdofpreyru commented 1 year ago

@owen800q I don't think I changed anything between v0.7.4 and v0.7.5 that could impact that part of the build; and also your logs read like PCRE2 and Lighttpd sources are just missing in the package. Can it be that v0.7.5 you tried to install directly from the Git repo, and you did not do git submodule update --init --recursive, which is necessary in such scenario to get those sources?

owen800q commented 1 year ago

@birdofpreyru yes, you are right, just because when I build the example project, missing running

git submodule update --init --recursive

ok now, thanks for your responsive feedback

birdofpreyru commented 1 year ago

Yeah... I should update the example's README to mention this step is needed, as the example is setup differently from a real-world project, to use the library code from the parent folder, rather than from node modules installed from NPM.

hanwong commented 1 month ago

i have same issue when i have tried with example codes in this repo or useing v 0.15.1 in my project.

device: Apple M1 Pro os: macOS Sonoma 14.5 node: v20.13.1

The following build commands failed:
    PhaseScriptExecution [CP-User]\ Build\ native\ dependencies /Users/samuel/Library/Developer/Xcode/DerivedData/ReactNativeStaticServerExample-ailikpjkujixsjbynkqoltdnpnvl/Build/Intermediates.noindex/Pods.build/Custom-iphoneos/dr-pogodin-react-native-static-server.build/Script-46EB2E00013A70.sh (in target 'dr-pogodin-react-native-static-server' from project 'Pods')
(1 failure)
birdofpreyru commented 1 month ago

There should be more specific error details somewhere in the log. Are you sure, it is not https://github.com/birdofpreyru/react-native-static-server/issues/111 you experience (the latest CMake v3.30.0 breaks library builds, because of a presumed regression on CMake side)?

hanwong commented 1 month ago

There should be more specific error details somewhere in the log. Are you sure, it is not #111 you experience (the latest CMake v3.30.0 breaks library builds, because of a presumed regression on CMake side)?

Thanks yes it was cmake issue.