Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add ARM-compatible launchers #85

Closed
vsajip opened this issue May 27, 2016 · 23 comments
Closed

Add ARM-compatible launchers #85

vsajip opened this issue May 27, 2016 · 23 comments
Labels
enhancement New feature or request major

Comments

@vsajip
Copy link
Collaborator

vsajip commented May 27, 2016

Original report by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


In this pull request for setuptools, anthrotype is working to update Setuptools to use distlib for its script launchers, unifying yet another piece of the python packaging infrastructure.

However, setuptools' executable launchers support one major feature that distlib does not currently, and that's ARM-compatible executables.

Setuptools builds its launches with this script. Can someone update distlib to include builds of the launcher for ARM as well?

@vsajip
Copy link
Collaborator Author

vsajip commented May 30, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


I just tried to use the above mentioned msvc-build-launcher.cmd to compile the distlib launcher.c for Windows RT ARM. However, I'm getting this linker error:

Shlwapi.lib(SHLWAPI.dll) : fatal error LNK1112: module machine type 'x64' conflicts with target machine type 'ARM'

I seems that the shlwapi.lib library is not available for the ARM platform. The library is linked with a #pragma comment (lib, "Shlwapi.lib") at the top of launcher.c.

I think it's only used for the StrStrIW inside find_exe, ie. to find the executable substring in the shebang string (wide char, case insensitive variant of strstr). I guess we need to re-implement that ourselves or replace it with something similar?

BTW, I used Visual Studio Express 2012 as recommended in the setuptools' launcher build script:

REM Windows RT ARM build requires both freeware
REM "Visual Studio Express 2012 for Windows 8" and
REM "Visual Studio Express 2012 for Windows Desktop" to be installed from
REM http://www.microsoft.com/visualstudio/eng/products/visual-studio-express-products

@vsajip
Copy link
Collaborator Author

vsajip commented May 31, 2016

Jason / Cosimo, I will look at this as soon as I can - perhaps this coming weekend. I may use a more recent version of Visual Studio - presumably that will not cause a problem for you?

@vsajip
Copy link
Collaborator Author

vsajip commented May 31, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


Sure, no rush. Thanks for looking into this :)

@vsajip
Copy link
Collaborator Author

vsajip commented May 31, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


I don't see any problem with newer versions of VS. The ARM binaries were a user contrib and are likely only rarely used. If it becomes an impediment, we can probably drop them, but I'd like to retain support for them if possible.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 5, 2016

@anthrotype, does this mean that the build is done on a Windows 8 machine? I ask because you say you installed Visual Studio Express 2012 for Windows 8. Does this only work on Windows 8, as the name would imply, or is it perhaps just referring to supporting Windows 8 targets? I have heretofore built on Windows 7 machines - I don't have Visual Studio installed on Windows 8 ... and would like to avoid installing it if possible, due to disk space constraints ...

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 5, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


No, I actually tried that on a Windows 10 virtual machine, so I suppose it means that the target is Win 8. I haven't tried installing that on Windows 7...

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 5, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


wikipedia says Windows RT has been discontinued.. https://en.wikipedia.org/wiki/Windows_RT
I think we should just drop it.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 5, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


Ignore what I just said, I'm not really a Windows developers so I know nothing about the details of the platform.
The msvc-build-launcher.c batch script in setuptools refers to this "Windows RT ARM".
Even if Windows RT may be outdated, AFAIK Microsoft still supports ARM architecture with its the mobile version of Windows 10. I'll leave it to you to figure out how to build launchers for that platform (let alone to test them on a real device!).

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 6, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


I'm content to get ARM builds created and worry later if anyone complains it doesn't support their platform. As far as I'm concerned, older ARM platforms can rely on older Setuptools and launchers.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 6, 2016

I've made some progress. The vs_2012 branch of the simple_launcher project has updated project files for VS 2012 and these build launchers using the ARM compilers to t_arm.exe and w_arm.exe. The branch contains an untested implementation of StrStrIW for the ARM build only. The built launchers are available in the downloads section of the simple_launcher project.

As these launchers are untested, I don't want to add them yet to the default distlib branch. I don't have ARM hardware on which to test them. I have set up a patch (using mq) which adds t_arm.exe and w_arm.exe to distlib, and updates scripts.py to use it when running on ARM architecture. I can make this patch available to anyone who can test the ARM launchers and their integration into distlib.

