GNOME Bugzilla – Bug 763999
NDK_HOST_SED no longer set in Android NDK 11b
Last modified: 2016-03-29 07:27:37 UTC
On recent cerbero builds with Android NDK 11, it appears the HOST_SED issue has reappeared in a slightly different form; I'm seeing similar build breaks to what we saw in https://bugzilla.gnome.org/show_bug.cgi?id=750162: WARNING: Error importing command bundlesource: No module named setuptools.sandbox Android NDK: WARNING: APP_PLATFORM android-23 is larger than android:minSdkVersion 19 in /build/srio-camera/AndroidManifest.xml make: -n: Command not found /bin/sh: 0: Illegal option - [...] In that bug, we fixed the issue by setting HOST_SED via NDK_HOST_SED. Unfortunately, it looks like NDK_HOST_SED is no longer set either (and sed is no longer in prebuilt/linux-x86_64/bin), causing builds to again fail with the same issues we used to see in the previous bug. Just to confirm the theory that sed is the culprit here, I tested the below patch (obviously not one we would want to commit) and it fixed the issue. Now, we could easily just set "HOST_SED := sed" and remove the current logic, but I'm wondering how we can make this work in a cross-platform way. I'm open to suggestions and am happy to help write and test a patch for a suggested approach. Test patch: --- a/gstreamer-1.0.mk 2016-03-21 09:20:04.112243261 -0700 +++ b/gstreamer-1.0.mk 2016-03-21 09:20:17.340243653 -0700 @@ -71,6 +71,7 @@ HOST_SED := $(strip $(wildcard $(HOST_PREBUILT)/sed$(HOST_EXEEXT))) endif endif +HOST_SED := sed ifndef HOST_SED HOST_CMP := sed endif
That's indeed a problem. We could look into replacing the sed usage with something else that is shipped by the NDK. I wouldn't want to ship sed binaries for all platforms.
In the long term we should port our ndk-build Makefile stuff to gradle/groovy, but I guess for the short term some minimal sed (we only need search & replace) written in Java would do the job.
I agree with your assessment of things. I'll look into our options further if I get some time.
Actually I forgot something. We use HOST_SED, but that's just pointing to the sed of the host system. The NDK did not ship one if I'm not mistaken. And on Windows we already ship a sed.exe because of that. So as a fix for now we should probably just replicated whatever code was setting HOST_SED before in our own Makefiles.
*** Bug 764244 has been marked as a duplicate of this bug. ***
Created attachment 324829 [details] [review] ndk-build: Set SED ourselves instead of relying on Android's HOST_SED ... which disappeared with NDK r11.
Created attachment 324830 [details] [review] ndk-build: Rename HOST_PKG_CONFIG to PKG_CONFIG_PATH The HOST_ variables are from ndk-build and we should not add our own in there, it will only cause confusion.
Marcin, Martin, can you check if this works well for you too?
Works for me; thanks!
Attachment 324829 [details] pushed as cbf92b3 - ndk-build: Set SED ourselves instead of relying on Android's HOST_SED Attachment 324830 [details] pushed as 48b4b9f - ndk-build: Rename HOST_PKG_CONFIG to PKG_CONFIG_PATH