birdofpreyru/react-native-static-server

Building Android on Windows resulted in the following error

ShaoGongBra opened this issue · 2 comments

adding property to lighttpd-angel COMPILE_FLAGS: -DSBIN_DIR="C:/Program Files (x86)/rn-static-server/sbin"
CMake Error at lighttpd1.4/scripts/cmake/LighttpdMacros.cmake:37 (foreach):
Syntax error in cmake code at

D:/project/screenpublishapp/node_modules/@dr.pogodin/react-native-static-server/lighttpd1.4/scripts/cmake/LighttpdMacros.cmake:37

when parsing string

Process failed because: %1 不是有效的 Win32 应用程序。for command: D:\project\screenpublishapp\node_modules\@dr.pogodin\react-native-static-server\android\.cxx\Debug\4s5s6w42\x86_64\sysroot\bin\pcre2-config --cflags

Invalid character escape '\p'.
Call Stack (most recent call first):
lighttpd1.4/src/CMakeLists.txt:1064 (add_target_properties)

I had a brief look on it. The issue happens here:

https://github.com/birdofpreyru/lighttpd1.4/blob/ec31534cb9d0eba386c4be2753eda0482263bf0c/src/CMakeLists.txt#L547-L554

  • PRCE2 itself seems to build fine for the target Android arch, and it can be found inside android/.cxx/.../.../.../sysroot folder of library directory.
  • When Lighttpd builds, at the lines I referenced above, it somehow can't locate pre-built PCRE2 using pkg_check_modules() command, thus it falls through to attempt locating it with xconfig(pcre2-config ...) command, and it does not work because in that case it somehow finds pcre2-config inside android/.cxx/.../.../.../sysroot/bin/pcre2-config, tries to run it, and fails as was build for Android.

As of now, I don't have much interest to spend my time trying to figure out how to correct it for Android builds on Windows, without breaking builds for other platforms / targets. Probably, the Windows > Android builds requires to configure something different in https://github.com/birdofpreyru/react-native-static-server/blob/master/CMakeLists.txt , which contains a bunch of platform / target specific configs, which are picked up by Lighttpd build down the line.

Thus, I'll mark this ticket as On Hold, and not planning to do anything further in the foreseeable future. My best advise is to do Android-aiming builds on Ubuntu or macOS host. Mind as well that (#20) Android-aiming builds on Windows with the new RN architecture do not work anyway for different reasons (bugs in RN itself).

In other words, prior to a further notice the Android builds on Windows host are not officially supported.

Thank you, I will test it with macos tomorrow