Not sure what more I can do at this stage. Over to one of you chaps 😉

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 6, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


Thanks a lot for your work, Vinay!
I'll see if I can find an Windows ARM device somewhere to test your binaries. Of course, I also need to find out how to run Python on it :)

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 6, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


@Eyeofhell was the original contributor of the ARM binaries for setuptools, introduced with Distribute 0.6.39. Perhaps he has some experience testing these executables. If he does not, the best recommendation I can make is to release them and then await reports for issues (which may not come). I do appreciate the effort on this to provide at least a best effort solution, but if we've reached the wall in testing/validating the solution, then I'm content to leave it for others to comment/contribute to advance the effort.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 7, 2016

Original comment by Grigory Petrov (Bitbucket: eyeofhell, ).


Hi there!

I used "Windows RT" machine to test arm binaries. But it seems that Microsoft has silently dropped this Windows version and I can't see any devices available anymore. Is it any windows-based ARM devices avialable on the market right now that python runs on?

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 7, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


I had been assuming that to support modern Windows Phone and similar devices that builds of executables would need to be cross compiled. It hadn't occurred to me that they might have with their Universal App technology obviates the need for cross builds. Is it possible that with modern compilers, there's a way to compile a command-line app such that it runs on any Windows 8.1+ device? what implications does that have for 32-bit vs 64-bit?

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 7, 2016

Original comment by Cosimo Lupo (Bitbucket: anthrotype, GitHub: anthrotype).


FWIW, I also cannot find a Windows RT device to test this on. This morning I asked IT people in my office, and they replied that this OS is not widely used any more, besides being no longer supported by Microsoft.
I'd be really curious to know how one could run a command line app from a Windows phone...
On my iOS or Android phones, I can find several third-party "apps" with built-in Python interpreters, on the respective App Stores. However these only have limited access to the filesystem and only allow to run simple scripts. I doubt that, as a user (not as the app developer), one could bootstrap setuptools and run the test suite (maybe I'm wrong).

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 7, 2016

Original comment by Grigory Petrov (Bitbucket: eyeofhell, ).


So we need any device that runs non-x86 Windows and Python at same time. I don't know about any Universal App Python distributions :(

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 7, 2016

the best recommendation I can make is to release them and then await reports for issues

Rather than do this (as there is no evidence of demand, and likely to be support issues around the underlying platform, by the sound of it) I think it would be wiser to hang fire on the ARM launchers altogether, and not include them. If someone raises an issue because they need the launchers, then presumably they will have a platform on which to test them, and be willing to put in some reporting/diagnostic effort in case the testing shows up problems.

Note that I had to jump through undocumented hoops to get the ARM builds to happen, even with VS2012. The default error message is to the effect that desktop applications are not supported with the ARM compilers. It seems to be not a technical limitation, but a commercial one imposed by Microsoft.

Arguably, the availability of the ARM launchers in setuptools is not any longer a major feature, given that Microsoft has moved on from Windows RT. It might be worth posting on distutils-sig to see if anyone there has opinions on this.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 7, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


Sounds good to me.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 9, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


I've filed setuptools 611 to track the removal of ARM launchers from setuptools.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 9, 2016

Original comment by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


As far as I can tell, there's little need to support ARM-based launchers in Python. Until someone demonstrates a need for that functionality, we'll assume YAGNI.

@vsajip
Copy link
Collaborator Author

vsajip commented Jun 9, 2016

Original changes by Jason R. Coombs (Bitbucket: jaraco, GitHub: jaraco).


changed state from "new" to "wontfix"

@vsajip vsajip closed this as completed Jun 9, 2016
@vsajip
Copy link
Collaborator Author

vsajip commented Sep 21, 2021

Should be resolved in ad0ea22, at least as far as ARM64 launchers are concerned. There seems no need for ARM32 launchers at present.

@vsajip
Copy link
Collaborator Author

vsajip commented Sep 21, 2021

Original changes by Vinay Sajip (Bitbucket: vinay.sajip, GitHub: vsajip).


changed state from "wontfix" to "resolved"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request major
Projects
None yet
Development

No branches or pull requests

1 participant