Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sed: 1: "Modules/Setup.local": invalid command code M #924

Closed
frankgould opened this issue Nov 12, 2016 · 11 comments
Closed

sed: 1: "Modules/Setup.local": invalid command code M #924

frankgould opened this issue Nov 12, 2016 · 11 comments

Comments

@frankgould
Copy link

I have been trying all kinds of ways to resolve this buildozer crash that fails to create the toolchain. I cannot find how to fix this problem online and tried to resolve it by looking at the attached Setup.local (txt) file that I believe is referenced in the STDOUT error listed below. I don't see where the invalid command code M materializes. I also specifically installed OpenSSL based on another forum suggestions. Buildozer is on a macOSX 10.11.6. Any suggestions are greatly appreciated. This request is related to https://groups.google.com/forum/#!topic/kivy-users/p1jKDtuyYXs and https://groups.google.com/forum/#!topic/kivy-users/p1OeBgegugA.

Setup.local.txt

RAN: '/usr/bin/sed -i s#^SSL=.*#SSL=/Users/fgould/ViewPix/Slideshow/.buildozer/android/platform/build/build/other_builds/openssl/armeabi-v7a/openssl# Modules/Setup.local'

STDOUT:
sed: 1: "Modules/Setup.local": invalid command code M

STDERR:

Command failed: python -m pythonforandroid.toolchain create

@KeyWeeUsr
Copy link
Contributor

ref #868 (comment)

@frankgould
Copy link
Author

Does this mean there is no support for OSX and I'm hosed? Is there someone who can help with this? Do I have to VM linux on Windows or Mac?

@KeyWeeUsr
Copy link
Contributor

Well, I have VM, but I don't have any apple machine to test p4a on. For Windows (10) however p4a seems to work.

@inclement
Copy link
Member

I had missed that issue isolating the openssl problem as an OS X problem. It isn't an intended behaviour and should work on OS X, so this is a bug that should be fixed.

Given the error, I guess the problem is the sed difference described at http://stackoverflow.com/questions/20773897/invalid-command-code-while-trying-to-use-grep-and-sed-to-replace-string-in-m , but I'm not immediately sure how to resolve it.

@frankgould
Copy link
Author

This is a status update: It's been 2 months since I first reported this anomaly. It's going to be another disappointing xmas because there's no way I can finish my project without being able to compile the apk. Lost my dog and now any hope of economic gain.

@frankgould
Copy link
Author

This ticket is still open but I wanted to add a comment that I ended up installing linux VM on my Windows 7 laptop and was able to compile successfully. However, now I'm battling runtime errors within the apk. Any resolution on this issue will be an alternative way to make this apk work again.

@mobrien03
Copy link

@frankgould,

A possible workaround to get you going is a reference to the following in-place-edits-with-sed-on-os-x and modifying your ".buildozer/android/platform/python-for-android-master/pythonforandroid/recipes/python2/__init__.py" at line 100, and changing the sed command to the following:

shprint(sh.sed, '-i \'\'', 's#^SSL=.*#SSL={}#'.format(openssl_build_dir), setup local)

NOTE: To clear up what needs to be inserted immediately following "-i" would be:

space backslash single-quote backslash single-quote

I did this modification, and I was able to complete the build on OSx with pyopenssl.

Please give this a try, and post back.

@frankgould
Copy link
Author

frankgould commented Nov 30, 2016

Thanks mobrien03 for the code change. It appeared to work and compiled the first time. Then I tried adding Pillow so the code will run, and I got another compiler error. So I removed .buildozer from my app directory to rebuild it and I got an sh.CommandNotFound: md5sum error and can't find a solution to this problem. I've attached a link to the buildozer compile log for more information. Please let me know what I should do next. I will be on kivy.org IRC today if you want to meet there to discuss. Thanks again.

http://pastebin.com/CK3cy9Ud

@inclement
Copy link
Member

I think I've fixed both the sed call and the md5sum problem in the master branch.

@frankgould
Copy link
Author

I think you're right but I'm not sure because the compile errored out with the following message:

/Users/fgould/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.8/../../../../arm-linux-androideabi/bin/ld: error: jpeg: malformed archive header name at 8
collect2: error: ld returned 1 exit status
error: command 'arm-linux-androideabi-gcc' failed with exit status 1

Here's the whole build log: http://pastebin.com/eRgWUhBL

@inclement
Copy link
Member

Closing as stale, I believe all of the issues mentioned above have been fixed in the current master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants