Closed jpv3dts closed 1 year ago
Hey @jpv3dts , please provide the log output from the failed command. It sounds like an error in the library build setup, I am still working on getting it right across all systems.
I did not build it using a command. I tried to build it in Xcode. The output in my initial message is all that I can see. Is there a way to get more detailed output? Because I'd be more than happy to provide it.
Yes. I don't have Xcode in front of me right now; but when you go into selected build logs, on each log message you see in the main panel, I believe there is a small icon in the right part with three horizontal bars, clicking on which will expand that message showing you all underlying output of that command / step; also there is a filter to see only messages from errored-out steps.
I'll check and get back to you.
Do you want the output from All Messages, All Issues or Errors Only?
Click Errors Only, then you'll be able to easily find that "Command PhaseScriptExecution" operation that failed. Expand it, and give me the full output from that specific failed command.
/Users/jpvisser/Library/Developer/Xcode/DerivedData/local_server-etujkujuudxjgccctkepmxuqqhdk/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/dr-pogodin-react-native-static-server.build/Script-46EB2E00019540.sh: line 3: cmake: command not found Command PhaseScriptExecution failed with a nonzero exit code
Here you go.
I see that it can't find CMake, which does not make sense to me, because I have it installed. Is it perhaps necessary to set a path somewhere?
Yeah... correct, it can't execute CMake. Does not make much sense to me either, as you say that it works for you when building for iOS simulator. Though, I guess, it should be something about your setup / user permissions on your machine that makes it fail.
It looks like you have to to troubleshoot it yourself. Look, the stuff you copied above, you can copy it (starting from export ACTION=build
) into your console, and thus run this step alone, as XCode would try to execute it. That stuff is a definition of all environment variables XCode environment has, followed by execution of shell script for that failing step: /Users/jpvisser/Library/Developer/Xcode/DerivedData/local_server-etujkujuudxjgccctkepmxuqqhdk/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/dr-pogodin-react-native-static-server.build/Script-46EB2E00019540.sh
. The script itself shoul be just a copy of this code from the library. That code just uses CMake to build PCRE2 and Lighttpd from sources. So, I suggest you to play with it, to figure out why it can't find CMake there. Probably its location is not in PATH in that case, or there something wrong with permissions, etc.
On my machine the current library version builds fine for real iOS device, and I have XCode installed in the most standard way, and CMake I have installed via Homebrew, also in the most standard way.
I resolved the issue by replacing "cmake" in the build script with the absolute path to the CMake executable, but now I get this error:
-- Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE) . . . CMake Error at lighttpd1.4/src/CMakeLists.txt:574 (message): pcre2.h couldn't be found
It appears that it can't find pkg-config. Would it be possible to set the absolute path to it somewhere as well?
Or a better question: Do you have any idea why my Xcode cannot find the executables that your package uses? 😂
I solved the issue of CMake not being found by specifiying the absolute path to it.
Well, that script is re-generated on each build, thus to really solve it, I guess you should ensure CMake location is added to your system's PATH.
It appears that it can't find pkg-config. Would it be possible to set the absolute path to it somewhere as well?
Probably, it is fine and iPhone SDK indeed does not have pkg-config
. The library, kind of, still supposed to find and link in the PCRE2 library it builds from sources itself, but that piece is fragile — depending on how stuff is installed on each system, it seems to break easily. I am currently re-implementing that piece trying to resolve #20 , so hopefully the next release will solve issues with PCRE2 linking. In the meantime you can workaround adding -DWITH_PCRE2=OFF
argument here (or directly into the script you was editing earlier; mind, if you edit it in .podspec
in library sources in your node_modules
, then you should do pod install
in ios
folder of your project to cause XCode to re-generate that build script).
Thank you, this works. Thank you very much for the help, I really appreciate it.
Also, thank you for maintaining this project. Besides this issue, this is one of the more niche packages that's been the most hassle free to use.
v0.7.2 (just released), presumably, fixes the issue with PCRE2 linking (at least, I re-worked the way it happens, and tested it works for me, in particular, for iOS builds on Mac; however, the previous setup also worked fine on my system, thus don't hesitate to open a new issue if it still does not work for you). The problem with CMake, in my current understanding, was due to its location absent in your PATH, thus not a problem with the library. Thus, I guess, this issue is probably resolved, and I'll close it for now.
My React Native app works fine in both the iOS and Android simulators, but when I try to build and install the app via Xcode onto an actual iPhone, I get this error:
dr-pogodin-react-native-static-server Command PhaseScriptExecution failed with a nonzero exit code
Can anyone help me with this?