After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763999 - NDK_HOST_SED no longer set in Android NDK 11b
NDK_HOST_SED no longer set in Android NDK 11b
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: cerbero
git master
Other Linux
: Normal blocker
: 1.8.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 764244 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-03-21 16:32 UTC by Martin Kelly
Modified: 2016-03-29 07:27 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
ndk-build: Set SED ourselves instead of relying on Android's HOST_SED (5.44 KB, patch)
2016-03-27 09:02 UTC, Sebastian Dröge (slomo)
committed Details | Review
ndk-build: Rename HOST_PKG_CONFIG to PKG_CONFIG_PATH (1.65 KB, patch)
2016-03-27 09:08 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Martin Kelly 2016-03-21 16:32:43 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
Comment 1 Sebastian Dröge (slomo) 2016-03-21 21:18:26 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2016-03-22 06:17:40 UTC
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.
Comment 3 Martin Kelly 2016-03-23 14:54:29 UTC
I agree with your assessment of things. I'll look into our options further if I get some time.
Comment 4 Sebastian Dröge (slomo) 2016-03-24 08:34:51 UTC
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.
Comment 5 Tim-Philipp Müller 2016-03-26 20:23:01 UTC
*** Bug 764244 has been marked as a duplicate of this bug. ***
Comment 6 Sebastian Dröge (slomo) 2016-03-27 09:02:35 UTC
Created attachment 324829 [details] [review]
ndk-build: Set SED ourselves instead of relying on Android's HOST_SED

... which disappeared with NDK r11.
Comment 7 Sebastian Dröge (slomo) 2016-03-27 09:08:32 UTC
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.
Comment 8 Sebastian Dröge (slomo) 2016-03-27 09:09:40 UTC
Marcin, Martin, can you check if this works well for you too?
Comment 9 Martin Kelly 2016-03-28 20:02:12 UTC
Works for me; thanks!
Comment 10 Sebastian Dröge (slomo) 2016-03-29 07:27:01 UTC
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