Skip to content

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

Closed

Description

@frankgould

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

Activity

  1. KeyWeeUsr commented on Nov 12, 2016

    @KeyWeeUsr
    Contributor
  2. frankgould commented on Nov 13, 2016

    @frankgould
    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?

  3. KeyWeeUsr commented on Nov 13, 2016

    @KeyWeeUsr
    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.

  4. inclement commented on Nov 13, 2016

    @inclement
    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.

  5. frankgould commented on Nov 18, 2016

    @frankgould
    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.

  6. frankgould commented on Nov 28, 2016

    @frankgould
    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.

  7. mobrien03 commented on Nov 29, 2016

    @mobrien03

    @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.

  8. frankgould commented on Nov 30, 2016

    @frankgould
    Author

    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

  9. inclement commented on Dec 1, 2016

    @inclement
    Member

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

  10. frankgould commented on Dec 2, 2016

    @frankgould
    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

  11. inclement commented on Jan 30, 2019

    @inclement
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions