From jdhardy at gmail.com Sun Feb 1 23:06:26 2015 From: jdhardy at gmail.com (Jeff Hardy) Date: Sun, 1 Feb 2015 22:06:26 +0000 Subject: [Mobile-sig] python on android In-Reply-To: References: <1EC1C30484FE464CAE23D84D5BEA0CCB@JakesPC> <24279.1422468117@parc.com> <7129.1422499291@parc.com> <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E1384F4@FMSMSX106.amr.corp.intel.com> Message-ID: On Fri, Jan 30, 2015 at 1:18 AM, Wes Turner wrote: > > On Jan 29, 2015 6:02 PM, "Russell Keith-Magee" > wrote: > > > > Hi Wes, > > > > A buildbot is possible, but complicated. > > > > An Android buildbot could be hosted on any "unix like" system - you can > get the Android development kits for Linux and OS/X. However, that wouldn't > allow you to run the test suite for the mobile platform - because the > binary you build would need to run on the mobile platform itself. Android > does provide an emulator that would allow "on server" testing, but I don't > know how well it can be driven by remote control. My experience using it as > a developer has been "don't", because it's so painfully slow to start and > control. > > > > On iOS, there are other limitations. The host compiler *must* be iOS, > because XCode isn't available for any other platform (AFAIK). Assuming that > can be accommodated, iOS provides a *simulator*, not an emulator - and the > simulator uses x86, not ARM. So, we'd need to run the test suite on the x86 > simulator *and* a native device to be truly sure it works. > > > > So - I don't know how this would fit into the existing Python build farm > infrastructure, but we'd need to add a minimum of 1 device (an iOS device) > to the build farm - ideally, 2 (an Android and an iOS device) - and > possibly a couple more if we want to cover testing on different OS > versions. > > > > This is, of course, is somewhat premature - we need to get the build > working first :-) > > Understood, thanks! > > So, there appears to be an opportunity to donate some resources to this > initiative. > It's certainly possible - Xamarin Test Cloud[1], for example. - Jeff [1] http://xamarin.com/test-cloud -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthew.i.frank at intel.com Mon Feb 2 19:22:35 2015 From: matthew.i.frank at intel.com (Frank, Matthew I) Date: Mon, 2 Feb 2015 18:22:35 +0000 Subject: [Mobile-sig] Recipe to cross-compile Python 3.4.2 for Android Message-ID: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E13A0F1@FMSMSX106.amr.corp.intel.com> I've posted my recipe (including necessary patches) for cross-compiling Python 3.4.2 for Android x86: https://github.com/wandering-logic/android_x86_python-3.4 This is _not_ an App Framework. This is the CPython interpreter running from the Android command line. I originally did this work because I was working on performance analysis tools for Android operating systems developers. I've only tested on x86 Android (and only on Android KitKat). I work for Intel, so I have lots of resources for testing on x86, and none for testing on Arm. Please share any info about your experiences on Arm processors: I'd like to make Python work for all variants of Android. The patch on the site incorporates "fixes" for the following issues from the Python issue tracker: 20306: Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail 21668: The select and time modules uses libm functions without linking against it 16353: add function to os module for getting path to default shell 16255: subrocess.Popen needs /bin/sh but Android only has /system/bin/sh 22747: Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined 20305: Android's incomplete locale.h implementation prevents cross-compilation Plus several other problems that I haven't found reported to bugs.python.org. (Having to do with problems with Android's support for gethostbyaddr_r() and wcsftime().) (Note that by "fixes" I mean: I've done enough to get things compiling, linking and running, not necessarily changes that are appropriate to bring back to the Python code-base.) The state of running the unit tests is: 328 tests passing. 22 tests failing. (test_ctypes, test_threading, test_asyncio, test_bytes, test_capi, test_concurrent_futures, test_datetime, test_distutils, test_faulthandler, test_inspect, test_io, test_mmap, test_multiprocessing_main_handling, test_os, test_posix, test_posixpath, test_pwd, test_shutil, test_socket, test_subprocess, test_sys, test_unicode) 38 tests skipped. Enjoy! (And let me know if anything doesn't work! (Or if you understand any of the test failures and have ideas about how those failures need to be addressed.)) -Matt -------------- next part -------------- An HTML attachment was scrubbed... URL: From jacob at blindza.co.za Mon Feb 2 21:27:03 2015 From: jacob at blindza.co.za (Jacob Kruger) Date: Mon, 2 Feb 2015 22:27:03 +0200 Subject: [Mobile-sig] Another, possible way to compile python source code into android .apk In-Reply-To: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E13A0F1@FMSMSX106.amr.corp.intel.com> References: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E13A0F1@FMSMSX106.amr.corp.intel.com> Message-ID: <924F0459BB674B12967EAC5B90DEE37C@JakesPC> While haven't tested this at all - am still trying to track down relatively simple/relevant forms of kivy example source code, etc., it seems to offer a form of online,cloud-compilation engine to generate .apk friles from your kivy/python-for-android source code: http://android.kivy.org/ Stay well Jacob Kruger Blind Biker Skype: BlindZA "Roger Wilco wants to welcome you...to the space janitor's closet..." ----- Original Message ----- From: Frank, Matthew I To: mobile-sig Sent: Monday, February 02, 2015 8:22 PM Subject: [Mobile-sig] Recipe to cross-compile Python 3.4.2 for Android I've posted my recipe (including necessary patches) for cross-compiling Python 3.4.2 for Android x86: https://github.com/wandering-logic/android_x86_python-3.4 This is _not_ an App Framework. This is the CPython interpreter running from the Android command line. I originally did this work because I was working on performance analysis tools for Android operating systems developers. I've only tested on x86 Android (and only on Android KitKat). I work for Intel, so I have lots of resources for testing on x86, and none for testing on Arm. Please share any info about your experiences on Arm processors: I'd like to make Python work for all variants of Android. The patch on the site incorporates "fixes" for the following issues from the Python issue tracker: 20306: Lack of pw_gecos field in Android's struct passwd causes cross-compilation for the pwd module to fail 21668: The select and time modules uses libm functions without linking against it 16353: add function to os module for getting path to default shell 16255: subrocess.Popen needs /bin/sh but Android only has /system/bin/sh 22747: Interpreter fails in initialize on systems where HAVE_LANGINFO_H is undefined 20305: Android's incomplete locale.h implementation prevents cross-compilation Plus several other problems that I haven't found reported to bugs.python.org. (Having to do with problems with Android's support for gethostbyaddr_r() and wcsftime().) (Note that by "fixes" I mean: I've done enough to get things compiling, linking and running, not necessarily changes that are appropriate to bring back to the Python code-base.) The state of running the unit tests is: 328 tests passing. 22 tests failing. (test_ctypes, test_threading, test_asyncio, test_bytes, test_capi, test_concurrent_futures, test_datetime, test_distutils, test_faulthandler, test_inspect, test_io, test_mmap, test_multiprocessing_main_handling, test_os, test_posix, test_posixpath, test_pwd, test_shutil, test_socket, test_subprocess, test_sys, test_unicode) 38 tests skipped. Enjoy! (And let me know if anything doesn't work! (Or if you understand any of the test failures and have ideas about how those failures need to be addressed.)) -Matt ------------------------------------------------------------------------------ _______________________________________________ Mobile-sig mailing list Mobile-sig at python.org https://mail.python.org/mailman/listinfo/mobile-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From lac at openend.se Tue Feb 3 10:07:00 2015 From: lac at openend.se (Laura Creighton) Date: Tue, 3 Feb 2015 10:07:00 +0100 Subject: [Mobile-sig] imei numbers for mobile devices Message-ID: <201502030907.t13970dG026037@fido.openend.se> Webmaster at python.org is now getting a request for 'how do I find out the imei number of my mobile device' every month or so. Now that this list exists, I have just referred the first person over here. But it would be useful for me if we could collect the 'how to do it' info and stick it on a python.org wiki page so I could just point people at this. I had a nokia phone where finding out the imei number this was trivially easy. import sysinfo print sysinfo.imei() Is there any chance we could get this standard and cross-platform? The big demand on python.org seems to be 'how to find out the imei on my iphone' but it would be good to know how to do this for android devices, notebooks, Samsungs-new-OS whose name I forget right now, etc. Laura From russell at keith-magee.com Tue Feb 3 11:46:39 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Tue, 3 Feb 2015 18:46:39 +0800 Subject: [Mobile-sig] imei numbers for mobile devices In-Reply-To: <201502030907.t13970dG026037@fido.openend.se> References: <201502030907.t13970dG026037@fido.openend.se> Message-ID: On Tue, Feb 3, 2015 at 5:07 PM, Laura Creighton wrote: > Webmaster at python.org is now getting a request for 'how do I find out > the imei number of my mobile device' every month or so. Now that this > list exists, I have just referred the first person over here. But it > would be useful for me if we could collect the 'how to do it' info and > stick it on a python.org wiki page so I could just point people at > this. > I had a nokia phone where finding out the imei number this was trivially > easy. > > import sysinfo > print sysinfo.imei() > > Is there any chance we could get this standard and cross-platform? The big > demand on python.org seems to be 'how to find out the imei on my iphone' > but it would be good to know how to do this for android devices, notebooks, > Samsungs-new-OS whose name I forget right now, etc. > Where did the sysinfo package come from? I can't find any reference to it as part of the standard library. Was it part of a specific build of Python for Nokia/Symbian devices? Regardless, it make sense to me that such a common API for retrieving device-specific information such as the IMEI should exist if a platform can support it. However, on iOS, the IMEI of a device can't be retrieved. For privacy/tracking reasons, Apple has removed all the APIs that return potentially user-identifying information (IMEI, UUID, MAC Address, Device serial number, and so on). If by some miracle you manage to find a way to obtain the information using an unofficial API, that would be grounds to be rejected from the App Store. You *can* obtain an "identifierForVendor" - an identifier that is guaranteed unique to each application vendor (so you can uniquely identify a user, but you can't aggregate that information across different vendors). There is also an advertising identifier, but you need to declare that you're using it, and it can only be used to support serving advertisements. So - a call like imei() would need to raise NotImplemented() on certain platforms; it would be a good idea to have a fallback "identifier" API that works on other platforms. I can't think of any reason this fallback API couldn't be implemented on desktop/server platforms either, using MAC addresses or other system identifiers to produce a UUID of some kind. Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From lac at openend.se Tue Feb 3 13:49:41 2015 From: lac at openend.se (Laura Creighton) Date: Tue, 03 Feb 2015 13:49:41 +0100 Subject: [Mobile-sig] imei numbers for mobile devices In-Reply-To: Message from Russell Keith-Magee of "Tue, 03 Feb 2015 18:46:39 +0800." References: <201502030907.t13970dG026037@fido.openend.se> Message-ID: <201502031249.t13CnfoE007854@fido.openend.se> In a message of Tue, 03 Feb 2015 18:46:39 +0800, Russell Keith-Magee writes: >On Tue, Feb 3, 2015 at 5:07 PM, Laura Creighton wrote: > >> Webmaster at python.org is now getting a request for 'how do I find out >> the imei number of my mobile device' every month or so. Now that this >> list exists, I have just referred the first person over here. But it >> would be useful for me if we could collect the 'how to do it' info and >> stick it on a python.org wiki page so I could just point people at >> this. > > >> I had a nokia phone where finding out the imei number this was trivially >> easy. >> >> import sysinfo >> print sysinfo.imei() >> >> Is there any chance we could get this standard and cross-platform? The big >> demand on python.org seems to be 'how to find out the imei on my iphone' >> but it would be good to know how to do this for android devices, notebooks, >> Samsungs-new-OS whose name I forget right now, etc. >> > > >Where did the sysinfo package come from? I can't find any reference to it >as part of the standard library. Was it part of a specific build of Python >for Nokia/Symbian devices? I think this is the case. Not needing, at the time, to be cross-platform since I was doing the stuff for Nokia, I neglected to inquire. It was only recently when I discovered that, currently, things are not so simple. >Regardless, it make sense to me that such a common API for retrieving >device-specific information such as the IMEI should exist if a platform can >support it. > >However, on iOS, the IMEI of a device can't be retrieved. For >privacy/tracking reasons, Apple has removed all the APIs that return >potentially user-identifying information (IMEI, UUID, MAC Address, Device >serial number, and so on). If by some miracle you manage to find a way to >obtain the information using an unofficial API, that would be grounds to be >rejected from the App Store. > >You *can* obtain an "identifierForVendor" - an identifier that is >guaranteed unique to each application vendor (so you can uniquely identify >a user, but you can't aggregate that information across different vendors). >There is also an advertising identifier, but you need to declare that >you're using it, and it can only be used to support serving advertisements. > >So - a call like imei() would need to raise NotImplemented() on certain >platforms; it would be a good idea to have a fallback "identifier" API that >works on other platforms. I can't think of any reason this fallback API >couldn't be implemented on desktop/server platforms either, using MAC >addresses or other system identifiers to produce a UUID of some kind. Thanks Russ. Now I know what to tell the unhappy would-be IOS developers. I'll put this up on a wiki page, too, in a few days. Laura >Yours, >Russ Magee %-) From david at boddie.org.uk Tue Feb 3 18:38:27 2015 From: david at boddie.org.uk (David Boddie) Date: Tue, 03 Feb 2015 18:38:27 +0100 Subject: [Mobile-sig] openembedded-core Python 3 patches Message-ID: <4309afedf4e6f8230aa1f62ad215618f@webmail.webfaction.com> This is more of an embedded Linux issue than anything else but there might be benefits for the way Python is built for other platforms. Has anyone looked through any of the patch sets for OpenEmbedded to see if there's anything that could be useful for upstream Python? http://cgit.openembedded.org/openembedded-core/tree/meta/recipes-devtools/python/python3 David From russell at keith-magee.com Wed Feb 4 00:50:36 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Wed, 4 Feb 2015 07:50:36 +0800 Subject: [Mobile-sig] openembedded-core Python 3 patches In-Reply-To: <4309afedf4e6f8230aa1f62ad215618f@webmail.webfaction.com> References: <4309afedf4e6f8230aa1f62ad215618f@webmail.webfaction.com> Message-ID: Hi David, I hadn't seen that site before. A deeper inspection might reveal some useful bits that can be used, but my first impression is that they've applied a bunch of patches that solves some immediate problem they have, rather than trying to produce patches that are suitable for upstreaming. >From my cursory analysis revealed: * The patches look like they're against Python 3.3, so best case, there's some additional porting required * They're destructive patches - i.e., if a section of a makefile doesn't work for embedded, the patch deletes that section, rather than introducing a conditional. * They do some odd things for their own compatibility - e.g., forcing sys.platform to return linux2. There might be some useful material in there if you go digging, but my gut tells me that we'll get more traction with some of the other build patches that are already out there (such as Kivy's set, or the instructions at http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html) Yours Russ Magee %-) On Wed, Feb 4, 2015 at 1:38 AM, David Boddie wrote: > This is more of an embedded Linux issue than anything else but there might > be benefits > for the way Python is built for other platforms. > > Has anyone looked through any of the patch sets for OpenEmbedded to see if > there's > anything that could be useful for upstream Python? > > http://cgit.openembedded.org/openembedded-core/tree/meta/ > recipes-devtools/python/python3 > > David > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at boddie.org.uk Wed Feb 4 09:50:19 2015 From: david at boddie.org.uk (David Boddie) Date: Wed, 4 Feb 2015 09:50:19 +0100 Subject: [Mobile-sig] openembedded-core Python 3 patches In-Reply-To: References: <4309afedf4e6f8230aa1f62ad215618f@webmail.webfaction.com> Message-ID: <201502040950.19679.david@boddie.org.uk> On Wednesday 4. February 2015, Russell Keith-Magee wrote: > > I hadn't seen that site before. > > A deeper inspection might reveal some useful bits that can be used, but my > first impression is that they've applied a bunch of patches that solves > some immediate problem they have, rather than trying to produce patches > that are suitable for upstreaming. Yes, that's probably true. I think it's difficult to get everything upstreamed when you're working with so many projects, so the solution seems to be to work with what you have. > >From my cursory analysis revealed: > * The patches look like they're against Python 3.3, so best case, there's > some additional porting required True, though hopefully not as much as going from Python 2.7 or even an earlier 3.x release. > * They're destructive patches - i.e., if a section of a makefile doesn't > work for embedded, the patch deletes that section, rather than introducing > a conditional. > > * They do some odd things for their own compatibility - e.g., forcing > sys.platform to return linux2. They're focused on a specific use case. Agreed. > There might be some useful material in there if you go digging, but my gut > tells me that we'll get more traction with some of the other build patches > that are already out there (such as Kivy's set, or the instructions at > http://randomsplat.com/id5-cross-compiling-python-for-embedded-linux.html) Yes, that looks familiar. My thoughts were really that the OpenEmbedded patches would act as a checklist of things that other efforts should consider. In fact, the file names are almost of list of issues that you would encounter when doing this yourself. I'm thinking of things like 03-fix-tkinter-detection.patch 06-ctypes-libffi-fix-configure.patch 110-enable-zlib.patch I'm sure you also have a similar list of issues and patches, and the idea would be to fix the build system to cover both sets of issues, plus others that have been documented elsewhere. David From david at boddie.org.uk Wed Feb 4 14:09:35 2015 From: david at boddie.org.uk (David Boddie) Date: Wed, 04 Feb 2015 14:09:35 +0100 Subject: [Mobile-sig] Other patch sets (Yocto, Tizen) Message-ID: <9c5d214dcd92b5fceb49d02479854e2d@webmail.webfaction.com> Looking around for other patch sets, I rediscovered Yocto but was not surprised to find that the patches were basically the same as in OpenEmbedded given the heritage of the project: http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/python/python3 Buildroot also has a similar set of patches: http://git.buildroot.net/buildroot/tree/package/python3 For Tizen, the OS whose name Laura forgot, the situation appears to be that Python 2.7 is the latest version with any kind of support: https://review.tizen.org/git/?p=platform/upstream/python.git;a=summary It looks like they're just patching the upstream sources. Although not at all mobile/embedded related, I was hopeful that MXE would at least have a recipe for Python, but apparently not: http://mxe.cc There was another cross-building tool for Windows CE that I remember using but I don't think it's so important for many people. David From chaselton at gmail.com Thu Feb 5 12:40:48 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Thu, 05 Feb 2015 05:40:48 -0600 Subject: [Mobile-sig] Fwd: Re: [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: Since i'm working on an Android tablet, I am forwarding the original message I sent to python-dev instead of re-typing the entire thing. To summarize: I'm building in a fakechroot environment on Android that supports dynamic calls to libc only. Something in the importlib._bootstrap process is not linking to...or has not been linked to...the necessary libraries (I've checked the module...it is being linked to -lc -ldl) but I can't figure out what...as there's not a lot in the python docs on it. I'm currently reading through the importlib docs but any help would be greatly appreciated. -------- Original Message -------- From: Eric Snow Sent: February 3, 2015 12:10:54 AM CST To: Cyd Haselton Cc: Python-Dev Subject: Re: [Python-Dev] Import Fails in setup.py On Android On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton wrote: > After fixing a segfault issue (many thanks Ryan) I'm back to the same issue > I was having with Python 2.7.8; the newly built python throws an undefined > reference to dlopen when running setup.py...specifically when importing > just-built extensions > > I've managed to narrow the problem down to the following line: > > importlib._bootstrap._SpecMethods(spec).load() That call is where modules are created (and executed) via the loader designated for the module by the import machinery. So a problem here may simply reflect a problem with the loader. Which module is being imported when you run into trouble? Is it a C-extension module? Also keep in mind that basically everything in importlib._bootstrap is frozen into your Python binary when you build Python (or should be). So if you are seeing any errors related to something missing or broken in importlib._bootstrap, it could be related to the build step where importlib gets frozen. Either way, more info (e.g. a traceback) would be great if you need more help. -eric -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Thu Feb 5 20:46:04 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Thu, 5 Feb 2015 13:46:04 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: Also, if I've got the wrong list, please let me know. Links to the correct list/lists are optional; I just want to know if this is the right place to get help so that I can keep searching if it isn't. On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton wrote: > Since i'm working on an Android tablet, I am forwarding the original message > I sent to python-dev instead of re-typing the entire thing. > > To summarize: I'm building in a fakechroot environment on Android that > supports dynamic calls to libc only. Something in the importlib._bootstrap > process is not linking to...or has not been linked to...the necessary > libraries (I've checked the module...it is being linked to -lc -ldl) but I > can't figure out what...as there's not a lot in the python docs on it. > > I'm currently reading through the importlib docs but any help would be > greatly appreciated. > > ________________________________ > From: Eric Snow > Sent: February 3, 2015 12:10:54 AM CST > To: Cyd Haselton > Cc: Python-Dev > Subject: Re: [Python-Dev] Import Fails in setup.py On Android > > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton wrote: >> >> After fixing a segfault issue (many thanks Ryan) I'm back to the same >> issue >> I was having with Python 2.7.8; the newly built python throws an >> undefined >> reference to dlopen when running setup.py...specifically when importing >> just-built extensions >> >> I've managed to narrow the problem down to the following line: >> >> importlib._bootstrap._SpecMethods(spec).load() > > > That call is where modules are created (and executed) via the loader > designated for the module by the import machinery. So a problem here > may simply reflect a problem with the loader. Which module is being > imported when you run into trouble? Is it a C-extension module? > > Also keep in mind that > basically everything in importlib._bootstrap is > frozen into your Python binary when you build Python (or should be). > So if you are seeing any errors related to something missing or broken > in importlib._bootstrap, it could be related to the build step where > importlib gets frozen. > > Either way, more info (e.g. a traceback) would be great if you need more > help. > > -eric > > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. From russell at keith-magee.com Sat Feb 7 03:10:16 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Sat, 7 Feb 2015 10:10:16 +0800 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: Hi Cyd, This list is as good a place as any for what you're describing. However, it's a little difficult to provide advice without stack traces and details of how you've built your Python build to start with. For example, are you cross compiling? If so, the problem you've described could be caused by referencing the wrong Python instance when running setup.py. Yours, Russ Magee %-) On Fri, Feb 6, 2015 at 3:46 AM, Cyd Haselton wrote: > Also, if I've got the wrong list, please let me know. Links to the > correct list/lists are optional; I just want to know if this is the > right place to get help so that I can keep searching if it isn't. > > On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton wrote: > > Since i'm working on an Android tablet, I am forwarding the original > message > > I sent to python-dev instead of re-typing the entire thing. > > > > To summarize: I'm building in a fakechroot environment on Android that > > supports dynamic calls to libc only. Something in the > importlib._bootstrap > > process is not linking to...or has not been linked to...the necessary > > libraries (I've checked the module...it is being linked to -lc -ldl) but > I > > can't figure out what...as there's not a lot in the python docs on it. > > > > I'm currently reading through the importlib docs but any help would be > > greatly appreciated. > > > > ________________________________ > > From: Eric Snow > > Sent: February 3, 2015 12:10:54 AM CST > > To: Cyd Haselton > > Cc: Python-Dev > > Subject: Re: [Python-Dev] Import Fails in setup.py On Android > > > > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton > wrote: > >> > >> After fixing a segfault issue (many thanks Ryan) I'm back to the same > >> issue > >> I was having with Python 2.7.8; the newly built python throws an > >> undefined > >> reference to dlopen when running setup.py...specifically when importing > >> just-built extensions > >> > >> I've managed to narrow the problem down to the following line: > >> > >> importlib._bootstrap._SpecMethods(spec).load() > > > > > > That call is where modules are created (and executed) via the loader > > designated for the module by the import machinery. So a problem here > > may simply reflect a problem with the loader. Which module is being > > imported when you run into trouble? Is it a C-extension module? > > > > Also keep in mind that > > basically everything in importlib._bootstrap is > > frozen into your Python binary when you build Python (or should be). > > So if you are seeing any errors related to something missing or broken > > in importlib._bootstrap, it could be related to the build step where > > importlib gets frozen. > > > > Either way, more info (e.g. a traceback) would be great if you need more > > help. > > > > -eric > > > > > > -- > > Sent from my Android device with K-9 Mail. Please excuse my brevity. > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Sat Feb 7 12:36:50 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sat, 07 Feb 2015 05:36:50 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: Hello Russ, Thanks for the update. I'm building Python 3.4.2 from sources, (using a GCC that I originally ported, then upgraded on device) on an Android device in an environment that simulates a Linux filesystem using fakechroot (Terminal Emulator and KBOX); Python is not currently installed in this environment. I've built other utilities in this environment successfully; the key is making sure that anything that requires dlopen() is built with shared libraries and is linked with -lc -ldl, as Android's dlopen() is not in its libc but in -ldl. The shared part is due to a limitation of the libfakechroot that the KBOX environment uses; anything calling dlopen() without the necessary links will cause fakechroot to terminate the process and throw an undefined symbol error For the Python build I've specified -lc -ldl in the appropriate environmental variables, in Modules/Setup and in setup.py. The initial python binary is built, but it fails (with the undefined ref to dlopen()) when importing the extension modules it has has built. I have run nm on those modules and...even though -lc -ldl is on the extension build command line...the dlopen() symbol is not there. Sorry for the long explanation. Let me know if there's info I've left out. On February 6, 2015 8:10:16 PM CST, Russell Keith-Magee wrote: >Hi Cyd, > >This list is as good a place as any for what you're describing. > >However, it's a little difficult to provide advice without stack traces >and >details of how you've built your Python build to start with. For >example, >are you cross compiling? If so, the problem you've described could be >caused by referencing the wrong Python instance when running setup.py. > >Yours, >Russ Magee %-) > >On Fri, Feb 6, 2015 at 3:46 AM, Cyd Haselton >wrote: > >> Also, if I've got the wrong list, please let me know. Links to the >> correct list/lists are optional; I just want to know if this is the >> right place to get help so that I can keep searching if it isn't. >> >> On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton >wrote: >> > Since i'm working on an Android tablet, I am forwarding the >original >> message >> > I sent to python-dev instead of re-typing the entire thing. >> > >> > To summarize: I'm building in a fakechroot environment on Android >that >> > supports dynamic calls to libc only. Something in the >> importlib._bootstrap >> > process is not linking to...or has not been linked to...the >necessary >> > libraries (I've checked the module...it is being linked to -lc >-ldl) but >> I >> > can't figure out what...as there's not a lot in the python docs on >it. >> > >> > I'm currently reading through the importlib docs but any help would >be >> > greatly appreciated. >> > >> > ________________________________ >> > From: Eric Snow >> > Sent: February 3, 2015 12:10:54 AM CST >> > To: Cyd Haselton >> > Cc: Python-Dev >> > Subject: Re: [Python-Dev] Import Fails in setup.py On Android >> > >> > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton >> wrote: >> >> >> >> After fixing a segfault issue (many thanks Ryan) I'm back to the >same >> >> issue >> >> I was having with Python 2.7.8; the newly built python throws an >> >> undefined >> >> reference to dlopen when running setup.py...specifically when >importing >> >> just-built extensions >> >> >> >> I've managed to narrow the problem down to the following line: >> >> >> >> importlib._bootstrap._SpecMethods(spec).load() >> > >> > >> > That call is where modules are created (and executed) via the >loader >> > designated for the module by the import machinery. So a problem >here >> > may simply reflect a problem with the loader. Which module is >being >> > imported when you run into trouble? Is it a C-extension module? >> > >> > Also keep in mind that >> > basically everything in importlib._bootstrap is >> > frozen into your Python binary when you build Python (or should >be). >> > So if you are seeing any errors related to something missing or >broken >> > in importlib._bootstrap, it could be related to the build step >where >> > importlib gets frozen. >> > >> > Either way, more info (e.g. a traceback) would be great if you need >more >> > help. >> > >> > -eric >> > >> > >> > -- >> > Sent from my Android device with K-9 Mail. Please excuse my >brevity. >> _______________________________________________ >> Mobile-sig mailing list >> Mobile-sig at python.org >> https://mail.python.org/mailman/listinfo/mobile-sig >> -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Sat Feb 7 13:41:04 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sat, 07 Feb 2015 06:41:04 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: <6E6619C5-47FF-4D5B-BF9E-6B829B9ED0D3@gmail.com> Additionally, for reference purposes, here is a link to technical information on the environment that I am using: http://kevinboone.net/kbox2_how_it_works.html On February 7, 2015 5:36:50 AM CST, Cyd Haselton wrote: >Hello Russ, >Thanks for the update. > >I'm building Python 3.4.2 from sources, (using a GCC that I originally >ported, then upgraded on device) on an Android device in an environment >that simulates a Linux filesystem using fakechroot (Terminal Emulator >and KBOX); Python is not currently installed in this environment. > >I've built other utilities in this environment successfully; the key is >making sure that anything that requires dlopen() is built with shared >libraries and is linked with -lc -ldl, as Android's dlopen() is not in >its libc but in -ldl. The shared part is due to a limitation of the >libfakechroot that the KBOX environment uses; anything calling dlopen() >without the necessary links will cause fakechroot to terminate the >process and throw an undefined symbol error > >For the Python build I've specified -lc -ldl in the appropriate >environmental variables, in Modules/Setup and in setup.py. The initial >python binary is built, but it fails (with the undefined ref to >dlopen()) when importing the extension modules it has has built. I >have run nm on those modules and...even though -lc -ldl is on the >extension build command line...the dlopen() symbol is not there. > >Sorry for the long explanation. Let me know if there's info I've left >out. > > > >On February 6, 2015 8:10:16 PM CST, Russell Keith-Magee > wrote: >>Hi Cyd, >> >>This list is as good a place as any for what you're describing. >> >>However, it's a little difficult to provide advice without stack >traces >>and >>details of how you've built your Python build to start with. For >>example, >>are you cross compiling? If so, the problem you've described could be >>caused by referencing the wrong Python instance when running setup.py. >> >>Yours, >>Russ Magee %-) >> >>On Fri, Feb 6, 2015 at 3:46 AM, Cyd Haselton >>wrote: >> >>> Also, if I've got the wrong list, please let me know. Links to the >>> correct list/lists are optional; I just want to know if this is the >>> right place to get help so that I can keep searching if it isn't. >>> >>> On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton >>wrote: >>> > Since i'm working on an Android tablet, I am forwarding the >>original >>> message >>> > I sent to python-dev instead of re-typing the entire thing. >>> > >>> > To summarize: I'm building in a fakechroot environment on Android >>that >>> > supports dynamic calls to libc only. Something in the >>> importlib._bootstrap >>> > process is not linking to...or has not been linked to...the >>necessary >>> > libraries (I've checked the module...it is being linked to -lc >>-ldl) but >>> I >>> > can't figure out what...as there's not a lot in the python docs on >>it. >>> > >>> > I'm currently reading through the importlib docs but any help >would >>be >>> > greatly appreciated. >>> > >>> > ________________________________ >>> > From: Eric Snow >>> > Sent: February 3, 2015 12:10:54 AM CST >>> > To: Cyd Haselton >>> > Cc: Python-Dev >>> > Subject: Re: [Python-Dev] Import Fails in setup.py On Android >>> > >>> > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton > >>> wrote: >>> >> >>> >> After fixing a segfault issue (many thanks Ryan) I'm back to the >>same >>> >> issue >>> >> I was having with Python 2.7.8; the newly built python throws an >>> >> undefined >>> >> reference to dlopen when running setup.py...specifically when >>importing >>> >> just-built extensions >>> >> >>> >> I've managed to narrow the problem down to the following line: >>> >> >>> >> importlib._bootstrap._SpecMethods(spec).load() >>> > >>> > >>> > That call is where modules are created (and executed) via the >>loader >>> > designated for the module by the import machinery. So a problem >>here >>> > may simply reflect a problem with the loader. Which module is >>being >>> > imported when you run into trouble? Is it a C-extension module? >>> > >>> > Also keep in mind that >>> > basically everything in importlib._bootstrap is >>> > frozen into your Python binary when you build Python (or should >>be). >>> > So if you are seeing any errors related to something missing or >>broken >>> > in importlib._bootstrap, it could be related to the build step >>where >>> > importlib gets frozen. >>> > >>> > Either way, more info (e.g. a traceback) would be great if you >need >>more >>> > help. >>> > >>> > -eric >>> > >>> > >>> > -- >>> > Sent from my Android device with K-9 Mail. Please excuse my >>brevity. >>> _______________________________________________ >>> Mobile-sig mailing list >>> Mobile-sig at python.org >>> https://mail.python.org/mailman/listinfo/mobile-sig >>> > >-- >Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.kolman at gmail.com Sun Feb 8 19:44:08 2015 From: martin.kolman at gmail.com (Martin Kolman) Date: Sun, 08 Feb 2015 19:44:08 +0100 Subject: [Mobile-sig] Yet Python 3 build for Android & possible solution for GUI apps Message-ID: <54D7AE78.5000105@gmail.com> As we appear to be in the phase of "hunting for working Python 3 Android build", this is what I have been using: https://github.com/thp/python3-android/tree/fixes As far as I can tell it works fine once built with the Android NDK for armv7 Android, just a few modules are missing for some reason: csv, statvfs and sqlite BTW, as for actually using Python 3 for developing (and distributing!) GUI applications for Android, there is a solution that uses the above mentioned Python 3 build, Qt 5 and PyOtherSide (asynchronous Python to Qt Quick bindings) to create standalone Android APKs. A comprehensive guide how to do this is available: https://github.com/thp/pyotherside/blob/master/docs/index.rst#building-for-android Or for a short summary, you can check out the slides from my yesterdays lightning talk: :-) https://m4rtink.fedorapeople.org/devconf2015/python_android_lightning_talk.pdf To see how the resulting application looks like on an Android device, you can try: * the gPodder podcast player https://play.google.com/store/apps/details?id=org.gpodder.android * the modRana flexible navigation system https://m4rtink.fedorapeople.org/devconf2015/modrana-latest.apk Best Wishes Martin Kolman From chaselton at gmail.com Mon Feb 9 01:46:02 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sun, 8 Feb 2015 18:46:02 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: Quick Update: I've managed to re-compile a libfakechroot that (I believe) eliminates the 'undefined reference to dlopen()' issues; problems importing extensions during the build process now display meaningful errors instead of crashing the entire thing. Some imports failed because of missing symbols (i.e. _crypt, which makes sense because I don't have -lcrypt on device) and some failed because of linking issues (i.e _ctypes). The majority failed to import due to an undeclared variable in setup.py...which was quickly fixed. Once the most recent build attempt is done, I'll post relevant stack traces and errors, if any. Cyd On Sat, Feb 7, 2015 at 5:36 AM, Cyd Haselton wrote: > Hello Russ, > Thanks for the update. > > I'm building Python 3.4.2 from sources, (using a GCC that I originally > ported, then upgraded on device) on an Android device in an environment that > simulates a Linux filesystem using fakechroot (Terminal Emulator and KBOX); > Python is not currently installed in this environment. > > I've built other utilities in this environment successfully; the key is > making sure that anything that requires dlopen() is built with shared > libraries and is linked with -lc -ldl, as Android's dlopen() is not in its > libc but in -ldl. The shared part is due to a limitation of the > libfakechroot that the KBOX environment uses; anything calling dlopen() > without the necessary links will cause fakechroot to terminate the process > and throw an undefined symbol error > > For the Python build I've specified -lc -ldl in the appropriate > environmental variables, in Modules/Setup and in setup.py. The initial > python binary is built, but it fails (with the undefined ref to dlopen()) > when importing the extension modules it has has built. I have run nm on > those modules and...even though -lc -ldl is on the extension build command > line...the dlopen() symbol is not there. > > Sorry for the long explanation. Let me know if there's info I've left out. > > > > On February 6, 2015 8:10:16 PM CST, Russell Keith-Magee > wrote: >> >> Hi Cyd, >> >> This list is as good a place as any for what you're describing. >> >> However, it's a little difficult to provide advice without stack traces >> and details of how you've built your Python build to start with. For >> example, are you cross compiling? If so, the problem you've described could >> be caused by referencing the wrong Python instance when running setup.py. >> >> Yours, >> Russ Magee %-) >> >> On Fri, Feb 6, 2015 at 3:46 AM, Cyd Haselton wrote: >>> >>> Also, if I've got the wrong list, please let me know. Links to the >>> correct list/lists are optional; I just want to know if this is the >>> right place to get help so that I can keep searching if it isn't. >>> >>> On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton wrote: >>> > Since i'm working on an Android tablet, I am forwarding the original >>> > message >>> > I sent to python-dev instead of re-typing the entire thing. >>> > >>> > To summarize: I'm building in a fakechroot environment on Android that >>> > supports dynamic calls to libc only. Something in the >>> > importlib._bootstrap >>> > process is not linking to...or has not been linked to...the necessary >>> > libraries (I've checked the module...it is being linked to -lc -ldl) >>> > but I >>> > can't figure out what...as there's not a lot in the python docs on it. >>> > >>> > I'm currently reading through the importlib docs but any help would be >>> > greatly appreciated. >>> > >>> > ________________________________ >>> > From: Eric Snow >>> > Sent: February 3, 2015 12:10:54 AM CST >>> > To: Cyd Haselton >>> > Cc: Python-Dev >>> > Subject: Re: [Python-Dev] Import Fails in setup.py On Android >>> > >>> > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton >>> > wrote: >>> >> >>> >> After fixing a segfault issue (many thanks Ryan) I'm back to the same >>> >> issue >>> >> I was having with Python 2.7.8; the newly built python throws an >>> >> undefined >>> >> reference to dlopen when running setup.py...specifically when >>> >> importing >>> >> just-built extensions >>> >> >>> >> I've managed to narrow the problem down to the following line: >>> >> >>> >> importlib._bootstrap._SpecMethods(spec).load() >>> > >>> > >>> > That call is where modules are created (and executed) via the loader >>> > designated for the module by the import machinery. So a problem here >>> > may simply reflect a problem with the loader. Which module is being >>> > imported when you run into trouble? Is it a C-extension module? >>> > >>> > Also keep in mind that >>> > basically everything in importlib._bootstrap is >>> > frozen into your Python binary when you build Python (or should be). >>> > So if you are seeing any errors related to something missing or broken >>> > in importlib._bootstrap, it could be related to the build step where >>> > importlib gets frozen. >>> > >>> > Either way, more info (e.g. a traceback) would be great if you need >>> > more >>> > help. >>> > >>> > -eric >>> > >>> > >>> > -- >>> > Sent from my Android device with K-9 Mail. Please excuse my brevity. >>> _______________________________________________ >>> Mobile-sig mailing list >>> Mobile-sig at python.org >>> https://mail.python.org/mailman/listinfo/mobile-sig >> >> > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. From david at boddie.org.uk Mon Feb 9 12:34:51 2015 From: david at boddie.org.uk (David Boddie) Date: Mon, 09 Feb 2015 12:34:51 +0100 Subject: [Mobile-sig] Yet Python 3 build for Android & possible solution for GUI apps Message-ID: <5c055994a95a401e80374605bc43db70@webmail.webfaction.com> On Sun Feb 8 19:44:08 CET 2015, Martin Kolman wrote: > As we appear to be in the phase of "hunting for working Python 3 > Android > build", this is what I have been using: > > https://github.com/thp/python3-android/tree/fixes > > As far as I can tell it works fine once built with the Android NDK for > armv7 Android, just a few modules are missing > for some reason: csv, statvfs and sqlite I just tried this and was slightly surprised to find that it ran through to completion, producing a binary for ARM. I didn't really like the way it insists on downloading all the sources it needs, but I understand why it does this. My experience with this kind of thing is that you can only provide patches for certain combinations of component versions, so making it configurable is difficult. Well done to Thomas Perl for getting it to work! There are three levels of activities going on in the above solution: 1. Setting up the build environment 2. Configuring and building Python 3. Building additional modules for use with Python The additional modules are either built by the Python build system or afterwards. The problem of building additional third party modules is open-ended because it depends on what users want to use Python for. From the perspective of fixing Python's build system, the above points could be addressed like this: 1. Document how to set up a build environment for each platform and refer users to solutions like the python3-android one. 2. Reduce the number of patches needed for things like python3-android because solutions like that would ideally need to do no patching at all. 3. Fix the build system for additional modules that standard Python provides. For third party modules, provide documentation that shows how to build against a specially built Python interpreter. Perhaps the extension module building step could be split up from the core interpreter building step in the standard Python build process. Would this make sense? David From chaselton at gmail.com Mon Feb 9 16:33:23 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Mon, 09 Feb 2015 09:33:23 -0600 Subject: [Mobile-sig] Android-Built Python Cannot Load lib-dynload Modules Message-ID: <2C748B94-9D32-4A72-AF8C-8BEC8C147D97@gmail.com> Hello, I'm building Python 3.4.2 from sources, (using a GCC that I originally ported, then upgraded on device) on an Android device in an environment that simulates a Linux filesystem using fakechroot (Terminal Emulator and KBOX); Python is not currently installed in this environment. I fixed the fakechroot issues I mentioned in my previous email (Import fails in setup.py), ran make distclean, then ./configure && make && make install. Unfortunately, running help() fails with the following traceback ^ SyntaxError: invalid syntax >>> help() Traceback (most recent call last): File "", line 1, in File "/usr/python/lib/python3.4/_sitebuiltins.py", line 102, in __call__ import pydoc File "/usr/python/lib/python3.4/pydoc.py", line 62, in import platform File "/usr/python/lib/python3.4/platform.py", line 115, in import sys, os, re, subprocess File "/usr/python/lib/python3.4/subprocess.py", line 352, in import time ImportError: dlopen failed: library "/usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so" not found Attempting to import time fails with the following >>> import time Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: library "/usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so" not found I've checked the referenced path and that file is there. Any ideas why it...and every other module in the python3.4/lib-dynload folder...fails to load? -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at boddie.org.uk Mon Feb 9 23:10:00 2015 From: david at boddie.org.uk (David Boddie) Date: Mon, 9 Feb 2015 23:10:00 +0100 Subject: [Mobile-sig] Android-Built Python Cannot Load lib-dynload Modules Message-ID: <201502092310.00811.david@boddie.org.uk> On Mon Feb 9 16:33:23 CET 2015, Cyd Haselton wrote: > >>> import time > Traceback (most recent call last): > File "", line 1, in > ImportError: dlopen failed: library "/usr/python/lib/python3.4/lib- dynload/time.cpython-34m.so" not found > > I've checked the referenced path and that file is there. Any ideas why > it...and every other module in the python3.4/lib-dynload folder...fails to > load? It sounds trivial, but are they actually built for the correct architecture? On a desktop Linux system you could run "file" on the binary to get some idea of what the .so files are. I'm not sure what you can run in the environment you are using. David From david at boddie.org.uk Mon Feb 9 23:29:22 2015 From: david at boddie.org.uk (David Boddie) Date: Mon, 9 Feb 2015 23:29:22 +0100 Subject: [Mobile-sig] =?utf-8?q?Android-Built_Python_Cannot_Load_lib-dynlo?= =?utf-8?q?ad=09Modules?= In-Reply-To: <55802F28-92F6-4E4D-B40E-572B8AC1D6F1@gmail.com> References: <201502092310.00811.david@boddie.org.uk> <55802F28-92F6-4E4D-B40E-572B8AC1D6F1@gmail.com> Message-ID: <201502092329.23053.david@boddie.org.uk> On Monday 9. February 2015, Cyd Haselton wrote: > On February 9, 2015 4:10:00 PM CST, David Boddie wrote: > >It sounds trivial, but are they actually built for the correct > >architecture? > > > >On a desktop Linux system you could run "file" on the binary to get > >some idea > >of what the .so files are. I'm not sure what you can run in the > >environment > >you are using. > > They are. Here's the output for file > > > /bld/python/Python-3.4.2 $ file > /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so > /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so: ELF 32-bit LSB > shared object, ARM, version 1 (SYSV), dynamically linked, not stripped The next thing I'd try is to use ctypes to try and load it, but that won't help if you can't import ctypes. Do you have an ldd tool you can run on it? David From chaselton at gmail.com Mon Feb 9 23:22:07 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Mon, 09 Feb 2015 16:22:07 -0600 Subject: [Mobile-sig] Android-Built Python Cannot Load lib-dynload Modules In-Reply-To: <201502092310.00811.david@boddie.org.uk> References: <201502092310.00811.david@boddie.org.uk> Message-ID: <55802F28-92F6-4E4D-B40E-572B8AC1D6F1@gmail.com> On February 9, 2015 4:10:00 PM CST, David Boddie wrote: >On Mon Feb 9 16:33:23 CET 2015, Cyd Haselton wrote: > >> >>> import time >> Traceback (most recent call last): >> File "", line 1, in >> ImportError: dlopen failed: library "/usr/python/lib/python3.4/lib- >dynload/time.cpython-34m.so" not found >> >> I've checked the referenced path and that file is there. Any ideas >why >> it...and every other module in the python3.4/lib-dynload >folder...fails to >> load? > >It sounds trivial, but are they actually built for the correct >architecture? > >On a desktop Linux system you could run "file" on the binary to get >some idea >of what the .so files are. I'm not sure what you can run in the >environment >you are using. > They are. Here's the output for file /bld/python/Python-3.4.2 $ file /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, not stripped -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Mon Feb 9 23:35:11 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Mon, 09 Feb 2015 16:35:11 -0600 Subject: [Mobile-sig] Android-Built Python Cannot Load lib-dynload Modules In-Reply-To: <201502092329.23053.david@boddie.org.uk> References: <201502092310.00811.david@boddie.org.uk> <55802F28-92F6-4E4D-B40E-572B8AC1D6F1@gmail.com> <201502092329.23053.david@boddie.org.uk> Message-ID: <4CF69EAE-4C86-45FD-8CF6-68676CAA799A@gmail.com> On February 9, 2015 4:29:22 PM CST, David Boddie wrote: >On Monday 9. February 2015, Cyd Haselton wrote: >> On February 9, 2015 4:10:00 PM CST, David Boddie > >wrote: > >> >It sounds trivial, but are they actually built for the correct >> >architecture? >> > >> >On a desktop Linux system you could run "file" on the binary to get >> >some idea >> >of what the .so files are. I'm not sure what you can run in the >> >environment >> >you are using. >> >> They are. Here's the output for file >> >> >> /bld/python/Python-3.4.2 $ file >> /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so >> /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so: ELF 32-bit >LSB >> shared object, ARM, version 1 (SYSV), dynamically linked, not >stripped > >The next thing I'd try is to use ctypes to try and load it, but that >won't >help if you can't import ctypes. Do you have an ldd tool you can run on >it? > Unfortunately I don't. I do have objdump and readelf...would either of those do? -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Mon Feb 9 23:44:56 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Mon, 09 Feb 2015 16:44:56 -0600 Subject: [Mobile-sig] Android-Built Python Cannot Load lib-dynload Modules In-Reply-To: <201502092329.23053.david@boddie.org.uk> References: <201502092310.00811.david@boddie.org.uk> <55802F28-92F6-4E4D-B40E-572B8AC1D6F1@gmail.com> <201502092329.23053.david@boddie.org.uk> Message-ID: <9A1248AD-717F-494C-9656-F987B33E5B4A@gmail.com> On February 9, 2015 4:29:22 PM CST, David Boddie wrote: >On Monday 9. February 2015, Cyd Haselton wrote: >> On February 9, 2015 4:10:00 PM CST, David Boddie > >wrote: > >> >It sounds trivial, but are they actually built for the correct >> >architecture? >> > >> >On a desktop Linux system you could run "file" on the binary to get >> >some idea >> >of what the .so files are. I'm not sure what you can run in the >> >environment >> >you are using. >> >> They are. Here's the output for file >> >> >> /bld/python/Python-3.4.2 $ file >> /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so >> /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so: ELF 32-bit >LSB >> shared object, ARM, version 1 (SYSV), dynamically linked, not >stripped > >The next thing I'd try is to use ctypes to try and load it, but that >won't >help if you can't import ctypes. Do you have an ldd tool you can run on >it? > Interesting...when I attempt to import ctypes I get this: >>> import ctypes Traceback (most recent call last): File "", line 1, in File "/usr/python/lib/python3.4/ctypes/__init__.py", line 12 return 0L ^ SyntaxError: invalid syntax That line is part of a patch I applied while troubleshooting a previous error. I'll commemt it out, see if that helps -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Mon Feb 9 23:59:06 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Mon, 09 Feb 2015 16:59:06 -0600 Subject: [Mobile-sig] Android-Built Python Cannot Load lib-dynload Modules In-Reply-To: <9A1248AD-717F-494C-9656-F987B33E5B4A@gmail.com> References: <201502092310.00811.david@boddie.org.uk> <55802F28-92F6-4E4D-B40E-572B8AC1D6F1@gmail.com> <201502092329.23053.david@boddie.org.uk> <9A1248AD-717F-494C-9656-F987B33E5B4A@gmail.com> Message-ID: <5892A171-07F5-45E5-80B2-3453EBE11BC0@gmail.com> On February 9, 2015 4:44:56 PM CST, Cyd Haselton wrote: > > >On February 9, 2015 4:29:22 PM CST, David Boddie >wrote: >>On Monday 9. February 2015, Cyd Haselton wrote: >>> On February 9, 2015 4:10:00 PM CST, David Boddie >> >>wrote: >> >>> >It sounds trivial, but are they actually built for the correct >>> >architecture? >>> > >>> >On a desktop Linux system you could run "file" on the binary to get >>> >some idea >>> >of what the .so files are. I'm not sure what you can run in the >>> >environment >>> >you are using. >>> >>> They are. Here's the output for file >>> >>> >>> /bld/python/Python-3.4.2 $ file >>> /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so >>> /usr/python/lib/python3.4/lib-dynload/time.cpython-34m.so: ELF >32-bit >>LSB >>> shared object, ARM, version 1 (SYSV), dynamically linked, not >>stripped >> >>The next thing I'd try is to use ctypes to try and load it, but that >>won't >>help if you can't import ctypes. Do you have an ldd tool you can run >on >>it? >> > >Interesting...when I attempt to import ctypes I get this: > >>>> import ctypes >Traceback (most recent call last): > File "", line 1, in > File "/usr/python/lib/python3.4/ctypes/__init__.py", line 12 > return 0L > ^ >SyntaxError: invalid syntax > >That line is part of a patch I applied while troubleshooting a previous >error. I'll commemt it out, see if that helps Well...not so much. I get a the original error, only for _ctypes. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From russell at keith-magee.com Tue Feb 10 00:55:56 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Tue, 10 Feb 2015 07:55:56 +0800 Subject: [Mobile-sig] Yet Python 3 build for Android & possible solution for GUI apps In-Reply-To: <5c055994a95a401e80374605bc43db70@webmail.webfaction.com> References: <5c055994a95a401e80374605bc43db70@webmail.webfaction.com> Message-ID: On Mon, Feb 9, 2015 at 7:34 PM, David Boddie wrote: > On Sun Feb 8 19:44:08 CET 2015, Martin Kolman wrote: > > As we appear to be in the phase of "hunting for working Python 3 Android >> build", this is what I have been using: >> >> https://github.com/thp/python3-android/tree/fixes >> >> As far as I can tell it works fine once built with the Android NDK for >> armv7 Android, just a few modules are missing >> for some reason: csv, statvfs and sqlite >> > > I just tried this and was slightly surprised to find that it ran through > to completion, producing a binary for ARM. I didn't really like the way > it insists on downloading all the sources it needs, but I understand why > it does this. My experience with this kind of thing is that you can only > provide patches for certain combinations of component versions, so making > it configurable is difficult. Well done to Thomas Perl for getting it to > work! > FTR - the "download and patch" approach is also the approach taken by Kivy (and by extension, Python-Android-support). There are several reasons this approach is helpful. Firstly Python's out-of-the-box sources need to be patched, and so do most of the binary library dependencies, and patching sources is an easy process to automate. Secondly building for a mobile platform usually means building at least twice - a host build and a target build. In the case of iOS, you need 3 builds - one for the simulator and one for the device, and the two binaries then need to be merged into a single "fat" library. The standard autoconf tools have really good support for building a single source tree for a single platform; building multiple versions and merging the results isn't an area where it is as capable. So - a 'helper' script like this is an almost inevitable part of the whole process. What I'm not clear on is: 1) Whether this helper script needs to be part of the "official" distribution 2) If it does, where is the right place to put the helper script. However, getting the patches for the existing build tools is still the first step. Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From david at boddie.org.uk Tue Feb 10 01:24:42 2015 From: david at boddie.org.uk (David Boddie) Date: Tue, 10 Feb 2015 01:24:42 +0100 Subject: [Mobile-sig] Yet Python 3 build for Android & possible solution for GUI apps In-Reply-To: References: <5c055994a95a401e80374605bc43db70@webmail.webfaction.com> Message-ID: <201502100124.42565.david@boddie.org.uk> On Tuesday 10. February 2015, Russell Keith-Magee wrote: > > FTR - the "download and patch" approach is also the approach taken by Kivy > (and by extension, Python-Android-support). Yes, it's often easier to do that than to get patches accepted upstream, though maintaining the patches can be a burden. [...] > The standard autoconf tools have really good support for building a single > source tree for a single platform; building multiple versions and merging > the results isn't an area where it is as capable. So - a 'helper' script > like this is an almost inevitable part of the whole process. What I'm not > clear on is: > > 1) Whether this helper script needs to be part of the "official" > distribution > 2) If it does, where is the right place to put the helper script. I'm not sure it should be "official" but I'm not the person you have to convince. ;-) > However, getting the patches for the existing build tools is still the > first step. On that subject, I looked at your Python-Android-support patches today with the idea that I might take the best bits from those, openembedded-core and python3-android. The patches are for Python 2.7. Would you recommend that I look at Kivy's patches instead or are you likely to update your repository? David From janssen at parc.com Tue Feb 10 02:08:54 2015 From: janssen at parc.com (Bill Janssen) Date: Mon, 09 Feb 2015 17:08:54 -0800 Subject: [Mobile-sig] Yet Python 3 build for Android & possible solution for GUI apps In-Reply-To: <201502100124.42565.david@boddie.org.uk> References: <5c055994a95a401e80374605bc43db70@webmail.webfaction.com> <201502100124.42565.david@boddie.org.uk> Message-ID: <2622.1423530534@parc.com> David Boddie wrote: > The patches are for Python 2.7. Would you recommend that I > look at Kivy's patches instead or are you likely to update your repository? Note that Kivy's Android patches are for 2.7 as well. Bill From chaselton at gmail.com Sun Feb 15 04:24:31 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sat, 14 Feb 2015 21:24:31 -0600 Subject: [Mobile-sig] Python Build Import Fails, Question About dynload_shlib Message-ID: <722C04C8-C703-4D9E-A1DE-618B0A3050F7@gmail.com> I'm still working at the native build of Python on my Android tablet and still troubleshooting the issue with setup.py failing to import just-built modules. (an 'undefined reference to dlopen' error is thrown and stops the setup.py script and the rest of the build...no tracebacks are generated) I noticed the following readelf output from dynload_shlib.o and a library that works in my build environment. It may be nothing but at this point I'm looking at everything Output from dlynload_shlib: /bld/python/Python-3.4.2 $ readelf -a Python/dynload_shlib.o | grep dlopen 00000110 0000221c R_ARM_CALL 00000000 dlopen 0000018c 0000221c R_ARM_CALL 00000000 dlopen 34: 00000000 0 NOTYPE GLOBAL DEFAULT UND dlopen Output from working library: /bld/python/Python-3.4.2 $ readelf -a /lib/libcrypto.so.1.0.0 | grep dlopen 001659bc 0000ac16 R_ARM_JUMP_SLOT 00000000 dlopen 172: 00000000 0 FUNC GLOBAL DEFAULT UND dlopen 8342: 00000000 0 FUNC GLOBAL DEFAULT UND dlopen Shouldn't dlopen be a FUNC and in a R_ARM_JUMP_SLOT in dynload_shlib.o? Or am I grasping at straws? -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Mon Feb 16 00:14:50 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sun, 15 Feb 2015 17:14:50 -0600 Subject: [Mobile-sig] Python Build Import Fails, Question About dynload_shlib In-Reply-To: <722C04C8-C703-4D9E-A1DE-618B0A3050F7@gmail.com> References: <722C04C8-C703-4D9E-A1DE-618B0A3050F7@gmail.com> Message-ID: On February 14, 2015 9:24:31 PM CST, Cyd Haselton wrote: >I'm still working at the native build of Python on my Android tablet >and still troubleshooting the issue with setup.py failing to import >just-built modules. (an 'undefined reference to dlopen' error is thrown >and stops the setup.py script and the rest of the build...no tracebacks >are generated) > >I noticed the following readelf output from dynload_shlib.o and a >library that works in my build environment. It may be nothing but at >this point I'm looking at everything > >Output from dlynload_shlib: >/bld/python/Python-3.4.2 $ readelf -a Python/dynload_shlib.o | grep >dlopen >00000110 0000221c R_ARM_CALL 00000000 dlopen >0000018c 0000221c R_ARM_CALL 00000000 dlopen > 34: 00000000 0 NOTYPE GLOBAL DEFAULT UND dlopen > >Output from working library: >/bld/python/Python-3.4.2 $ readelf -a /lib/libcrypto.so.1.0.0 | grep >dlopen >001659bc 0000ac16 R_ARM_JUMP_SLOT 00000000 dlopen > 172: 00000000 0 FUNC GLOBAL DEFAULT UND dlopen > 8342: 00000000 0 FUNC GLOBAL DEFAULT UND dlopen > >Shouldn't dlopen be a FUNC and in a R_ARM_JUMP_SLOT in dynload_shlib.o? > Or am I grasping at straws? Ignore this...I was grasping at straws. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Mon Feb 16 00:28:45 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sun, 15 Feb 2015 17:28:45 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: After banging my head against libfakechroot for days I've finally managed to fix it to work on Android. Moving back to Python...I ran make clean && make && make install. I run the installed python3 binary, run help() and get the following error: ype "help", "copyright", "credits" or "license" for more information. >>> help() Traceback (most recent call last): File "", line 1, in File "/usr/python/lib/python3.4/_sitebuiltins.py", line 102, in __call__ import pydoc File "/usr/python/lib/python3.4/pydoc.py", line 62, in import platform File "/usr/python/lib/python3.4/platform.py", line 115, in import sys, os, re, subprocess File "/usr/python/lib/python3.4/subprocess.py", line 406, in import select ImportError: No module named 'select' I then attempt to import select, then ctypes, and get the following errors: >>> import select Traceback (most recent call last): File "", line 1, in ImportError: No module named 'select' >>> import ctypes Traceback (most recent call last): File "", line 1, in File "/usr/python/lib/python3.4/ctypes/__init__.py", line 22, in from struct import calcsize as _calcsize File "/usr/python/lib/python3.4/struct.py", line 13, in from _struct import * ImportError: dlopen failed: cannot locate symbol "PyLong_AsSize_t" referenced by "_struct.cpython-34m.so"... >>> import _struct Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PyLong_AsSize_t" referenced by "_struct.cpython-34m.so"... >>> Googling the ImportError turns up six results...none of them related to a missing PyLong_AsSize_t symbol. Has anyone seen this error before? Thanks in advance. Headed back to look at the _struct code. Cyd On February 8, 2015 6:46:02 PM CST, Cyd Haselton wrote: >Quick Update: > >I've managed to re-compile a libfakechroot that (I believe) eliminates >the 'undefined reference to dlopen()' issues; problems importing >extensions during the build process now display meaningful errors >instead of crashing the entire thing. > >Some imports failed because of missing symbols (i.e. _crypt, which >makes sense because I don't have -lcrypt on device) and some failed >because of linking issues (i.e _ctypes). The majority failed to >import due to an undeclared variable in setup.py...which was quickly >fixed. > >Once the most recent build attempt is done, I'll post relevant stack >traces and errors, if any. > >Cyd > >On Sat, Feb 7, 2015 at 5:36 AM, Cyd Haselton >wrote: >> Hello Russ, >> Thanks for the update. >> >> I'm building Python 3.4.2 from sources, (using a GCC that I >originally >> ported, then upgraded on device) on an Android device in an >environment that >> simulates a Linux filesystem using fakechroot (Terminal Emulator and >KBOX); >> Python is not currently installed in this environment. >> >> I've built other utilities in this environment successfully; the key >is >> making sure that anything that requires dlopen() is built with shared >> libraries and is linked with -lc -ldl, as Android's dlopen() is not >in its >> libc but in -ldl. The shared part is due to a limitation of the >> libfakechroot that the KBOX environment uses; anything calling >dlopen() >> without the necessary links will cause fakechroot to terminate the >process >> and throw an undefined symbol error >> >> For the Python build I've specified -lc -ldl in the appropriate >> environmental variables, in Modules/Setup and in setup.py. The >initial >> python binary is built, but it fails (with the undefined ref to >dlopen()) >> when importing the extension modules it has has built. I have run nm >on >> those modules and...even though -lc -ldl is on the extension build >command >> line...the dlopen() symbol is not there. >> >> Sorry for the long explanation. Let me know if there's info I've left >out. >> >> >> >> On February 6, 2015 8:10:16 PM CST, Russell Keith-Magee >> wrote: >>> >>> Hi Cyd, >>> >>> This list is as good a place as any for what you're describing. >>> >>> However, it's a little difficult to provide advice without stack >traces >>> and details of how you've built your Python build to start with. For >>> example, are you cross compiling? If so, the problem you've >described could >>> be caused by referencing the wrong Python instance when running >setup.py. >>> >>> Yours, >>> Russ Magee %-) >>> >>> On Fri, Feb 6, 2015 at 3:46 AM, Cyd Haselton >wrote: >>>> >>>> Also, if I've got the wrong list, please let me know. Links to the >>>> correct list/lists are optional; I just want to know if this is the >>>> right place to get help so that I can keep searching if it isn't. >>>> >>>> On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton >wrote: >>>> > Since i'm working on an Android tablet, I am forwarding the >original >>>> > message >>>> > I sent to python-dev instead of re-typing the entire thing. >>>> > >>>> > To summarize: I'm building in a fakechroot environment on Android >that >>>> > supports dynamic calls to libc only. Something in the >>>> > importlib._bootstrap >>>> > process is not linking to...or has not been linked to...the >necessary >>>> > libraries (I've checked the module...it is being linked to -lc >-ldl) >>>> > but I >>>> > can't figure out what...as there's not a lot in the python docs >on it. >>>> > >>>> > I'm currently reading through the importlib docs but any help >would be >>>> > greatly appreciated. >>>> > >>>> > ________________________________ >>>> > From: Eric Snow >>>> > Sent: February 3, 2015 12:10:54 AM CST >>>> > To: Cyd Haselton >>>> > Cc: Python-Dev >>>> > Subject: Re: [Python-Dev] Import Fails in setup.py On Android >>>> > >>>> > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton > >>>> > wrote: >>>> >> >>>> >> After fixing a segfault issue (many thanks Ryan) I'm back to >the same >>>> >> issue >>>> >> I was having with Python 2.7.8; the newly built python throws >an >>>> >> undefined >>>> >> reference to dlopen when running setup.py...specifically when >>>> >> importing >>>> >> just-built extensions >>>> >> >>>> >> I've managed to narrow the problem down to the following line: >>>> >> >>>> >> importlib._bootstrap._SpecMethods(spec).load() >>>> > >>>> > >>>> > That call is where modules are created (and executed) via the >loader >>>> > designated for the module by the import machinery. So a problem >here >>>> > may simply reflect a problem with the loader. Which module is >being >>>> > imported when you run into trouble? Is it a C-extension module? >>>> > >>>> > Also keep in mind that >>>> > basically everything in importlib._bootstrap is >>>> > frozen into your Python binary when you build Python (or should >be). >>>> > So if you are seeing any errors related to something missing or >broken >>>> > in importlib._bootstrap, it could be related to the build step >where >>>> > importlib gets frozen. >>>> > >>>> > Either way, more info (e.g. a traceback) would be great if you >need >>>> > more >>>> > help. >>>> > >>>> > -eric >>>> > >>>> > >>>> > -- >>>> > Sent from my Android device with K-9 Mail. Please excuse my >brevity. >>>> _______________________________________________ >>>> Mobile-sig mailing list >>>> Mobile-sig at python.org >>>> https://mail.python.org/mailman/listinfo/mobile-sig >>> >>> >> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Mon Feb 16 23:23:37 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Mon, 16 Feb 2015 16:23:37 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: References: Message-ID: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> More information: After uncommenting the select module in Setup, running make clean && make && make install, then running python3, then help(), I get the following: bld/python/Python-3.4.2 $ python3 Python 3.4.2 (default, Feb 16 2015, 12:33:03) [GCC 4.9.2] on linux Type "help", "copyright", "credits" or "license" for more information. >>> help() Traceback (most recent call last): File "", line 1, in File "/usr/python/lib/python3.4/_sitebuiltins.py", line 102, in __call__ import pydoc File "/usr/python/lib/python3.4/pydoc.py", line 62, in import platform File "/usr/python/lib/python3.4/platform.py", line 115, in import sys, os, re, subprocess File "/usr/python/lib/python3.4/subprocess.py", line 352, in import time ImportError: dlopen failed: cannot locate symbol "PyUnicode_DecodeLocale" referenced by "time.cpython-34m.so"... The symbol is in libpython.3.4m.so.1...and UND in time.cpython-34m.so. For some reason time isn't finding the symbol in the shared library. I've tried copying the library to the folder where the time module resides, and to a few other locations, with the same results. Any ideas on what I should do next? Cyd On February 15, 2015 5:28:45 PM CST, Cyd Haselton wrote: >After banging my head against libfakechroot for days I've finally >managed to fix it to work on Android. > >Moving back to Python...I ran make clean && make && make install. I run >the installed python3 binary, run help() and get the following error: > >ype "help", "copyright", "credits" or "license" for more information. >>>> help() >Traceback (most recent call last): > File "", line 1, in >File "/usr/python/lib/python3.4/_sitebuiltins.py", line 102, in >__call__ > import pydoc > File "/usr/python/lib/python3.4/pydoc.py", line 62, in > import platform > File "/usr/python/lib/python3.4/platform.py", line 115, in > import sys, os, re, subprocess > File "/usr/python/lib/python3.4/subprocess.py", line 406, in > import select >ImportError: No module named 'select' > > >I then attempt to import select, then ctypes, and get the following >errors: >>>> import select >Traceback (most recent call last): > File "", line 1, in >ImportError: No module named 'select' >>>> import ctypes >Traceback (most recent call last): > File "", line 1, in >File "/usr/python/lib/python3.4/ctypes/__init__.py", line 22, in > > from struct import calcsize as _calcsize > File "/usr/python/lib/python3.4/struct.py", line 13, in > from _struct import * >ImportError: dlopen failed: cannot locate symbol "PyLong_AsSize_t" >referenced by "_struct.cpython-34m.so"... >>>> import _struct >Traceback (most recent call last): > File "", line 1, in >ImportError: dlopen failed: cannot locate symbol "PyLong_AsSize_t" >referenced by "_struct.cpython-34m.so"... >>>> > >Googling the ImportError turns up six results...none of them related to >a missing PyLong_AsSize_t symbol. > >Has anyone seen this error before? > >Thanks in advance. Headed back to look at the _struct code. > >Cyd > >On February 8, 2015 6:46:02 PM CST, Cyd Haselton >wrote: >>Quick Update: >> >>I've managed to re-compile a libfakechroot that (I believe) eliminates >>the 'undefined reference to dlopen()' issues; problems importing >>extensions during the build process now display meaningful errors >>instead of crashing the entire thing. >> >>Some imports failed because of missing symbols (i.e. _crypt, which >>makes sense because I don't have -lcrypt on device) and some failed >>because of linking issues (i.e _ctypes). The majority failed to >>import due to an undeclared variable in setup.py...which was quickly >>fixed. >> >>Once the most recent build attempt is done, I'll post relevant stack >>traces and errors, if any. >> >>Cyd >> >>On Sat, Feb 7, 2015 at 5:36 AM, Cyd Haselton >>wrote: >>> Hello Russ, >>> Thanks for the update. >>> >>> I'm building Python 3.4.2 from sources, (using a GCC that I >>originally >>> ported, then upgraded on device) on an Android device in an >>environment that >>> simulates a Linux filesystem using fakechroot (Terminal Emulator and >>KBOX); >>> Python is not currently installed in this environment. >>> >>> I've built other utilities in this environment successfully; the key >>is >>> making sure that anything that requires dlopen() is built with >shared >>> libraries and is linked with -lc -ldl, as Android's dlopen() is not >>in its >>> libc but in -ldl. The shared part is due to a limitation of the >>> libfakechroot that the KBOX environment uses; anything calling >>dlopen() >>> without the necessary links will cause fakechroot to terminate the >>process >>> and throw an undefined symbol error >>> >>> For the Python build I've specified -lc -ldl in the appropriate >>> environmental variables, in Modules/Setup and in setup.py. The >>initial >>> python binary is built, but it fails (with the undefined ref to >>dlopen()) >>> when importing the extension modules it has has built. I have run nm >>on >>> those modules and...even though -lc -ldl is on the extension build >>command >>> line...the dlopen() symbol is not there. >>> >>> Sorry for the long explanation. Let me know if there's info I've >left >>out. >>> >>> >>> >>> On February 6, 2015 8:10:16 PM CST, Russell Keith-Magee >>> wrote: >>>> >>>> Hi Cyd, >>>> >>>> This list is as good a place as any for what you're describing. >>>> >>>> However, it's a little difficult to provide advice without stack >>traces >>>> and details of how you've built your Python build to start with. >For >>>> example, are you cross compiling? If so, the problem you've >>described could >>>> be caused by referencing the wrong Python instance when running >>setup.py. >>>> >>>> Yours, >>>> Russ Magee %-) >>>> >>>> On Fri, Feb 6, 2015 at 3:46 AM, Cyd Haselton >>wrote: >>>>> >>>>> Also, if I've got the wrong list, please let me know. Links to >the >>>>> correct list/lists are optional; I just want to know if this is >the >>>>> right place to get help so that I can keep searching if it isn't. >>>>> >>>>> On Thu, Feb 5, 2015 at 5:40 AM, Cyd Haselton >>wrote: >>>>> > Since i'm working on an Android tablet, I am forwarding the >>original >>>>> > message >>>>> > I sent to python-dev instead of re-typing the entire thing. >>>>> > >>>>> > To summarize: I'm building in a fakechroot environment on >Android >>that >>>>> > supports dynamic calls to libc only. Something in the >>>>> > importlib._bootstrap >>>>> > process is not linking to...or has not been linked to...the >>necessary >>>>> > libraries (I've checked the module...it is being linked to -lc >>-ldl) >>>>> > but I >>>>> > can't figure out what...as there's not a lot in the python docs >>on it. >>>>> > >>>>> > I'm currently reading through the importlib docs but any help >>would be >>>>> > greatly appreciated. >>>>> > >>>>> > ________________________________ >>>>> > From: Eric Snow >>>>> > Sent: February 3, 2015 12:10:54 AM CST >>>>> > To: Cyd Haselton >>>>> > Cc: Python-Dev >>>>> > Subject: Re: [Python-Dev] Import Fails in setup.py On Android >>>>> > >>>>> > On Mon, Feb 2, 2015 at 12:36 PM, Cyd Haselton >> >>>>> > wrote: >>>>> >> >>>>> >> After fixing a segfault issue (many thanks Ryan) I'm back to >>the same >>>>> >> issue >>>>> >> I was having with Python 2.7.8; the newly built python throws >>an >>>>> >> undefined >>>>> >> reference to dlopen when running setup.py...specifically when >>>>> >> importing >>>>> >> just-built extensions >>>>> >> >>>>> >> I've managed to narrow the problem down to the following line: >>>>> >> >>>>> >> importlib._bootstrap._SpecMethods(spec).load() >>>>> > >>>>> > >>>>> > That call is where modules are created (and executed) via the >>loader >>>>> > designated for the module by the import machinery. So a problem >>here >>>>> > may simply reflect a problem with the loader. Which module is >>being >>>>> > imported when you run into trouble? Is it a C-extension module? >>>>> > >>>>> > Also keep in mind that >>>>> > basically everything in importlib._bootstrap is >>>>> > frozen into your Python binary when you build Python (or should >>be). >>>>> > So if you are seeing any errors related to something missing or >>broken >>>>> > in importlib._bootstrap, it could be related to the build step >>where >>>>> > importlib gets frozen. >>>>> > >>>>> > Either way, more info (e.g. a traceback) would be great if you >>need >>>>> > more >>>>> > help. >>>>> > >>>>> > -eric >>>>> > >>>>> > >>>>> > -- >>>>> > Sent from my Android device with K-9 Mail. Please excuse my >>brevity. >>>>> _______________________________________________ >>>>> Mobile-sig mailing list >>>>> Mobile-sig at python.org >>>>> https://mail.python.org/mailman/listinfo/mobile-sig >>>> >>>> >>> >>> -- >>> Sent from my Android device with K-9 Mail. Please excuse my brevity. > >-- >Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.kolman at gmail.com Mon Feb 16 23:37:44 2015 From: martin.kolman at gmail.com (Martin Kolman) Date: Mon, 16 Feb 2015 23:37:44 +0100 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> Message-ID: <54E27138.4060908@gmail.com> Mon, 16 Feb 2015 16:23:37 -0600 Cyd Haselton : > More information: > After uncommenting the select module in Setup, running make clean && > make && make install, then running python3, then help(), I get the > following: > > bld/python/Python-3.4.2 $ python3 > Python 3.4.2 (default, Feb 16 2015, 12:33:03) > [GCC 4.9.2] on linux > Type "help", "copyright", "credits" or "license" for more information. > >>> help() > Traceback (most recent call last): > File "", line 1, in > File "/usr/python/lib/python3.4/_sitebuiltins.py > ", line 102, in __call__ > import pydoc > File "/usr/python/lib/python3.4/pydoc.py ", line 62, > in > import platform > File "/usr/python/lib/python3.4/platform.py ", > line 115, in > import sys, os, re, subprocess > File "/usr/python/lib/python3.4/subprocess.py ", > line 352, in > import time > ImportError: dlopen failed: cannot locate symbol > "PyUnicode_DecodeLocale" referenced by "time.cpython-34m.so > "... > > The symbol is in libpython.3.4m.so .1...and > UND in time.cpython-34m.so . For some > reason time isn't finding the symbol in the shared library. Android does not support versioning in SONAMES[0][1][2] - maybe that's what is causing these issues ? [0] https://code.google.com/p/android/issues/detail?id=55868 [1] https://groups.google.com/d/msg/android-ndk/_UhNpRJlA1k/hbryqzEgN94J [3] https://github.com/MysticTreeGames/Boost-for-Android/issues/44 > > I've tried copying the library to the folder where the time module > resides, and to a few other locations, with the same results. Any > ideas on what I should do next? > > Cyd > > On February 15, 2015 5:28:45 PM CST, Cyd Haselton > wrote: > > After banging my head against libfakechroot for days I've finally > managed to fix it to work on Android. > > Moving back to Python...I ran make clean && make && make install. > I run the installed python3 binary, run help() and get the > following error: > > ype "help", "copyright", "credits" or "license" for more information. > >>> help() > Traceback (most recent call last): > File "", line 1, in > File "/usr/python/lib/python3.4/_sitebuiltins.py > ", line 102, in __call__ > import pydoc > File "/usr/python/lib/python3.4/pydoc.py ", line > 62, in > import platform > File "/usr/python/lib/python3.4/platform.py ", > line 115, in > import sys, os, re, subprocess > File "/usr/python/lib/python3.4/subprocess.py > ", line 406, in > import select > ImportError: No module named 'select' > > > I then attempt to import select, then ctypes, and get the > following errors: > >>> import select > Traceback (most recent call last): > File "", line 1, in > ImportError: No module named 'select' > >>> import ctypes > Traceback (most recent call last): > File "", line 1, in > File "/usr/python/lib/python3.4/ctypes/__init__.py", line 22, in > > from struct import calcsize as _calcsize > File "/usr/python/lib/python3.4/struct.py ", > line 13, in > from _struct import * > ImportError: dlopen failed: cannot locate symbol "PyLong_AsSize_t" > referenced by "_struct.cpython-34m.so > "... > >>> import _struct > Traceback (most recent call last): > File "", line 1, in > ImportError: dlopen failed: cannot locate symbol "PyLong_AsSize_t" > referenced by "_struct.cpython-34m.so > "... > >>> > > Googling the ImportError turns up six results...none of them > related to a missing PyLong_AsSize_t symbol. > > Has anyone seen this error before? > > Thanks in advance. Headed back to look at the _struct code. > > Cyd > > On February 8, 2015 6:46:02 PM CST, Cyd Haselton > wrote: > > Quick Update: > > I've managed to re-compile a libfakechroot that (I believe) eliminates > the 'undefined reference to dlopen()' issues; problems importing > extensions during the build process now display meaningful errors > instead of crashing the entire thing. > > Some imports failed because of missing symbols (i.e. _crypt, which > makes sense because I don't have -lcrypt on device) and some failed > because of linking issues (i.e _ctypes). The majority failed to > import due to an undeclared variable insetup.py ...which was quickly > fixed. > > Once the most recent build attempt is done, I'll post relevant stack > traces and errors, if any. > > Cyd > > On Sat, Feb 7, 2015 at 5:36 AM, Cyd Haselton wrote: > > Hello Russ, Thanks for the update. I'm building Python > 3.4.2 from sources, (using a GCC that I originally ported, > then upgraded on device) on an Android device in an > environment that simulates a Linux filesystem using > fakechroot (Terminal Emulator and KBOX); Python is not > currently installed in this environment. I've built other > utilities in this environment successfully; the key is > making sure that anything that requires dlopen() is built > with shared libraries and is linked with -lc -ldl, as > Android's dlopen() is not in its libc but in -ldl. The > shared part is due to a limitation of the libfakechroot > that the KBOX environment uses; anything calling dlopen() > without the necessary links will cause fakechroot to > terminate the process and throw an undefined symbol error > For the Python build I've specified -lc -ldl in the > appropriate environmental variables, in Modules/Setup and > in setup.py . The initial python binary > is built, but it fails (with the undefined ref to > dlopen()) when importing the extension modules it has has > built. I have run nm on those modules and...even though > -lc -ldl is on the extension build command line...the > dlopen() symbol is not there. Sorry for the long > explanation. Let me know if there's info I've left out. On > February 6, 2015 8:10:16 PM CST, Russell Keith-Magee > wrote: > > Hi Cyd, This list is as good a place as any for what > you're describing. However, it's a little difficult to > provide advice without stack traces and details of how > you've built your Python build to start with. For > example, are you cross compiling? If so, the problem > you've described could be caused by referencing the > wrong Python instance when running setup.py > . Yours, Russ Magee %-) On Fri, Feb > 6, 2015 at 3:46 AM, Cyd Haselton > wrote: > > Also, if I've got the wrong list, please let me > know. Links to the correct list/lists are > optional; I just want to know if this is the right > place to get help so that I can keep searching if > it isn't. On Thu, Feb 5, 2015 at 5:40 AM, Cyd > Haselton wrote: > > Since i'm working on an Android tablet, I am > forwarding the original message I sent to > python-dev instead of re-typing the entire > thing. To summarize: I'm building in a > fakechroot environment on Android that > supports dynamic calls to libc only. Something > in the importlib._bootstrap process is not > linking to...or has not been linked to...the > necessary libraries (I've checked the > module...it is being linked to -lc -ldl) but I > can't figure out what...as there's not a lot > in the python docs on it. I'm currently > reading through the importlib docs but any > help would be greatly appreciated. > ------------------------------------------------------------------------ > From: Eric Snow > Sent: February 3, 2015 12:10:54 AM CST To: Cyd > Haselton Cc: Python-Dev > Subject: Re: > [Python-Dev] Import Fails in setup.py > On Android On Mon, Feb 2, > 2015 at 12:36 PM, Cyd Haselton > wrote: > > After fixing a segfault issue (many thanks > Ryan) I'm back to the same issue I was > having with Python 2.7.8; the newly built > python throws an undefined reference to > dlopen when running setup.py > ...specifically when > importing just-built extensions I've > managed to narrow the problem down to the > following line: > importlib._bootstrap._SpecMethods(spec).load() > > > That call is where modules are created (and > executed) via the loader designated for the > module by the import machinery. So a problem > here may simply reflect a problem with the > loader. Which module is being imported when > you run into trouble? Is it a C-extension > module? Also keep in mind that basically > everything in importlib._bootstrap is frozen > into your Python binary when you build Python > (or should be). So if you are seeing any > errors related to something missing or broken > in importlib._bootstrap, it could be related > to the build step where importlib gets frozen. > Either way, more info (e.g. a traceback) would > be great if you need more help. -eric -- Sent > from my Android device with K-9 Mail. Please > excuse my brevity. > > ------------------------------------------------------------------------ > Mobile-sig mailing list Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > > -- Sent from my Android device with K-9 Mail. Please > excuse my brevity. > > > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > > > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Tue Feb 17 12:42:03 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Tue, 17 Feb 2015 05:42:03 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <54E27138.4060908@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> Message-ID: <9543CEA5-FA31-44BD-8E17-A5851AAE7BA2@gmail.com> On February 16, 2015 4:37:44 PM CST, Martin Kolman wrote: >Mon, 16 Feb 2015 16:23:37 -0600 Cyd Haselton : >> More information: >> After uncommenting the select module in Setup, running make clean && >> make && make install, then running python3, then help(), I get the >> following: >> >> bld/python/Python-3.4.2 $ python3 >> Python 3.4.2 (default, Feb 16 2015, 12:33:03) >> [GCC 4.9.2] on linux >> Type "help", "copyright", "credits" or "license" for more >information. >> >>> help() >> Traceback (most recent call last): >> File "", line 1, in >> File "/usr/python/lib/python3.4/_sitebuiltins.py >> ", line 102, in __call__ >> import pydoc >> File "/usr/python/lib/python3.4/pydoc.py ", line 62, > >> in >> import platform >> File "/usr/python/lib/python3.4/platform.py ", >> line 115, in >> import sys, os, re, subprocess >> File "/usr/python/lib/python3.4/subprocess.py >", >> line 352, in >> import time >> ImportError: dlopen failed: cannot locate symbol >> "PyUnicode_DecodeLocale" referenced by "time.cpython-34m.so >> "... >> >> The symbol is in libpython.3.4m.so .1...and > >> UND in time.cpython-34m.so . For some >> reason time isn't finding the symbol in the shared library. >Android does not support versioning in SONAMES[0][1][2] - maybe that's >what is causing these issues ? > >[0] https://code.google.com/p/android/issues/detail?id=55868 >[1] >https://groups.google.com/d/msg/android-ndk/_UhNpRJlA1k/hbryqzEgN94J >[3] https://github.com/MysticTreeGames/Boost-for-Android/issues/44 >> > I'll try removing the versioning to see if that does the trick,but that would be odd...if I remove the libpython.3.4m.so.1 from /lib, I can't even run python bld/python/Python-3.4.2 $ rm /lib/libpython3.4m.so* /bld/python/Python-3.4.2 $ python3 CANNOT LINK EXECUTABLE: could not load library "libpython3.4m.so.1.0" needed by "python3"; caused by library "libpython3.4m.so.1.0" not found It's just the time module that doesn't find the library. > -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Tue Feb 17 20:52:27 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Tue, 17 Feb 2015 13:52:27 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <54E27138.4060908@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> Message-ID: <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> On February 16, 2015 4:37:44 PM CST, Martin Kolman wrote: >Mon, 16 Feb 2015 16:23:37 -0600 Cyd Haselton : >> More information: >> After uncommenting the select module in Setup, running make clean && >> make && make install, then running python3, then help(), I get the >> following: >> >> bld/python/Python-3.4.2 $ python3 >> Python 3.4.2 (default, Feb 16 2015, 12:33:03) >> [GCC 4.9.2] on linux >> Type "help", "copyright", "credits" or "license" for more >information. >> >>> help() >> Traceback (most recent call last): >> File "", line 1, in >> File "/usr/python/lib/python3.4/_sitebuiltins.py >> ", line 102, in __call__ >> import pydoc >> File "/usr/python/lib/python3.4/pydoc.py ", line 62, > >> in >> import platform >> File "/usr/python/lib/python3.4/platform.py ", >> line 115, in >> import sys, os, re, subprocess >> File "/usr/python/lib/python3.4/subprocess.py >", >> line 352, in >> import time >> ImportError: dlopen failed: cannot locate symbol >> "PyUnicode_DecodeLocale" referenced by "time.cpython-34m.so >> "... >> >> The symbol is in libpython.3.4m.so .1...and > >> UND in time.cpython-34m.so . For some >> reason time isn't finding the symbol in the shared library. >Android does not support versioning in SONAMES[0][1][2] - maybe that's >what is causing these issues ? > >[0] https://code.google.com/p/android/issues/detail?id=55868 >[1] >https://groups.google.com/d/msg/android-ndk/_UhNpRJlA1k/hbryqzEgN94J >[3] https://github.com/MysticTreeGames/Boost-for-Android/issues/44 >> > Re-building with an unversioned library unfortunately did not resolve the issue; still getting the ImportError. What other reasons could there be for time not finding the symbol in the installed library? -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Tue Feb 17 23:39:43 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Tue, 17 Feb 2015 16:39:43 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> Message-ID: <38F40618-B8E9-4F39-8010-3353F3640650@gmail.com> On February 17, 2015 1:52:27 PM CST, Cyd Haselton wrote: > > >On February 16, 2015 4:37:44 PM CST, Martin Kolman > wrote: >>Mon, 16 Feb 2015 16:23:37 -0600 Cyd Haselton : >>> More information: >>> After uncommenting the select module in Setup, running make clean && > >>> make && make install, then running python3, then help(), I get the >>> following: >>> >>> bld/python/Python-3.4.2 $ python3 >>> Python 3.4.2 (default, Feb 16 2015, 12:33:03) >>> [GCC 4.9.2] on linux >>> Type "help", "copyright", "credits" or "license" for more >>information. >>> >>> help() >>> Traceback (most recent call last): >>> File "", line 1, in >>> File "/usr/python/lib/python3.4/_sitebuiltins.py >>> ", line 102, in __call__ >>> import pydoc >>> File "/usr/python/lib/python3.4/pydoc.py ", line >62, >> >>> in >>> import platform >>> File "/usr/python/lib/python3.4/platform.py ", >>> line 115, in >>> import sys, os, re, subprocess >>> File "/usr/python/lib/python3.4/subprocess.py >>", >>> line 352, in >>> import time >>> ImportError: dlopen failed: cannot locate symbol >>> "PyUnicode_DecodeLocale" referenced by "time.cpython-34m.so >>> "... >>> >>> The symbol is in libpython.3.4m.so >.1...and >> >>> UND in time.cpython-34m.so . For some >>> reason time isn't finding the symbol in the shared library. >>Android does not support versioning in SONAMES[0][1][2] - maybe that's > >>what is causing these issues ? >> >>[0] https://code.google.com/p/android/issues/detail?id=55868 >>[1] >>https://groups.google.com/d/msg/android-ndk/_UhNpRJlA1k/hbryqzEgN94J >>[3] https://github.com/MysticTreeGames/Boost-for-Android/issues/44 >>> >> > >Re-building with an unversioned library unfortunately did not resolve >the issue; still getting the ImportError. > >What other reasons could there be for time not finding the symbol in >the installed library? Some additional import failures. I;ve compared build instructions for these modules and can't find anything that stands out as to why one module will import and the other doesn't: cpython-34m.so"... >>> import array Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PyErr_BadArgument" referenced by "array.cpython-34m.so"... >>> import pyexpat >>> import _json >>> import _lsprof >>> import _random Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PyMem_Malloc" referenced by "_random.cpython-34m.so"... >>> import zlib Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PyMem_Malloc" referenced by "zlib.cpython-34m.so"... >>> import _bisect Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PySequence_GetItem" referenced by "_bisect.cpython-34m.so"... >>> import _opcode >>> import _pickle Traceback (most recent call last): File "", line 1, in ImportError: dlopen failed: cannot locate symbol "PyErr_SetNone" referenced by "_pickle.cpython-34m.so"... -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From matthew.i.frank at intel.com Tue Feb 17 23:58:41 2015 From: matthew.i.frank at intel.com (Frank, Matthew I) Date: Tue, 17 Feb 2015 22:58:41 +0000 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <38F40618-B8E9-4F39-8010-3353F3640650@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> <38F40618-B8E9-4F39-8010-3353F3640650@gmail.com> Message-ID: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E14EA85@FMSMSX106.amr.corp.intel.com> On Tuesday, February 17, 2015 4:40 PM, Cyd Haselton wrote: > Some additional import failures. I;ve compared build instructions for these modules > and can't find anything that stands out as to why one module will import and the other > doesn't: [...] > ImportError: dlopen failed: cannot locate symbol "PyErr_BadArgument" referenced by > "array.cpython-34m.so"... [...] > ImportError: dlopen failed: cannot locate symbol "PyMem_Malloc" referenced by > "_random.cpython-34m.so"... [...] > ImportError: dlopen failed: cannot locate symbol "PyMem_Malloc" referenced by > "zlib.cpython-34m.so"... [...] > ImportError: dlopen failed: cannot locate symbol "PySequence_GetItem" referenced by > "_bisect.cpython-34m.so"... [...] > ImportError: dlopen failed: cannot locate symbol "PyErr_SetNone" referenced by > "_pickle.cpython-34m.so"... All those missing symbols are defined in libpython3.4m.so. I suspect that array.cpython-34m.so, _random.cpython-34m.so, zlib.cpython-34m.so, _bisect.cpython-34m.so and _pickle.cpython-34m.so were all compiled without the correct -lpython3 flag. I suspect that some other imports are not displaying this problem because, although they also are not compiled with -lpython3, they aren't trying to access symbols from libpython3.4m.so. If I'm correct, the problem here is with Android's broken dlopen(). On Linux (and every other Unix I'm aware of) when Executable A links B then tries to dlopen C, if C needs to access symbols from B it just succeeds (whether or not you linked C with "-lB".) On Android you _must_ link C against "-lB" for this to work. This is a known bug in Android's loader and won't be fixed, because the supposed security advantages of not accidentally linking something you didn't mean to link supposedly outweigh the disadvantages of not being able to correctly compile linux packages for Android. I ran into only a few instances of these when getting Python 3.4 to cross compile to Android, and none with missing -lpython3 flags (most were missing -lm flags). But I'm not running setup.py on the Android side. I'm running on it the Linux host (using the Python interpreter on the Linux host.) -Matt From chaselton at gmail.com Wed Feb 18 02:08:25 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Tue, 17 Feb 2015 19:08:25 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E14EA85@FMSMSX106.amr.corp.intel.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> <38F40618-B8E9-4F39-8010-3353F3640650@gmail.com> <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E14EA85@FMSMSX106.amr.corp.intel.com> Message-ID: <8B99B846-B0E8-41C4-8829-549127F09012@gmail.com> On February 17, 2015 4:58:41 PM CST, "Frank, Matthew I" wrote: >On Tuesday, February 17, 2015 4:40 PM, Cyd Haselton wrote: >> Some additional import failures. I;ve compared build instructions >for these modules >> and can't find anything that stands out as to why one module will >import and the other >> doesn't: >[...] >> ImportError: dlopen failed: cannot locate symbol "PyErr_BadArgument" >referenced by >> "array.cpython-34m.so"... >[...] >> ImportError: dlopen failed: cannot locate symbol "PyMem_Malloc" >referenced by >> "_random.cpython-34m.so"... >[...] >> ImportError: dlopen failed: cannot locate symbol "PyMem_Malloc" >referenced by >> "zlib.cpython-34m.so"... >[...] >> ImportError: dlopen failed: cannot locate symbol "PySequence_GetItem" >referenced by >> "_bisect.cpython-34m.so"... >[...] >> ImportError: dlopen failed: cannot locate symbol "PyErr_SetNone" >referenced by >> "_pickle.cpython-34m.so"... > >All those missing symbols are defined in libpython3.4m.so. I suspect >that array.cpython-34m.so, _random.cpython-34m.so, zlib.cpython-34m.so, >_bisect.cpython-34m.so and _pickle.cpython-34m.so were all compiled >without the correct -lpython3 flag. I suspect that some other imports >are not displaying this problem because, although they also are not >compiled with -lpython3, they aren't trying to access symbols from >libpython3.4m.so. > Interesting. I'll add -lpython3.4m to one of the setup.py built extensions to see if that resolves the issue. >If I'm correct, the problem here is with Android's broken dlopen(). On >Linux (and every other Unix I'm aware of) when Executable A links B >then tries to dlopen C, if C needs to access symbols from B it just >succeeds (whether or not you linked C with "-lB".) On Android you >_must_ link C against "-lB" for this to work. This is a known bug in >Android's loader and won't be fixed, because the supposed security >advantages of not accidentally linking something you didn't mean to >link supposedly outweigh the disadvantages of not being able to >correctly compile linux packages for Android. I can vaguely understand this rational, given Android is not Linux and wasn't really designed to be used in the way I'm attempting, but it doesn't make it any less annoying. > >I ran into only a few instances of these when getting Python 3.4 to >cross compile to Android, and none with missing -lpython3 flags (most >were missing -lm flags). But I'm not running setup.py on the Android >side. I'm running on it the Linux host (using the Python interpreter >on the Linux host.) > >-Matt -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Wed Feb 18 13:12:47 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Wed, 18 Feb 2015 06:12:47 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <8B99B846-B0E8-41C4-8829-549127F09012@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> <38F40618-B8E9-4F39-8010-3353F3640650@gmail.com> <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E14EA85@FMSMSX106.amr.corp.intel.com> <8B99B846-B0E8-41C4-8829-549127F09012@gmail.com> Message-ID: <24AD4AE9-7677-4F92-B594-287B9DA3AD1A@gmail.com> *snip* >>If I'm correct, the problem here is with Android's broken dlopen(). >On >>Linux (and every other Unix I'm aware of) when Executable A links B >>then tries to dlopen C, if C needs to access symbols from B it just >>succeeds (whether or not you linked C with "-lB".) On Android you >>_must_ link C against "-lB" for this to work. This is a known bug in >>Android's loader and won't be fixed, because the supposed security >>advantages of not accidentally linking something you didn't mean to >>link supposedly outweigh the disadvantages of not being able to >>correctly compile linux packages for Android. > >I can vaguely understand this rational, given Android is not Linux and >wasn't really designed to be used in the way I'm attempting, but it >doesn't make it any less annoying. >> >>I ran into only a few instances of these when getting Python 3.4 to >>cross compile to Android, and none with missing -lpython3 flags (most >>were missing -lm flags). But I'm not running setup.py on the Android >>side. I'm running on it the Linux host (using the Python interpreter >>on the Linux host.) >> >>-Matt Same error again, but I think I know what the problem was this time. I've added 'python3.4m' to sys_libs in setup.py...which should link it to the extension modules built by setup.py. I'll report back after this build is complete. Regarding the comments about Android's broken dlopen...I'm beginning to wonder if an Android device can really be a development/learning platform...even in a simulated Linux filesystem app like the one I am using. I've seen a few things about bootstrapping(?) other Linux distros from an Android device...it may be time to investigate further in that area. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Thu Feb 19 01:56:13 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Wed, 18 Feb 2015 18:56:13 -0600 Subject: [Mobile-sig] [Python-Dev] Import Fails in setup.py On Android In-Reply-To: <24AD4AE9-7677-4F92-B594-287B9DA3AD1A@gmail.com> References: <12482056-DEED-4974-B717-085A3C5D743E@gmail.com> <54E27138.4060908@gmail.com> <91820485-1D8D-4525-AF7B-58AEC3290E50@gmail.com> <38F40618-B8E9-4F39-8010-3353F3640650@gmail.com> <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E14EA85@FMSMSX106.amr.corp.intel.com> <8B99B846-B0E8-41C4-8829-549127F09012@gmail.com> <24AD4AE9-7677-4F92-B594-287B9DA3AD1A@gmail.com> Message-ID: Update: After several edits to Setup and make clean && make, I've finally got the interactive help() mostly working. The keywords, topics and symbols work. The modules segfaults python but addr2line has narrowed it down to unicodemodule.c:9052, so I have an idea of where to start. On February 18, 2015 6:12:47 AM CST, Cyd Haselton wrote: > > >*snip* > >>>If I'm correct, the problem here is with Android's broken dlopen(). >>On >>>Linux (and every other Unix I'm aware of) when Executable A links B >>>then tries to dlopen C, if C needs to access symbols from B it just >>>succeeds (whether or not you linked C with "-lB".) On Android you >>>_must_ link C against "-lB" for this to work. This is a known bug in >>>Android's loader and won't be fixed, because the supposed security >>>advantages of not accidentally linking something you didn't mean to >>>link supposedly outweigh the disadvantages of not being able to >>>correctly compile linux packages for Android. >> >>I can vaguely understand this rational, given Android is not Linux and >>wasn't really designed to be used in the way I'm attempting, but it >>doesn't make it any less annoying. >>> >>>I ran into only a few instances of these when getting Python 3.4 to >>>cross compile to Android, and none with missing -lpython3 flags (most >>>were missing -lm flags). But I'm not running setup.py on the Android >>>side. I'm running on it the Linux host (using the Python interpreter >>>on the Linux host.) >>> >>>-Matt > >Same error again, but I think I know what the problem was this time. >I've added 'python3.4m' to sys_libs in setup.py...which should link it >to the extension modules built by setup.py. > >I'll report back after this build is complete. > >Regarding the comments about Android's broken dlopen...I'm beginning to >wonder if an Android device can really be a development/learning >platform...even in a simulated Linux filesystem app like the one I am >using. > >I've seen a few things about bootstrapping(?) other Linux distros from >an Android device...it may be time to investigate further in that area. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Fri Feb 20 01:26:22 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Thu, 19 Feb 2015 18:26:22 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port Message-ID: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> Thanks to the help and input of people from this and the python-dev list I've hacked together a nearly complete port of Python 3.4.2 to Android...specifically the KBOX system running on Android. I'm currently working at what I hope is the last bug...typing 'modules string' segfaults the python binary. I started this with the mindset that the port was just a step on the way to porting Mozilla's SpiderMonkey. I still intend to do this but I'm also wondering if, given the huge amount of work it's been, there is any public usefulness to this port. If so, what would be the next steps? Keep in mind that I am relatively new to pretty much everything related to the Linux platform, code development/contribution/maintenance and the like. Regards, Cyd -- Sent from Android -------------- next part -------------- An HTML attachment was scrubbed... URL: From russell at keith-magee.com Fri Feb 20 04:00:22 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Fri, 20 Feb 2015 11:00:22 +0800 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> Message-ID: On Fri, Feb 20, 2015 at 8:26 AM, Cyd Haselton wrote: > Thanks to the help and input of people from this and the python-dev list > I've hacked together a nearly complete port of Python 3.4.2 to > Android...specifically the KBOX system running on Android. I'm currently > working at what I hope is the last bug...typing 'modules string' segfaults > the python binary. > > I started this with the mindset that the port was just a step on the way > to porting Mozilla's SpiderMonkey. I still intend to do this but I'm also > wondering if, given the huge amount of work it's been, there is any public > usefulness to this port. > > If so, what would be the next steps? Keep in mind that I am relatively new > to pretty much everything related to the Linux platform, code > development/contribution/maintenance and the like. > Are you looking for advice on the next steps for building SpiderMonkey? If this is the case, then I'm not sure this is the best forum for that discussion. This is a *Python* mobile-sig, not a general purpose Mobile development forum. I'm not sure I see the connection between SpiderMonkey and Python in this instance (although I admit I might be missing some relevant but non-obvious connection here). If you want advice on how to build SpiderMonkey, then a general purpose Android mailing list would be a better forum. However, if you're looking for advice on how to advance your Python 3.4.2 port, then I would guess the next step is to share your patches and build instructions. Others have shared patches, but I don't think we're quite at the point of a set of patches that could be applied to the Python source tree that would make Android a platform supported by Python "out-of-the-box". Everything I've seen to date involves post-patching Makefiles, pyconfig.h, or providing other post-configure modifications of the source tree, or results in a sys.platform that identifies as "Linux". Don't get me wrong - getting Python to work on Android *at all* is obviously an achievement - but to my mind, the end goal should be to get the source tree to a point where it *isn't* a big achievement - just a simple set of instructions using a default source download. Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Fri Feb 20 04:22:20 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Thu, 19 Feb 2015 21:22:20 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> Message-ID: <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> On February 19, 2015 9:00:22 PM CST, Russell Keith-Magee wrote: >On Fri, Feb 20, 2015 at 8:26 AM, Cyd Haselton >wrote: > >> Thanks to the help and input of people from this and the python-dev >list >> I've hacked together a nearly complete port of Python 3.4.2 to >> Android...specifically the KBOX system running on Android. I'm >currently >> working at what I hope is the last bug...typing 'modules string' >segfaults >> the python binary. >> >> I started this with the mindset that the port was just a step on the >way >> to porting Mozilla's SpiderMonkey. I still intend to do this but I'm >also >> wondering if, given the huge amount of work it's been, there is any >public >> usefulness to this port. >> >> If so, what would be the next steps? Keep in mind that I am >relatively new >> to pretty much everything related to the Linux platform, code >> development/contribution/maintenance and the like. >> > >Are you looking for advice on the next steps for building SpiderMonkey? >If >this is the case, then I'm not sure this is the best forum for that >discussion. This is a *Python* mobile-sig, not a general purpose Mobile >development forum. I'm not sure I see the connection between >SpiderMonkey >and Python in this instance (although I admit I might be missing some >relevant but non-obvious connection here). If you want advice on how to >build SpiderMonkey, then a general purpose Android mailing list would >be a >better forum. > Last time I checked Python was a prerequisite for SpiderMonkey but no i'm not asking for advice on how to port it. >However, if you're looking for advice on how to advance your Python >3.4.2 >port, then I would guess the next step is to share your patches and >build >instructions. Others have shared patches, but I don't think we're quite >at >the point of a set of patches that could be applied to the Python >source >tree that would make Android a platform supported by Python >"out-of-the-box". Everything I've seen to date involves post-patching >Makefiles, pyconfig.h, or providing other post-configure modifications >of >the source tree, or results in a sys.platform that identifies as >"Linux". > With the exception of a tricky segfault issue all of the patches I applied were ones I found at bugs.python.org or links included in bug reports at bugs.python.org. I've bookmarked them all, but what is the standard process/format for sharing? Also, is there a problem with sys.platform identifying as Linux if ./configure detects it as such? >Don't get me wrong - getting Python to work on Android *at all* is >obviously an achievement - but to my mind, the end goal should be to >get >the source tree to a point where it *isn't* a big achievement - just a >simple set of instructions using a default source download. > Provided I can share patches and build instructions properly would this port be a useful contribution towards that end goal? -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From russell at keith-magee.com Fri Feb 20 05:44:46 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Fri, 20 Feb 2015 12:44:46 +0800 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> Message-ID: On Fri, Feb 20, 2015 at 11:22 AM, Cyd Haselton wrote: > > > On February 19, 2015 9:00:22 PM CST, Russell Keith-Magee < > russell at keith-magee.com> wrote: > >On Fri, Feb 20, 2015 at 8:26 AM, Cyd Haselton > >wrote: > > > >> Thanks to the help and input of people from this and the python-dev > >list > >> I've hacked together a nearly complete port of Python 3.4.2 to > >> Android...specifically the KBOX system running on Android. I'm > >currently > >> working at what I hope is the last bug...typing 'modules string' > >segfaults > >> the python binary. > >> > >> I started this with the mindset that the port was just a step on the > >way > >> to porting Mozilla's SpiderMonkey. I still intend to do this but I'm > >also > >> wondering if, given the huge amount of work it's been, there is any > >public > >> usefulness to this port. > >> > >> If so, what would be the next steps? Keep in mind that I am > >relatively new > >> to pretty much everything related to the Linux platform, code > >> development/contribution/maintenance and the like. > >> > > > >Are you looking for advice on the next steps for building SpiderMonkey? > >If > >this is the case, then I'm not sure this is the best forum for that > >discussion. This is a *Python* mobile-sig, not a general purpose Mobile > >development forum. I'm not sure I see the connection between > >SpiderMonkey > >and Python in this instance (although I admit I might be missing some > >relevant but non-obvious connection here). If you want advice on how to > >build SpiderMonkey, then a general purpose Android mailing list would > >be a > >better forum. > > > > Last time I checked Python was a prerequisite for SpiderMonkey but no i'm > not asking for advice on how to port it. > A prerequisite for *running* SpiderMonkey, or *building* it? Because if you're just looking for a build, it sounds like you've just shaved the wrong yak :-) >However, if you're looking for advice on how to advance your Python > >3.4.2 > >port, then I would guess the next step is to share your patches and > >build > >instructions. Others have shared patches, but I don't think we're quite > >at > >the point of a set of patches that could be applied to the Python > >source > >tree that would make Android a platform supported by Python > >"out-of-the-box". Everything I've seen to date involves post-patching > >Makefiles, pyconfig.h, or providing other post-configure modifications > >of > >the source tree, or results in a sys.platform that identifies as > >"Linux". > > > > With the exception of a tricky segfault issue all of the patches I applied > were ones I found at bugs.python.org or links included in bug reports at > bugs.python.org. I've bookmarked them all, but what is the standard > process/format for sharing? > Well, there isn't a "standard" process that I'm aware of at the moment - this SIG is only a month or two old. Ultimately, I'd like to get someone from the core team in a corner and say "merge these N patches and you'll solve all our mobile problems". So - any knowledge sharing that helps to develop what tickets are on that hit list is a win. Also, is there a problem with sys.platform identifying as Linux if > ./configure detects it as such? > Well, Yes, Android is a "linux" - but that's really only true at the kernel level. It's not just a "Debian vs Ubuntu vs RedHat" type distinction - the filesystem is different, the process model is different, the system resources available at runtime are different, and so on. The same is true on iOS - Yes, technically, it is a Darwin kernel - but that's about where the similarity with OS/X ends. >From a practical perspective, there needs to be a way to identify that you aren't dealing with a Linux desktop machine, but an Android device (or, not a Mac, but an iPhone/iPad). To me, sys.platform seems like the most obvious place to make this distinction, but if someone wants to posit a different identifier (presumably on the basis that sys.platform is intended to be a kernel identifier), then fine. However, so far, I haven't seen any patches that add *any* sort of system identifier. > >Don't get me wrong - getting Python to work on Android *at all* is > >obviously an achievement - but to my mind, the end goal should be to > >get > >the source tree to a point where it *isn't* a big achievement - just a > >simple set of instructions using a default source download. > > > Provided I can share patches and build instructions properly would this > port be a useful contribution towards that end goal? > IMHO, a detailed post to this list or a link to a gist/blog post would both do the job. Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Fri Feb 20 05:55:24 2015 From: wes.turner at gmail.com (Wes Turner) Date: Thu, 19 Feb 2015 22:55:24 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> Message-ID: IIUC, you have a stack of patches and a build invocation that works. A buildbot, travisci, and/or other Makefile build config with filename-tagged artifacts (such as cross compiled archives) would be easy to maintain. Mercurial MQ or a bookmark would make rebasing for new CPython mainline releases easy. ( http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html#sec:mq:start ) ... http://en.wikipedia.org/wiki/Continuous_integration#Best_practices On Feb 19, 2015 6:26 PM, "Cyd Haselton" wrote: > Thanks to the help and input of people from this and the python-dev list > I've hacked together a nearly complete port of Python 3.4.2 to > Android...specifically the KBOX system running on Android. I'm currently > working at what I hope is the last bug...typing 'modules string' segfaults > the python binary. > > I started this with the mindset that the port was just a step on the way > to porting Mozilla's SpiderMonkey. I still intend to do this but I'm also > wondering if, given the huge amount of work it's been, there is any public > usefulness to this port. > > If so, what would be the next steps? Keep in mind that I am relatively new > to pretty much everything related to the Linux platform, code > development/contribution/maintenance and the like. > > Regards, > Cyd > > > -- > Sent from Android > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Fri Feb 20 07:02:09 2015 From: ethan at stoneleaf.us (Ethan Furman) Date: Thu, 19 Feb 2015 22:02:09 -0800 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> Message-ID: <54E6CDE1.5060002@stoneleaf.us> On 02/19/2015 07:22 PM, Cyd Haselton wrote: > Provided I can share patches and build instructions properly would this port be a useful contribution towards that end goal? Yes, it would. Make a new issue on bugs.python.org, with a title something like "complete steps to make a mobile Python", and in it reference all the other issues that you drew from, along with whatever you added to make it all work. List anything that still needs to be done (such as a better platform identifier). A meta-issue. :) -- ~Ethan~ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From ethan at stoneleaf.us Fri Feb 20 07:02:59 2015 From: ethan at stoneleaf.us (Ethan Furman) Date: Thu, 19 Feb 2015 22:02:59 -0800 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> Message-ID: <54E6CE13.3010408@stoneleaf.us> On 02/19/2015 08:55 PM, Wes Turner wrote: > Mercurial MQ or a bookmark would make rebasing for new CPython mainline releases easy. The goal is make mobile support part of Python trunk. -- ~Ethan~ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From wes.turner at gmail.com Fri Feb 20 08:22:12 2015 From: wes.turner at gmail.com (Wes Turner) Date: Fri, 20 Feb 2015 01:22:12 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <54E6CE13.3010408@stoneleaf.us> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> Message-ID: On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: > On 02/19/2015 08:55 PM, Wes Turner wrote: > > > Mercurial MQ or a bookmark would make rebasing for new CPython mainline > releases easy. > > The goal is make mobile support part of Python trunk. > * https://docs.python.org/devguide/index.html#contributing * Re: Android buildbot support: https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html * https://github.com/python/cpython/pulls * https://bitbucket.org/mirror/cpython/pull-requests -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Fri Feb 20 08:57:43 2015 From: ethan at stoneleaf.us (Ethan Furman) Date: Thu, 19 Feb 2015 23:57:43 -0800 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> Message-ID: <54E6E8F7.4010102@stoneleaf.us> On 02/19/2015 11:22 PM, Wes Turner wrote: > On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >> The goal is make mobile support part of Python trunk. > * https://docs.python.org/devguide/index.html#contributing > * Re: Android buildbot support: https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html > * https://github.com/python/cpython/pulls > * https://bitbucket.org/mirror/cpython/pull-requests And exactly what was that almost-entirely-context-free bulleted list supposed to explain? -- ~Ethan~ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From chaselton at gmail.com Fri Feb 20 12:40:17 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Fri, 20 Feb 2015 05:40:17 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> Message-ID: <8CFD7AC3-B381-4162-8FE6-D2E96AEBFD47@gmail.com> On February 19, 2015 10:44:46 PM CST, Russell Keith-Magee wrote: >On Fri, Feb 20, 2015 at 11:22 AM, Cyd Haselton >wrote: > >> >> >> On February 19, 2015 9:00:22 PM CST, Russell Keith-Magee < >> russell at keith-magee.com> wrote: >> >On Fri, Feb 20, 2015 at 8:26 AM, Cyd Haselton >> >wrote: >> > >> >> Thanks to the help and input of people from this and the >python-dev >> >list >> >> I've hacked together a nearly complete port of Python 3.4.2 to >> >> Android...specifically the KBOX system running on Android. I'm >> >currently >> >> working at what I hope is the last bug...typing 'modules string' >> >segfaults >> >> the python binary. >> >> >> >> I started this with the mindset that the port was just a step on >the >> >way >> >> to porting Mozilla's SpiderMonkey. I still intend to do this but >I'm >> >also >> >> wondering if, given the huge amount of work it's been, there is >any >> >public >> >> usefulness to this port. >> >> >> >> If so, what would be the next steps? Keep in mind that I am >> >relatively new >> >> to pretty much everything related to the Linux platform, code >> >> development/contribution/maintenance and the like. >> >> >> > >> >Are you looking for advice on the next steps for building >SpiderMonkey? >> >If >> >this is the case, then I'm not sure this is the best forum for that >> >discussion. This is a *Python* mobile-sig, not a general purpose >Mobile >> >development forum. I'm not sure I see the connection between >> >SpiderMonkey >> >and Python in this instance (although I admit I might be missing >some >> >relevant but non-obvious connection here). If you want advice on how >to >> >build SpiderMonkey, then a general purpose Android mailing list >would >> >be a >> >better forum. >> > >> >> Last time I checked Python was a prerequisite for SpiderMonkey but no >i'm >> not asking for advice on how to port it. >> > >A prerequisite for *running* SpiderMonkey, or *building* it? Because if >you're just looking for a build, it sounds like you've just shaved the >wrong yak :-) > Prereq for both, I thought. And I was intending to build on device >>However, if you're looking for advice on how to advance your Python >> >3.4.2 >> >port, then I would guess the next step is to share your patches and >> >build >> >instructions. Others have shared patches, but I don't think we're >quite >> >at >> >the point of a set of patches that could be applied to the Python >> >source >> >tree that would make Android a platform supported by Python >> >"out-of-the-box". Everything I've seen to date involves >post-patching >> >Makefiles, pyconfig.h, or providing other post-configure >modifications >> >of >> >the source tree, or results in a sys.platform that identifies as >> >"Linux". >> > >> >> With the exception of a tricky segfault issue all of the patches I >applied >> were ones I found at bugs.python.org or links included in bug reports >at >> bugs.python.org. I've bookmarked them all, but what is the standard >> process/format for sharing? >> > >Well, there isn't a "standard" process that I'm aware of at the moment >- >this SIG is only a month or two old. > >Ultimately, I'd like to get someone from the core team in a corner and >say >"merge these N patches and you'll solve all our mobile problems". So - >any >knowledge sharing that helps to develop what tickets are on that hit >list >is a win. > I'll pull the build directory off the device, pull out the modified files, get the bookmarked patches and make a list. >Also, is there a problem with sys.platform identifying as Linux if >> ./configure detects it as such? >> > >Well, Yes, Android is a "linux" - but that's really only true at the >kernel >level. It's not just a "Debian vs Ubuntu vs RedHat" type distinction - >the >filesystem is different, the process model is different, the system >resources available at runtime are different, and so on. > >The same is true on iOS - Yes, technically, it is a Darwin kernel - but >that's about where the similarity with OS/X ends. > >From a practical perspective, there needs to be a way to identify that >you >aren't dealing with a Linux desktop machine, but an Android device (or, >not >a Mac, but an iPhone/iPad). To me, sys.platform seems like the most >obvious >place to make this distinction, but if someone wants to posit a >different >identifier (presumably on the basis that sys.platform is intended to be >a >kernel identifier), then fine. However, so far, I haven't seen any >patches >that add *any* sort of system identifier. > I have little experience in using autoconf but I do know that, as of GCC 4.8 the -mbionic -mandroid flags define __ANDROID__...perhaps there is a way for setup.py or Setup to key off that to update sys.platform > >> >Don't get me wrong - getting Python to work on Android *at all* is >> >obviously an achievement - but to my mind, the end goal should be to >> >get >> >the source tree to a point where it *isn't* a big achievement - just >a >> >simple set of instructions using a default source download. >> > >> Provided I can share patches and build instructions properly would >this >> port be a useful contribution towards that end goal? >> > >IMHO, a detailed post to this list or a link to a gist/blog post would >both >do the job. > Will do after I;ve compiled the info >Yours, >Russ Magee %-) -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Fri Feb 20 13:10:57 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Fri, 20 Feb 2015 06:10:57 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <54E6CDE1.5060002@stoneleaf.us> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> <54E6CDE1.5060002@stoneleaf.us> Message-ID: On February 20, 2015 12:02:09 AM CST, Ethan Furman wrote: >On 02/19/2015 07:22 PM, Cyd Haselton wrote: > >> Provided I can share patches and build instructions properly would >this port be a useful contribution towards that end goal? > >Yes, it would. > >Make a new issue on bugs.python.org, with a title something like >"complete steps to make a mobile Python", and in it >reference all the other issues that you drew from, along with whatever >you added to make it all work. > >List anything that still needs to be done (such as a better platform >identifier). > >A meta-issue. :) > >-- >~Ethan~ > Okay. I'll get cracking. > > >------------------------------------------------------------------------ > >_______________________________________________ >Mobile-sig mailing list >Mobile-sig at python.org >https://mail.python.org/mailman/listinfo/mobile-sig -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From chaselton at gmail.com Fri Feb 20 13:18:34 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Fri, 20 Feb 2015 06:18:34 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <54E6E8F7.4010102@stoneleaf.us> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> Message-ID: <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> On February 20, 2015 1:57:43 AM CST, Ethan Furman wrote: >On 02/19/2015 11:22 PM, Wes Turner wrote: >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: > >>> The goal is make mobile support part of Python trunk. > >> * https://docs.python.org/devguide/index.html#contributing >> * Re: Android buildbot support: >https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >> * https://github.com/python/cpython/pulls >> * https://bitbucket.org/mirror/cpython/pull-requests > >And exactly what was that almost-entirely-context-free bulleted list >supposed to explain? > >-- >~Ethan~ > Technically the first two were links to helpful information about contributing towards CPython. I''m assuming the last two were links to places to host the port. While I have ported git to this device I've limited experience with using it so instructions would also have been helpful...though I can find them on my own. > > >------------------------------------------------------------------------ > >_______________________________________________ >Mobile-sig mailing list >Mobile-sig at python.org >https://mail.python.org/mailman/listinfo/mobile-sig -- Sent from my Android device with K-9 Mail. Please excuse my brevity. From sunfish7 at gmail.com Fri Feb 20 13:26:06 2015 From: sunfish7 at gmail.com (=?utf-8?B?z4A=?=) Date: Fri, 20 Feb 2015 12:26:06 +0000 Subject: [Mobile-sig] Android & iOS ports Message-ID: <622E013D-7376-4F53-A51A-29F58D46C3F1@gmail.com> I'm very glad to see someone working on an Android port. I think the folks at Kivy will be interested. They have ported Python 2.x to iOS and Android but they haven't yet addressed 3.x. It's been on their ToDo list for some time. I'm also interested. I've just finished writing a C++ Python wrapper (https://github.com/p-i-/PiCxx ) and I've been hoping that iOS and Android Ports of Python3 would emerge at some time in the near future. My plan is to integrate Python into JUCE, which targets Windows, Linux, OS X and also iOS, Android. Does anyone know the status of Python3 iOS porting? ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From phil at riverbankcomputing.com Fri Feb 20 14:06:20 2015 From: phil at riverbankcomputing.com (Phil Thompson) Date: Fri, 20 Feb 2015 13:06:20 +0000 Subject: [Mobile-sig] Android & iOS ports In-Reply-To: <622E013D-7376-4F53-A51A-29F58D46C3F1@gmail.com> References: <622E013D-7376-4F53-A51A-29F58D46C3F1@gmail.com> Message-ID: <69b3c4bbec4a8b6a06a9f60961ec99fb@riverbankcomputing.com> On 20/02/2015 12:26 pm, ? wrote: > I'm very glad to see someone working on an Android port. > > I think the folks at Kivy > will be > interested. They have ported Python 2.x to iOS and Android but they > haven't yet addressed 3.x. It's been on their ToDo list for some time. > > I'm also interested. I've just finished writing a C++ Python wrapper > (https://github.com/p-i-/PiCxx ) and > I've been hoping that iOS and Android Ports of Python3 would emerge at > some time in the near future. > > My plan is to integrate Python into JUCE, which targets Windows, > Linux, OS X and also iOS, Android. > > Does anyone know the status of Python3 iOS porting? You might want to look at... http://pyqt.sourceforge.net/Docs/pyqtdeploy/ Unlike Android, iOS doesn't seem to need any patches, just the correct configuration. Phil From russell at keith-magee.com Sat Feb 21 03:05:35 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Sat, 21 Feb 2015 10:05:35 +0800 Subject: [Mobile-sig] Android & iOS ports In-Reply-To: <622E013D-7376-4F53-A51A-29F58D46C3F1@gmail.com> References: <622E013D-7376-4F53-A51A-29F58D46C3F1@gmail.com> Message-ID: On Fri, Feb 20, 2015 at 8:26 PM, ? wrote: > I'm very glad to see someone working on an Android port. > > I think the folks at Kivy > will be interested. > They have ported Python 2.x to iOS and Android but they haven't yet > addressed 3.x. It's been on their ToDo list for some time. > > I'm also interested. I've just finished writing a C++ Python wrapper ( > https://github.com/p-i-/PiCxx) and I've been hoping that iOS and Android > Ports of Python3 would emerge at some time in the near future. > > My plan is to integrate Python into JUCE, which targets Windows, Linux, OS > X and also iOS, Android. > > Does anyone know the status of Python3 iOS porting? > I'm currently focussing on patches for an iOS build. I've got Python 3.4.2 working on the iOS simulator, but the build process still requires a couple of post-configure patches. There are also some runtime problems with POSIX-related features (which, at the moment, look like they might be related to the configure problems). Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Sat Feb 21 21:48:25 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sat, 21 Feb 2015 14:48:25 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <54E6CDE1.5060002@stoneleaf.us> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <5EDB7CBB-8734-4971-8DD9-66D2045585BA@gmail.com> <54E6CDE1.5060002@stoneleaf.us> Message-ID: <7D5E508D-EE35-4D2B-934F-E0D38CDFF55B@gmail.com> Submitted. http://bugs.python.org/issue23496 On February 20, 2015 12:02:09 AM CST, Ethan Furman wrote: >On 02/19/2015 07:22 PM, Cyd Haselton wrote: > >> Provided I can share patches and build instructions properly would >this port be a useful contribution towards that end goal? > >Yes, it would. > >Make a new issue on bugs.python.org, with a title something like >"complete steps to make a mobile Python", and in it >reference all the other issues that you drew from, along with whatever >you added to make it all work. > >List anything that still needs to be done (such as a better platform >identifier). > >A meta-issue. :) > >-- >~Ethan~ > > > >------------------------------------------------------------------------ > >_______________________________________________ >Mobile-sig mailing list >Mobile-sig at python.org >https://mail.python.org/mailman/listinfo/mobile-sig -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Sat Feb 21 23:44:25 2015 From: wes.turner at gmail.com (Wes Turner) Date: Sat, 21 Feb 2015 16:44:25 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> Message-ID: One could: * Submit a group of patches as attachments on a bug in the issue trackers and link to the patches (in sequence, if necessary) [described in detail in the devguide] and hope that others can reproduce the build * Create a git branch and a GitHub pull request [there are currently a few PRs at gh:python/cpython] * http://documentup.com/skwp/git-workflows-book * If there was a repository PR hook, the CI system would build the code on each push to a PR branch (such as w/ buildbot) * Create a git patch series with git-guilt * Create an hg branch (or bookmark, if you're working with hg-git and want to approximate git branches) and a bitbucket pull request [there are currently zero PRs at bb:mirror/cpython] * Create a patch queue with a series of patches w/ Mercurial MQ: * http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html ... I've collected a number of VCS docs links here: https://westurner.github.io/tools/#version-control-systems On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton wrote: > > > On February 20, 2015 1:57:43 AM CST, Ethan Furman > wrote: > >On 02/19/2015 11:22 PM, Wes Turner wrote: > >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: > > > >>> The goal is make mobile support part of Python trunk. > > > >> * https://docs.python.org/devguide/index.html#contributing > >> * Re: Android buildbot support: > >https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html > >> * https://github.com/python/cpython/pulls > >> * https://bitbucket.org/mirror/cpython/pull-requests > > > >And exactly what was that almost-entirely-context-free bulleted list > >supposed to explain? > > > >-- > >~Ethan~ > > > > Technically the first two were links to helpful information about > contributing towards CPython. > > I''m assuming the last two were links to places to host the port. While I > have ported git to this device I've limited experience with using it so > instructions would also have been helpful...though I can find them on my > own. > > > > > >------------------------------------------------------------------------ > > > >_______________________________________________ > >Mobile-sig mailing list > >Mobile-sig at python.org > >https://mail.python.org/mailman/listinfo/mobile-sig > > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > _______________________________________________ > Mobile-sig mailing list > Mobile-sig at python.org > https://mail.python.org/mailman/listinfo/mobile-sig > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Sun Feb 22 01:57:20 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sat, 21 Feb 2015 18:57:20 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> Message-ID: First suggestion completed at http://bugs.python.org/issue23496. I'll attempt either two or three once I've done more research/study on git... On Sat, Feb 21, 2015 at 4:44 PM, Wes Turner wrote: > One could: > > * Submit a group of patches as attachments on a bug in the issue trackers > and link to the patches (in sequence, if necessary) [described in detail in > the devguide] and hope that others can reproduce the build > > * Create a git branch and a GitHub pull request [there are currently a few > PRs at gh:python/cpython] > * http://documentup.com/skwp/git-workflows-book > * If there was a repository PR hook, the CI system would build the code on > each push to a PR branch (such as w/ buildbot) > * Create a git patch series with git-guilt > > * Create an hg branch (or bookmark, if you're working with hg-git and want > to approximate git branches) and a bitbucket pull request [there are > currently zero PRs at bb:mirror/cpython] > * Create a patch queue with a series of patches w/ Mercurial MQ: > * > http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html > > ... I've collected a number of VCS docs links here: > https://westurner.github.io/tools/#version-control-systems > > On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton wrote: >> >> >> >> On February 20, 2015 1:57:43 AM CST, Ethan Furman >> wrote: >> >On 02/19/2015 11:22 PM, Wes Turner wrote: >> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >> > >> >>> The goal is make mobile support part of Python trunk. >> > >> >> * https://docs.python.org/devguide/index.html#contributing >> >> * Re: Android buildbot support: >> >https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >> >> * https://github.com/python/cpython/pulls >> >> * https://bitbucket.org/mirror/cpython/pull-requests >> > >> >And exactly what was that almost-entirely-context-free bulleted list >> >supposed to explain? >> > >> >-- >> >~Ethan~ >> > >> >> Technically the first two were links to helpful information about >> contributing towards CPython. >> >> I''m assuming the last two were links to places to host the port. While I >> have ported git to this device I've limited experience with using it so >> instructions would also have been helpful...though I can find them on my >> own. >> > >> > >> >------------------------------------------------------------------------ >> > >> >_______________________________________________ >> >Mobile-sig mailing list >> >Mobile-sig at python.org >> >https://mail.python.org/mailman/listinfo/mobile-sig >> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. >> _______________________________________________ >> Mobile-sig mailing list >> Mobile-sig at python.org >> https://mail.python.org/mailman/listinfo/mobile-sig > > From chaselton at gmail.com Sun Feb 22 13:03:31 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Sun, 22 Feb 2015 06:03:31 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> Message-ID: FYI, I just discovered a) basic instructions for diff and b) that the KBOX environment has a working diff. I'll update the 'meta issue' with prooer patches as soon as possible. On February 21, 2015 4:44:25 PM CST, Wes Turner wrote: >One could: > >* Submit a group of patches as attachments on a bug in the issue >trackers >and link to the patches (in sequence, if necessary) [described in >detail in >the devguide] and hope that others can reproduce the build > >* Create a git branch and a GitHub pull request [there are currently a >few >PRs at gh:python/cpython] > * http://documentup.com/skwp/git-workflows-book >* If there was a repository PR hook, the CI system would build the code >on each push to a PR branch (such as w/ buildbot) >* Create a git patch series with git-guilt > >* Create an hg branch (or bookmark, if you're working with hg-git and >want >to approximate git branches) and a bitbucket pull request [there are >currently zero PRs at bb:mirror/cpython] >* Create a patch queue with a series of patches w/ Mercurial MQ: > * >http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html > >... I've collected a number of VCS docs links here: >https://westurner.github.io/tools/#version-control-systems > >On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton >wrote: > >> >> >> On February 20, 2015 1:57:43 AM CST, Ethan Furman > >> wrote: >> >On 02/19/2015 11:22 PM, Wes Turner wrote: >> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >> > >> >>> The goal is make mobile support part of Python trunk. >> > >> >> * https://docs.python.org/devguide/index.html#contributing >> >> * Re: Android buildbot support: >> >>https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >> >> * https://github.com/python/cpython/pulls >> >> * https://bitbucket.org/mirror/cpython/pull-requests >> > >> >And exactly what was that almost-entirely-context-free bulleted list >> >supposed to explain? >> > >> >-- >> >~Ethan~ >> > >> >> Technically the first two were links to helpful information about >> contributing towards CPython. >> >> I''m assuming the last two were links to places to host the port. >While I >> have ported git to this device I've limited experience with using it >so >> instructions would also have been helpful...though I can find them on >my >> own. >> > >> > >> >>------------------------------------------------------------------------ >> > >> >_______________________________________________ >> >Mobile-sig mailing list >> >Mobile-sig at python.org >> >https://mail.python.org/mailman/listinfo/mobile-sig >> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. >> _______________________________________________ >> Mobile-sig mailing list >> Mobile-sig at python.org >> https://mail.python.org/mailman/listinfo/mobile-sig >> -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Tue Feb 24 14:53:40 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Tue, 24 Feb 2015 07:53:40 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> Message-ID: <6627CA60-AD56-493B-AE63-BCB42545E80F@gmail.com> Wes, et. al. What would be the recommended route...of the ones you mentioned... assuming the following: 1) Steep learning curve for git/hg VCS (near-zero knowledge for both) 2) Limited amount of time. I've submitted a meta-issue at bugs.python.org ( http://bugs.python.org/issue23496) but I'm now debating in which of the following to invest time and effort: a) clean up and submit patches for the existing issue and write more detailed build instructions b) port Mercurial to the KBOX android env, learn Mercurial, and create a hg branch for android c) Learn git and work with the existing KBOX android port of git to create a git branch for android Addional input/suggestions welcome On February 21, 2015 4:44:25 PM CST, Wes Turner wrote: >One could: > >* Submit a group of patches as attachments on a bug in the issue >trackers >and link to the patches (in sequence, if necessary) [described in >detail in >the devguide] and hope that others can reproduce the build > >* Create a git branch and a GitHub pull request [there are currently a >few >PRs at gh:python/cpython] > * http://documentup.com/skwp/git-workflows-book >* If there was a repository PR hook, the CI system would build the code >on each push to a PR branch (such as w/ buildbot) >* Create a git patch series with git-guilt > >* Create an hg branch (or bookmark, if you're working with hg-git and >want >to approximate git branches) and a bitbucket pull request [there are >currently zero PRs at bb:mirror/cpython] >* Create a patch queue with a series of patches w/ Mercurial MQ: > * >http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html > >... I've collected a number of VCS docs links here: >https://westurner.github.io/tools/#version-control-systems > >On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton >wrote: > >> >> >> On February 20, 2015 1:57:43 AM CST, Ethan Furman > >> wrote: >> >On 02/19/2015 11:22 PM, Wes Turner wrote: >> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >> > >> >>> The goal is make mobile support part of Python trunk. >> > >> >> * https://docs.python.org/devguide/index.html#contributing >> >> * Re: Android buildbot support: >> >>https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >> >> * https://github.com/python/cpython/pulls >> >> * https://bitbucket.org/mirror/cpython/pull-requests >> > >> >And exactly what was that almost-entirely-context-free bulleted list >> >supposed to explain? >> > >> >-- >> >~Ethan~ >> > >> >> Technically the first two were links to helpful information about >> contributing towards CPython. >> >> I''m assuming the last two were links to places to host the port. >While I >> have ported git to this device I've limited experience with using it >so >> instructions would also have been helpful...though I can find them on >my >> own. >> > >> > >> >>------------------------------------------------------------------------ >> > >> >_______________________________________________ >> >Mobile-sig mailing list >> >Mobile-sig at python.org >> >https://mail.python.org/mailman/listinfo/mobile-sig >> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. >> _______________________________________________ >> Mobile-sig mailing list >> Mobile-sig at python.org >> https://mail.python.org/mailman/listinfo/mobile-sig >> -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Tue Feb 24 15:35:51 2015 From: wes.turner at gmail.com (Wes Turner) Date: Tue, 24 Feb 2015 08:35:51 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <6627CA60-AD56-493B-AE63-BCB42545E80F@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> <6627CA60-AD56-493B-AE63-BCB42545E80F@gmail.com> Message-ID: If git is already ported to KBOX, that might be easiest; but it's probably worth it to try and install Hg: * CPython core is Hg * I find it easiest to maintain a stack of changing patches with the Hg MQ extension, which is plain python (esp. with TortoiseHg) * Hg core does build C extensions, which probably compile with KBOX GCC * https://pip.pypa.io/en/latest/installing.html * pip install mercurial * An Hg MQ patch queue can be separately version controlled (and e.g. hosted w/ BitBucket as something like 'cpython-android-patches') pending review and merge back into default if at all possible Either way, a branch or patch queue might need to be rebased if the underlying code changes. Many CPython core devs do seem to prefer Hg. See "Docs:" https://westurner.github.io/tools/#version-control-systems hg clone https://hg.python.org/cpython cd cpython Hg tags Hg update -C -r tagstr # -C clears any changes in the working directory # w/ a branch Hg branch newbranchname # add a commit Hg status Hg diff Hg add file names Hg status Hg diff Hg commit # repeat Hg push # w/ mq # add mq ext to ~/.hgrc # create .hg/patches Hg qinit -c # create a new patch Hg qnew newpatchname.diff Hg add file names Hg diff Hg qdiff Hg qrefresh Hg qcommit # repeat Hg qpush Hg help qimport From http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html : > If you receive a patch from someone that you want to add to your patch queue, and the patch needs a strip count other than one, you cannot just qimport the patch, because qimport does not yet have a -p option (see issue 311). ... I'm on my phone, so 'Hg' should be 'hg' On Feb 24, 2015 7:53 AM, "Cyd Haselton" wrote: > Wes, et. al. > What would be the recommended route...of the ones you mentioned... > assuming the following: > 1) Steep learning curve for git/hg VCS (near-zero knowledge for both) > 2) Limited amount of time. > > I've submitted a meta-issue at bugs.python.org ( > http://bugs.python.org/issue23496) but I'm now debating in which of the > following to invest time and effort: > a) clean up and submit patches for the existing issue and write more > detailed build instructions > b) port Mercurial to the KBOX android env, learn Mercurial, and create a > hg branch for android > c) Learn git and work with the existing KBOX android port of git to create > a git branch for android > > Addional input/suggestions welcome > > On February 21, 2015 4:44:25 PM CST, Wes Turner > wrote: >> >> One could: >> >> * Submit a group of patches as attachments on a bug in the issue trackers >> and link to the patches (in sequence, if necessary) [described in detail in >> the devguide] and hope that others can reproduce the build >> >> * Create a git branch and a GitHub pull request [there are currently a >> few PRs at gh:python/cpython] >> * http://documentup.com/skwp/git-workflows-book >> * If there was a repository PR hook, the CI system would build the code >> on each push to a PR branch (such as w/ buildbot) >> * Create a git patch series with git-guilt >> >> * Create an hg branch (or bookmark, if you're working with hg-git and >> want to approximate git branches) and a bitbucket pull request [there are >> currently zero PRs at bb:mirror/cpython] >> * Create a patch queue with a series of patches w/ Mercurial MQ: >> * >> http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >> >> ... I've collected a number of VCS docs links here: >> https://westurner.github.io/tools/#version-control-systems >> >> On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton >> wrote: >> >>> >>> >>> On February 20, 2015 1:57:43 AM CST, Ethan Furman >>> wrote: >>> >On 02/19/2015 11:22 PM, Wes Turner wrote: >>> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >>> > >>> >>> The goal is make mobile support part of Python trunk. >>> > >>> >> * https://docs.python.org/devguide/index.html#contributing >>> >> * Re: Android buildbot support: >>> >https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >>> >> * https://github.com/python/cpython/pulls >>> >> * https://bitbucket.org/mirror/cpython/pull-requests >>> > >>> >And exactly what was that almost-entirely-context-free bulleted list >>> >supposed to explain? >>> > >>> >-- >>> >~Ethan~ >>> > >>> >>> Technically the first two were links to helpful information about >>> contributing towards CPython. >>> >>> I''m assuming the last two were links to places to host the port. While >>> I have ported git to this device I've limited experience with using it so >>> instructions would also have been helpful...though I can find them on my >>> own. >>> > >>> > >>> >------------------------------------------------------------------------ >>> > >>> >_______________________________________________ >>> >Mobile-sig mailing list >>> >Mobile-sig at python.org >>> >https://mail.python.org/mailman/listinfo/mobile-sig >>> >>> -- >>> Sent from my Android device with K-9 Mail. Please excuse my brevity. >>> _______________________________________________ >>> Mobile-sig mailing list >>> Mobile-sig at python.org >>> https://mail.python.org/mailman/listinfo/mobile-sig >>> >> >> > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Wed Feb 25 11:06:38 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Wed, 25 Feb 2015 04:06:38 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> <6627CA60-AD56-493B-AE63-BCB42545E80F@gmail.com> Message-ID: <7B7C1551-47ED-4835-B1F3-A0332DAECB35@gmail.com> Yeah, I was afraid you were going to say that. I[ll grab the Mercurial source today and get started. On February 24, 2015 8:35:51 AM CST, Wes Turner wrote: >If git is already ported to KBOX, that might be easiest; but it's >probably >worth it to try and install Hg: > >* CPython core is Hg >* I find it easiest to maintain a stack of changing patches with the Hg >MQ >extension, which is plain python (esp. with TortoiseHg) >* Hg core does build C extensions, which probably compile with KBOX GCC > * https://pip.pypa.io/en/latest/installing.html > * pip install mercurial >* An Hg MQ patch queue can be separately version controlled (and e.g. >hosted w/ BitBucket as something like 'cpython-android-patches') >pending >review and merge back into default if at all possible > >Either way, a branch or patch queue might need to be rebased if the >underlying code changes. > >Many CPython core devs do seem to prefer Hg. > >See "Docs:" https://westurner.github.io/tools/#version-control-systems > >hg clone https://hg.python.org/cpython >cd cpython >Hg tags >Hg update -C -r tagstr ># -C clears any changes in the working directory > ># w/ a branch >Hg branch newbranchname ># add a commit >Hg status >Hg diff >Hg add file names >Hg status >Hg diff >Hg commit ># repeat >Hg push > ># w/ mq ># add mq ext to ~/.hgrc ># create .hg/patches >Hg qinit -c ># create a new patch >Hg qnew newpatchname.diff >Hg add file names >Hg diff >Hg qdiff >Hg qrefresh >Hg qcommit ># repeat >Hg qpush > >Hg help qimport > >From >http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >: > >> If you receive a patch from someone that you want to add to your >patch >queue, and the patch needs a strip count other than one, you cannot >just >qimport the patch, because qimport does not yet have a -p option (see >issue >311). > >... I'm on my phone, so 'Hg' should be 'hg' >On Feb 24, 2015 7:53 AM, "Cyd Haselton" wrote: > >> Wes, et. al. >> What would be the recommended route...of the ones you mentioned... >> assuming the following: >> 1) Steep learning curve for git/hg VCS (near-zero knowledge for both) >> 2) Limited amount of time. >> >> I've submitted a meta-issue at bugs.python.org ( >> http://bugs.python.org/issue23496) but I'm now debating in which of >the >> following to invest time and effort: >> a) clean up and submit patches for the existing issue and write more >> detailed build instructions >> b) port Mercurial to the KBOX android env, learn Mercurial, and >create a >> hg branch for android >> c) Learn git and work with the existing KBOX android port of git to >create >> a git branch for android >> >> Addional input/suggestions welcome >> >> On February 21, 2015 4:44:25 PM CST, Wes Turner > >> wrote: >>> >>> One could: >>> >>> * Submit a group of patches as attachments on a bug in the issue >trackers >>> and link to the patches (in sequence, if necessary) [described in >detail in >>> the devguide] and hope that others can reproduce the build >>> >>> * Create a git branch and a GitHub pull request [there are currently >a >>> few PRs at gh:python/cpython] >>> * http://documentup.com/skwp/git-workflows-book >>> * If there was a repository PR hook, the CI system would build the >code >>> on each push to a PR branch (such as w/ buildbot) >>> * Create a git patch series with git-guilt >>> >>> * Create an hg branch (or bookmark, if you're working with hg-git >and >>> want to approximate git branches) and a bitbucket pull request >[there are >>> currently zero PRs at bb:mirror/cpython] >>> * Create a patch queue with a series of patches w/ Mercurial MQ: >>> * >>> >http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >>> >>> ... I've collected a number of VCS docs links here: >>> https://westurner.github.io/tools/#version-control-systems >>> >>> On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton >>> wrote: >>> >>>> >>>> >>>> On February 20, 2015 1:57:43 AM CST, Ethan Furman > >>>> wrote: >>>> >On 02/19/2015 11:22 PM, Wes Turner wrote: >>>> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >>>> > >>>> >>> The goal is make mobile support part of Python trunk. >>>> > >>>> >> * https://docs.python.org/devguide/index.html#contributing >>>> >> * Re: Android buildbot support: >>>> >>https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >>>> >> * https://github.com/python/cpython/pulls >>>> >> * https://bitbucket.org/mirror/cpython/pull-requests >>>> > >>>> >And exactly what was that almost-entirely-context-free bulleted >list >>>> >supposed to explain? >>>> > >>>> >-- >>>> >~Ethan~ >>>> > >>>> >>>> Technically the first two were links to helpful information about >>>> contributing towards CPython. >>>> >>>> I''m assuming the last two were links to places to host the port. >While >>>> I have ported git to this device I've limited experience with using >it so >>>> instructions would also have been helpful...though I can find them >on my >>>> own. >>>> > >>>> > >>>> >>------------------------------------------------------------------------ >>>> > >>>> >_______________________________________________ >>>> >Mobile-sig mailing list >>>> >Mobile-sig at python.org >>>> >https://mail.python.org/mailman/listinfo/mobile-sig >>>> >>>> -- >>>> Sent from my Android device with K-9 Mail. Please excuse my >brevity. >>>> _______________________________________________ >>>> Mobile-sig mailing list >>>> Mobile-sig at python.org >>>> https://mail.python.org/mailman/listinfo/mobile-sig >>>> >>> >>> >> -- >> Sent from my Android device with K-9 Mail. Please excuse my brevity. >> -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From chaselton at gmail.com Wed Feb 25 13:23:52 2015 From: chaselton at gmail.com (Cyd Haselton) Date: Wed, 25 Feb 2015 06:23:52 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <7B7C1551-47ED-4835-B1F3-A0332DAECB35@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> <6627CA60-AD56-493B-AE63-BCB42545E80F@gmail.com> <7B7C1551-47ED-4835-B1F3-A0332DAECB35@gmail.com> Message-ID: <00423930-B5F5-49A2-99D0-8DCB1ACE33D1@gmail.com> Hang on...Mercurial only supports Python versions up to 2.7? Given that the version I;ve ported to KBOX is 3.4.2, this may be a deal breaker. Not sure if I want to spend time porting 2.7 *just* so that I can port Mercurial...especially if it means having both versions installed. Thoughts? Is there anything I couldn't do with git that makes porting Mercurial...and Python 2.7.x...a must? On February 25, 2015 4:06:38 AM CST, Cyd Haselton wrote: >Yeah, I was afraid you were going to say that. I[ll grab the Mercurial >source today and get started. > >On February 24, 2015 8:35:51 AM CST, Wes Turner >wrote: >>If git is already ported to KBOX, that might be easiest; but it's >>probably >>worth it to try and install Hg: >> >>* CPython core is Hg >>* I find it easiest to maintain a stack of changing patches with the >Hg >>MQ >>extension, which is plain python (esp. with TortoiseHg) >>* Hg core does build C extensions, which probably compile with KBOX >GCC >> * https://pip.pypa.io/en/latest/installing.html >> * pip install mercurial >>* An Hg MQ patch queue can be separately version controlled (and e.g. >>hosted w/ BitBucket as something like 'cpython-android-patches') >>pending >>review and merge back into default if at all possible >> >>Either way, a branch or patch queue might need to be rebased if the >>underlying code changes. >> >>Many CPython core devs do seem to prefer Hg. >> >>See "Docs:" https://westurner.github.io/tools/#version-control-systems >> >>hg clone https://hg.python.org/cpython >>cd cpython >>Hg tags >>Hg update -C -r tagstr >># -C clears any changes in the working directory >> >># w/ a branch >>Hg branch newbranchname >># add a commit >>Hg status >>Hg diff >>Hg add file names >>Hg status >>Hg diff >>Hg commit >># repeat >>Hg push >> >># w/ mq >># add mq ext to ~/.hgrc >># create .hg/patches >>Hg qinit -c >># create a new patch >>Hg qnew newpatchname.diff >>Hg add file names >>Hg diff >>Hg qdiff >>Hg qrefresh >>Hg qcommit >># repeat >>Hg qpush >> >>Hg help qimport >> >>From >>http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >>: >> >>> If you receive a patch from someone that you want to add to your >>patch >>queue, and the patch needs a strip count other than one, you cannot >>just >>qimport the patch, because qimport does not yet have a -p option (see >>issue >>311). >> >>... I'm on my phone, so 'Hg' should be 'hg' >>On Feb 24, 2015 7:53 AM, "Cyd Haselton" wrote: >> >>> Wes, et. al. >>> What would be the recommended route...of the ones you mentioned... >>> assuming the following: >>> 1) Steep learning curve for git/hg VCS (near-zero knowledge for >both) >>> 2) Limited amount of time. >>> >>> I've submitted a meta-issue at bugs.python.org ( >>> http://bugs.python.org/issue23496) but I'm now debating in which of >>the >>> following to invest time and effort: >>> a) clean up and submit patches for the existing issue and write more >>> detailed build instructions >>> b) port Mercurial to the KBOX android env, learn Mercurial, and >>create a >>> hg branch for android >>> c) Learn git and work with the existing KBOX android port of git to >>create >>> a git branch for android >>> >>> Addional input/suggestions welcome >>> >>> On February 21, 2015 4:44:25 PM CST, Wes Turner >> >>> wrote: >>>> >>>> One could: >>>> >>>> * Submit a group of patches as attachments on a bug in the issue >>trackers >>>> and link to the patches (in sequence, if necessary) [described in >>detail in >>>> the devguide] and hope that others can reproduce the build >>>> >>>> * Create a git branch and a GitHub pull request [there are >currently >>a >>>> few PRs at gh:python/cpython] >>>> * http://documentup.com/skwp/git-workflows-book >>>> * If there was a repository PR hook, the CI system would build >the >>code >>>> on each push to a PR branch (such as w/ buildbot) >>>> * Create a git patch series with git-guilt >>>> >>>> * Create an hg branch (or bookmark, if you're working with hg-git >>and >>>> want to approximate git branches) and a bitbucket pull request >>[there are >>>> currently zero PRs at bb:mirror/cpython] >>>> * Create a patch queue with a series of patches w/ Mercurial MQ: >>>> * >>>> >>http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >>>> >>>> ... I've collected a number of VCS docs links here: >>>> https://westurner.github.io/tools/#version-control-systems >>>> >>>> On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton >>>> wrote: >>>> >>>>> >>>>> >>>>> On February 20, 2015 1:57:43 AM CST, Ethan Furman >> >>>>> wrote: >>>>> >On 02/19/2015 11:22 PM, Wes Turner wrote: >>>>> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >>>>> > >>>>> >>> The goal is make mobile support part of Python trunk. >>>>> > >>>>> >> * https://docs.python.org/devguide/index.html#contributing >>>>> >> * Re: Android buildbot support: >>>>> >>>https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >>>>> >> * https://github.com/python/cpython/pulls >>>>> >> * https://bitbucket.org/mirror/cpython/pull-requests >>>>> > >>>>> >And exactly what was that almost-entirely-context-free bulleted >>list >>>>> >supposed to explain? >>>>> > >>>>> >-- >>>>> >~Ethan~ >>>>> > >>>>> >>>>> Technically the first two were links to helpful information about >>>>> contributing towards CPython. >>>>> >>>>> I''m assuming the last two were links to places to host the port. >>While >>>>> I have ported git to this device I've limited experience with >using >>it so >>>>> instructions would also have been helpful...though I can find them >>on my >>>>> own. >>>>> > >>>>> > >>>>> >>>------------------------------------------------------------------------ >>>>> > >>>>> >_______________________________________________ >>>>> >Mobile-sig mailing list >>>>> >Mobile-sig at python.org >>>>> >https://mail.python.org/mailman/listinfo/mobile-sig >>>>> >>>>> -- >>>>> Sent from my Android device with K-9 Mail. Please excuse my >>brevity. >>>>> _______________________________________________ >>>>> Mobile-sig mailing list >>>>> Mobile-sig at python.org >>>>> https://mail.python.org/mailman/listinfo/mobile-sig >>>>> >>>> >>>> >>> -- >>> Sent from my Android device with K-9 Mail. Please excuse my brevity. >>> > >-- >Sent from my Android device with K-9 Mail. Please excuse my brevity. -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Wed Feb 25 13:31:38 2015 From: wes.turner at gmail.com (Wes Turner) Date: Wed, 25 Feb 2015 06:31:38 -0600 Subject: [Mobile-sig] Next Steps for "Working" Port In-Reply-To: <00423930-B5F5-49A2-99D0-8DCB1ACE33D1@gmail.com> References: <9C3C814A-173A-4153-993B-556D854FE1A4@gmail.com> <54E6CE13.3010408@stoneleaf.us> <54E6E8F7.4010102@stoneleaf.us> <4EFEE73B-497A-4B9F-BA39-A8BF65460CD9@gmail.com> <6627CA60-AD56-493B-AE63-BCB42545E80F@gmail.com> <7B7C1551-47ED-4835-B1F3-A0332DAECB35@gmail.com> <00423930-B5F5-49A2-99D0-8DCB1ACE33D1@gmail.com> Message-ID: MQ is very similar to quilt (and git-guilt). https://git.wiki.kernel.org/index.php/Interfaces,_frontends,_and_tools#Guilt_.28formerly_Git_Queues_.28gq.29.29 If you don't anticipate needing to update each individual patch, plain git probably works. On Feb 25, 2015 6:24 AM, "Cyd Haselton" wrote: > Hang on...Mercurial only supports Python versions up to 2.7? > > Given that the version I;ve ported to KBOX is 3.4.2, this may be a deal > breaker. Not sure if I want to spend time porting 2.7 *just* so that I can > port Mercurial...especially if it means having both versions installed. > > Thoughts? Is there anything I couldn't do with git that makes porting > Mercurial...and Python 2.7.x...a must? > > On February 25, 2015 4:06:38 AM CST, Cyd Haselton > wrote: >> >> Yeah, I was afraid you were going to say that. I[ll grab the Mercurial >> source today and get started. >> >> On February 24, 2015 8:35:51 AM CST, Wes Turner >> wrote: >>> >>> If git is already ported to KBOX, that might be easiest; but it's >>> probably worth it to try and install Hg: >>> >>> * CPython core is Hg >>> * I find it easiest to maintain a stack of changing patches with the Hg >>> MQ extension, which is plain python (esp. with TortoiseHg) >>> * Hg core does build C extensions, which probably compile with KBOX GCC >>> * https://pip.pypa.io/en/latest/installing.html >>> * pip install mercurial >>> * An Hg MQ patch queue can be separately version controlled (and e.g. >>> hosted w/ BitBucket as something like 'cpython-android-patches') pending >>> review and merge back into default if at all possible >>> >>> Either way, a branch or patch queue might need to be rebased if the >>> underlying code changes. >>> >>> Many CPython core devs do seem to prefer Hg. >>> >>> See "Docs:" https://westurner.github.io/tools/#version-control-systems >>> >>> hg clone https://hg.python.org/cpython >>> cd cpython >>> Hg tags >>> Hg update -C -r tagstr >>> # -C clears any changes in the working directory >>> >>> # w/ a branch >>> Hg branch newbranchname >>> # add a commit >>> Hg status >>> Hg diff >>> Hg add file names >>> Hg status >>> Hg diff >>> Hg commit >>> # repeat >>> Hg push >>> >>> # w/ mq >>> # add mq ext to ~/.hgrc >>> # create .hg/patches >>> Hg qinit -c >>> # create a new patch >>> Hg qnew newpatchname.diff >>> Hg add file names >>> Hg diff >>> Hg qdiff >>> Hg qrefresh >>> Hg qcommit >>> # repeat >>> Hg qpush >>> >>> Hg help qimport >>> >>> From >>> http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >>> : >>> >>> > If you receive a patch from someone that you want to add to your patch >>> queue, and the patch needs a strip count other than one, you cannot just >>> qimport the patch, because qimport does not yet have a -p option (see issue >>> 311). >>> >>> ... I'm on my phone, so 'Hg' should be 'hg' >>> On Feb 24, 2015 7:53 AM, "Cyd Haselton" wrote: >>> >>>> Wes, et. al. >>>> What would be the recommended route...of the ones you mentioned... >>>> assuming the following: >>>> 1) Steep learning curve for git/hg VCS (near-zero knowledge for both) >>>> 2) Limited amount of time. >>>> >>>> I've submitted a meta-issue at bugs.python.org ( >>>> http://bugs.python.org/issue23496) but I'm now debating in which of >>>> the following to invest time and effort: >>>> a) clean up and submit patches for the existing issue and write more >>>> detailed build instructions >>>> b) port Mercurial to the KBOX android env, learn Mercurial, and create >>>> a hg branch for android >>>> c) Learn git and work with the existing KBOX android port of git to >>>> create a git branch for android >>>> >>>> Addional input/suggestions welcome >>>> >>>> On February 21, 2015 4:44:25 PM CST, Wes Turner >>>> wrote: >>>>> >>>>> One could: >>>>> >>>>> * Submit a group of patches as attachments on a bug in the issue >>>>> trackers and link to the patches (in sequence, if necessary) [described in >>>>> detail in the devguide] and hope that others can reproduce the build >>>>> >>>>> * Create a git branch and a GitHub pull request [there are currently a >>>>> few PRs at gh:python/cpython] >>>>> * http://documentup.com/skwp/git-workflows-book >>>>> * If there was a repository PR hook, the CI system would build the >>>>> code on each push to a PR branch (such as w/ buildbot) >>>>> * Create a git patch series with git-guilt >>>>> >>>>> * Create an hg branch (or bookmark, if you're working with hg-git and >>>>> want to approximate git branches) and a bitbucket pull request [there are >>>>> currently zero PRs at bb:mirror/cpython] >>>>> * Create a patch queue with a series of patches w/ Mercurial MQ: >>>>> * >>>>> http://hgbook.red-bean.com/read/managing-change-with-mercurial-queues.html >>>>> >>>>> ... I've collected a number of VCS docs links here: >>>>> https://westurner.github.io/tools/#version-control-systems >>>>> >>>>> On Fri, Feb 20, 2015 at 6:18 AM, Cyd Haselton >>>>> wrote: >>>>> >>>>>> >>>>>> >>>>>> On February 20, 2015 1:57:43 AM CST, Ethan Furman >>>>>> wrote: >>>>>> >On 02/19/2015 11:22 PM, Wes Turner wrote: >>>>>> >> On Fri, Feb 20, 2015 at 12:02 AM, Ethan Furman wrote: >>>>>> > >>>>>> >>> The goal is make mobile support part of Python trunk. >>>>>> > >>>>>> >> * https://docs.python.org/devguide/index.html#contributing >>>>>> >> * Re: Android buildbot support: >>>>>> > >>>>>> https://mail.python.org/pipermail/mobile-sig/2015-January/000022.html >>>>>> >> * https://github.com/python/cpython/pulls >>>>>> >> * https://bitbucket.org/mirror/cpython/pull-requests >>>>>> > >>>>>> >And exactly what was that almost-entirely-context-free bulleted list >>>>>> >supposed to explain? >>>>>> > >>>>>> >-- >>>>>> >~Ethan~ >>>>>> > >>>>>> >>>>>> Technically the first two were links to helpful information about >>>>>> contributing towards CPython. >>>>>> >>>>>> I''m assuming the last two were links to places to host the port. >>>>>> While I have ported git to this device I've limited experience with using >>>>>> it so instructions would also have been helpful...though I can find them on >>>>>> my own. >>>>>> > >>>>>> > >>>>>> >>>>>> >------------------------------------------------------------------------ >>>>>> > >>>>>> >_______________________________________________ >>>>>> >Mobile-sig mailing list >>>>>> >Mobile-sig at python.org >>>>>> >https://mail.python.org/mailman/listinfo/mobile-sig >>>>>> >>>>>> -- >>>>>> Sent from my Android device with K-9 Mail. Please excuse my brevity. >>>>>> _______________________________________________ >>>>>> Mobile-sig mailing list >>>>>> Mobile-sig at python.org >>>>>> https://mail.python.org/mailman/listinfo/mobile-sig >>>>>> >>>>> >>>>> >>>> -- >>>> Sent from my Android device with K-9 Mail. Please excuse my brevity. >>>> >>> >> > -- > Sent from my Android device with K-9 Mail. Please excuse my brevity. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ethan at stoneleaf.us Fri Feb 27 19:22:07 2015 From: ethan at stoneleaf.us (Ethan Furman) Date: Fri, 27 Feb 2015 10:22:07 -0800 Subject: [Mobile-sig] python on android In-Reply-To: References: Message-ID: <54F0B5CF.4090901@stoneleaf.us> On 01/27/2015 08:26 AM, Fetchinson . wrote: > First of all thanks a lot for creating this mailing list. I sent the > original mail to python-ideas [1] referenced by Jeff on meta-sig [2]. > My perspective is that of a developer of python programs (mostly hobby > projects) and not developer of python itself. > > What I'd like to see is a python distribution for android (I'm aware > of the fact that this is mobile-sig and not android-sig, but for me > personally android matters a lot more than other mobile platforms) > that is as reliable as the linux/macos/windows distributions released > by the python core dev team. Ideally, each time a new python version > is released not only linux/macos/windows installers should be > available on python.org but also android probably in the form of an > installable apk. And just as there are platform specific features for > e.g. windows that are not available on linux, there of course would be > android-only features in the android distribution like hardware > related libraries like camera, gps, accelerator, etc. sensors and > probably more. > > Currently there is no single officially blessed (i.e. psf blessed) > python distribution for android. There are various approaches, kivy > [3], sl4a [4] and more [5]. But these are either dead projects or > accomplish much more than a vanilla python distribution. What I'd like > to see is an environment whose goal is to be "just" the python core > plus about as much platform specific feature as there are for the > others, linux/macos/windows. > > Of course the whole enterprise depends on the willingness of core > python dev folks to dedicate time and energy to maintaining a code > base that one can compile for android also which is not a small feat. > I'm not sure they have this time and energy and I of course wouldn't > blame them, this is open source, people do it in their free time. > > I merely would like to gauge the community's interest in something > like this. Maybe if many users show interest then the core python dev > folks can be convinced that this would be a worthy effort. PEP 11 [1] has been updated to clarify what is need to officially support a platform: First, a core developer [2] needs to volunteer to maintain platform-specific code. Second, a stable buildbot must be provided. I volunteer to maintain the android specific code (I have zero qualifications to help with any other mobile platform), and I am working on providing a stable buildbot for the android platform. Cyd has successfully built 3.4.2 in a KBOX environment on his android device, and is working on making the patches accessible (thanks, Cyd!) While Cyd's efforts are an important first step, I think many users are not going to want to install KBOX to get Python, so what are the other options? -- ~Ethan~ [1] http://legacy.python.org/dev/peps/pep-0011/ [2] if one just wants to contribute patches now and again, the CLA [3] will need to be signed [3] https://www.python.org/psf/contrib/contrib-form/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: OpenPGP digital signature URL: From matthew.i.frank at intel.com Fri Feb 27 21:01:03 2015 From: matthew.i.frank at intel.com (Frank, Matthew I) Date: Fri, 27 Feb 2015 20:01:03 +0000 Subject: [Mobile-sig] python on android In-Reply-To: <54F0B5CF.4090901@stoneleaf.us> References: <54F0B5CF.4090901@stoneleaf.us> Message-ID: <8FEF00DDD6C58843BF4ED3C1DCF80E9F6E151F23@FMSMSX106.amr.corp.intel.com> Ethan Furman wrote: > PEP 11 [1] has been updated to clarify what is need to officially support a platform: > > First, a core developer [2] needs to volunteer to maintain platform-specific code. > > Second, a stable buildbot must be provided. > > I volunteer to maintain the android specific code (I have zero qualifications to help with > any other mobile platform), and I am working on providing a stable buildbot for the > android platform. > > Cyd has successfully built 3.4.2 in a KBOX environment on his android device, and is > working on making the patches accessible (thanks, Cyd!) > > While Cyd's efforts are an important first step, I think many users are not going to > want to install KBOX to get Python, so what are the other options? Thank you Ethan! I think it is highly preferred that the Android build be cross-compiled from a Linux box. This should make the buildbot somewhat easier since the Android cross-compilers are relatively easy to install there without messing anything up. Then the testing rule can be done one of two ways: (1) if you're building x86 Android binaries we could test them on a Qemu image running on the same machine that did the build or (2) (preferably) you would have some sort of ARM-based machine as part of your buildbot pool, you would run Android on that machine and then after the build, push the result to the Android machine (using "adb push") and invoke the unit tests (using "adb shell ...") from the build machine (or from the buildbot server, I guess). For Ubuntu 14.04, in particular, it is pretty easy to get _just_ the adb tool (you don't have to install the whole Android SDK), using just "apt-get install android-tools". There are a couple of examples of people hacking stuff up to get an end-to-end cross compilation working. Mine (tested only on x86) is at https://github.com/wandering-logic/android_x86_python-3.4. As Russ Magee has pointed out, my port (like all the others) still involves hackery to modify python.h after running configure. I'm still working on getting rid of those problems. -Matt From russell at keith-magee.com Sat Feb 28 01:40:09 2015 From: russell at keith-magee.com (Russell Keith-Magee) Date: Sat, 28 Feb 2015 08:40:09 +0800 Subject: [Mobile-sig] python on android In-Reply-To: <54F0B5CF.4090901@stoneleaf.us> References: <54F0B5CF.4090901@stoneleaf.us> Message-ID: On Sat, Feb 28, 2015 at 2:22 AM, Ethan Furman wrote: > On 01/27/2015 08:26 AM, Fetchinson . wrote: > > > First of all thanks a lot for creating this mailing list. I sent the > > original mail to python-ideas [1] referenced by Jeff on meta-sig [2]. > > My perspective is that of a developer of python programs (mostly hobby > > projects) and not developer of python itself. > > > > What I'd like to see is a python distribution for android (I'm aware > > of the fact that this is mobile-sig and not android-sig, but for me > > personally android matters a lot more than other mobile platforms) > > that is as reliable as the linux/macos/windows distributions released > > by the python core dev team. Ideally, each time a new python version > > is released not only linux/macos/windows installers should be > > available on python.org but also android probably in the form of an > > installable apk. And just as there are platform specific features for > > e.g. windows that are not available on linux, there of course would be > > android-only features in the android distribution like hardware > > related libraries like camera, gps, accelerator, etc. sensors and > > probably more. > > > > Currently there is no single officially blessed (i.e. psf blessed) > > python distribution for android. There are various approaches, kivy > > [3], sl4a [4] and more [5]. But these are either dead projects or > > accomplish much more than a vanilla python distribution. What I'd like > > to see is an environment whose goal is to be "just" the python core > > plus about as much platform specific feature as there are for the > > others, linux/macos/windows. > > > > Of course the whole enterprise depends on the willingness of core > > python dev folks to dedicate time and energy to maintaining a code > > base that one can compile for android also which is not a small feat. > > I'm not sure they have this time and energy and I of course wouldn't > > blame them, this is open source, people do it in their free time. > > > > I merely would like to gauge the community's interest in something > > like this. Maybe if many users show interest then the core python dev > > folks can be convinced that this would be a worthy effort. > > PEP 11 [1] has been updated to clarify what is need to officially support > a platform: > > First, a core developer [2] needs to volunteer to maintain > platform-specific code. > > Second, a stable buildbot must be provided. > Are you able to clarify exactly what is required to comply with this second point? In the case of iOS, for example, there's currently at least 4 architectures that need to be tested - 2 simulator architectures (i386 and x86_64), and at least 2 device architectures (ARMv7s and ARM64 at a minimum; ARMv7 and ARMv6 may also be desirable). The simulator architectures can only run on a physical OSX machine; the device architectures require a physical tethered iPod/iPhone/iPad with the appropriate CPU type. Does this mean that in order for iOS to be a PEP11-compliant supported platform, it would be necessary to get physical hardware to a particular server farm somewhere? Or could I (for example) hook up a laptop and some iPods in my office and have it connect to a build server? What QoS requirements exist for that iOS build rig - Is it necessary for the rig to be continuously online and available, or can it be fired up once a week, or once a month, or once a release, to check compliance of any recently added code? To that end - since any iOS build needs to be built on a Mac, which build slave is used to verify the OS/X build at present? The only candidate I can see that might be an OS/X build is "bolen-tiger" (assuming tiger is a reference to OS/X 10.4 - it isn't clear to me that it is). I volunteer to maintain the android specific code (I have zero > qualifications to help with any other mobile platform), > and I am working on providing a stable buildbot for the android platform. > > Cyd has successfully built 3.4.2 in a KBOX environment on his android > device, and is working on making the patches > accessible (thanks, Cyd!) > > While Cyd's efforts are an important first step, I think many users are > not going to want to install KBOX to get Python, > so what are the other options? > A completely native build without KBOX is entirely possible (and, to my mind, preferable). Matt's build is pretty close AFAICT - it just needs some configure.ac tweaking to get rid of the last manual pyconfig.h overrides, and, IMHO, a specific platform module for Android (as I've said previously in this forum, I don't believe an Android device should identify as "Linux", or iOS as "Darwin", because those identifiers are misleading on mobile devices). However, it's also important to establish what "it" is when we are talking about Python on Mobile. The idea of a "stock TTY-based Python shell" on mobile is, IMHO, a folly. The idea that the distributable product from python.org would be "an installable Python APK/IPA that gives the same (or similar) experience as desktop Python" is also, IMHO, a folly. The best we can hope for is a version of libPython.a that can be embedded into another executable, plus the standard library. Building the rest of the UI needed to support "IDLE on a mobile device" is a much bigger project, and one that is, IMHO, way out of scope for Python core. Yours, Russ Magee %-) -------------- next part -------------- An HTML attachment was scrubbed... URL: From wes.turner at gmail.com Sat Feb 28 03:07:26 2015 From: wes.turner at gmail.com (Wes Turner) Date: Fri, 27 Feb 2015 20:07:26 -0600 Subject: [Mobile-sig] python on android In-Reply-To: References: <54F0B5CF.4090901@stoneleaf.us> Message-ID: On Fri, Feb 27, 2015 at 6:40 PM, Russell Keith-Magee < russell at keith-magee.com> wrote: > [...] and, IMHO, a specific platform module for Android (as I've said > previously in this forum, I don't believe an Android device should identify > as "Linux", or iOS as "Darwin", because those identifiers are misleading on > mobile devices). > > re: sys.platform and mobile platforms iOS is not built on a Darwin kernel. Android is built on a Linux (3) kernel. For android, I think sys.platform="linux2" makes sense for things like pathlib (which, I assume, checks sys.platform) largely because *most* things should be linux-compatible (if mostly read-only and SELinux MAC controlled). Otherwise, many existing libraries would need to be unnecessarily patched. Maybe an additional sys.mobile_platform would be more helpful? Relevant sys.platform thread posts: * https://mail.python.org/pipermail/python-dev/2014-August/135606.html * https://mail.python.org/pipermail/mobile-sig/2015-February/000032.html * https://mail.python.org/pipermail/mobile-sig/2015-January/000007.html -------------- next part -------------- An HTML attachment was scrubbed... URL: