Fixes 2757: Add win/arm64 launchers to create arm64 executables#2758
Fixes 2757: Add win/arm64 launchers to create arm64 executables#2758
Conversation
|
@jaraco Can you please review this change? |
This will be required to support cross compilation
msvc-build-launcher.cmd
Outdated
| REM now for arm 64-bit | ||
| REM Cross compile for arm64 | ||
| call VCVARSx86_arm64 | ||
| if "%ERRORLEVEL%"=="0" ( | ||
| cl /D "GUI=0" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:arm64 /SUBSYSTEM:CONSOLE /out:setuptools/cli-arm64.exe | ||
| cl /D "GUI=1" /D "WIN32_LEAN_AND_MEAN" launcher.c /O2 /link /MACHINE:arm64 /SUBSYSTEM:WINDOWS /out:setuptools/gui-arm64.exe | ||
| ) else ( | ||
| echo Windows SDK 6.1 not found to build Windows 64-bit version | ||
| ) | ||
|
|
There was a problem hiding this comment.
I'd prefer if I could build the launcher. Do you know how I could acquire a Windows ARM machine (perhaps through Azure) that would build the executable? Did you have to do anything special to get the build to run?
There was a problem hiding this comment.
I think executables can be cross-compiled from an x64 machine as well. But for execution, you need to get one of the windows on arm machines. I have tested on a surface pro x machine. I don't think we have any machines available yet azure yet.
The launcher works out of the box, I just had to compile it with the right target machine.
jaraco
left a comment
There was a problem hiding this comment.
I'm generally in favor of this change, even though it's adding functionality against a deprecated feature (easy_install wrapper scripts). Do you know what is the status of wrapper scripts in pip for arm on Windows executables? If pip/distutils already supports these, I'll be slightly inclined to leave them broken for easy_install, which is deprecated and to direct users to use pip to install and generate wrapper executables for ARM platforms.
Thanks, @jaraco . I think it will be helpful to have support in easy_install for woa as it might take a while to get woa launcher script support in pip. |
|
Extra voice adding support for fixing this in setuptools, even though easy_install and friends are ye-olde deprecated, it will make working on ARM64 Windows that much more relaxed and nice when dealing with older packages or for some reason or the other being forced to use an older method of installing. Also, it would harmonize the experience of setuptools between the two (three) architectures. @nsait-linaro: Do you have a link to the distutils PR and possibly a pip issue number with regards to launcher support for pip? I couldn't find it. |
|
@jaraco Could you approve the pending workflow and merge the changes if you are happy ? |
|
This change looks good to me, but I need some sort of verification that the changes work as intended... and preferably a verification that the compiled binaries were generated from the supplied sources. To do that, I think I need a machine with a compiler where I can compile the binaries myself. I'll try to acquire one using my MSDN subscription. |
|
Re: workflow failure seems to be due to a network timeout error. I don't see how it is related to my patch so I guess it is a generic issue. |
Thanks, @jaraco. Binaries for ARM64 can be cross-compiled from x86 or x64 windows machines. If you prefer you can amend the patch with the new binaries you create locally. I don't think there is any cloud VM available for woa yet so if you update the patch I can test new patch on my win/arm64 machine. |
|
Oh, I hadn't realized the binaries could be cross-compiled. That's great. Unfortunately, the current The link in that script takes me to a 404 page. Did you use the script to build the results? If so, what did you do to set it up? |
|
I have been using this Windows Docker container. |
|
Thanks, @jaraco for trying it out. I couldn't install SDK 6.1 as well. I had to use VS 2019 for arm64 launchers. I've added a new script |
|
That's helpful, I think. I did try with the new script, but it also doesn't find visual studio as I've installed it: It seems I only have MSBuild installed and not Visual Studio. I'm going to have to do more experimentation to determine what components are needed to provide the necessary tools. Aha. I see now that the Docker image install MSVC into \Buildtools: I probably installed into that directory because I struggled to install into a directory with spaces due to escaping challenges. So probably, the script needs to invoke I'd recommend to get away from using a Of course, all of this effort is moot if I can just get a pair of verified binaries. I'm starting to care less about getting a repeatable process as this is all a big mess and deprecated. I started work on getting ARM support into my Docker image, but the build is failing, and I'm out of time to work on this today. I'll look into this more later. |
dba3dab to
cbbdb86
Compare
|
Thanks, @jaraco. I've tested v58.2.0 and it all seems to work as expected. |
Summary of changes
This change adds arm64 windows launchers executables generated from launcher.c for arm64 target and related changes to pick right launcher based on platform
Pull Request Checklist
changelog.d/].