[issue46744] installers on ARM64 suggest wrong folders
New submission from conio : Thank you for your work on bringing Python to Windows on ARM64. I recently installed it an noticed some strange behaviours. On ARM64 Windows 11 the recent prerelease (3.11.0a5, post #33125) acts in a way I believe is wrong: Checking the _install for all users_ checkbox causes the installer to suggest the `C:\Program Files (Arm)\Python311-Arm64` folder, but the `C:\Program Files (Arm)` is intended for ARM32 programs, similarly to how the `C:\Program Files (x86)` is intended for x86 programs. The folder for programs that are native for the platform is simply `C:\Program Files` - which is x86 on x86 Windows, x64 on x64 Windows and ARM64 on ARM64 Windows. So on ARM64 Windows the ARM64 Python should go into the native Program Files folder which is `C:\Program Files`. -- A closely related issue is that the installer for x64 Python wants to install into `C:\Program Files\Python311`, but I already installed the ARM64 version there. The x86 acts as as should be expected and wants to install into `C:\Program Files (x86)\Python311-32`. But there's no "Program Files (x64)", so where should the x64 version on ARM64 machines go? I argue that the x64 version should go into `C:\Program Files\Python311-amd64" while the ARM64 version should go into `C:\Program Files\Python311`, because the ARM64 is the native on on this platform, while the x64 is foreign, and should get an elaborate name, like the x86, which is also foreign, gets. (The dotnet team also had this problem, and they decided similarly.) Internally `sys.winver` and the PEP 514 Registry structure can say whatever you like, but on the filesystem it's much more appropriate for the unqualified folder to be the system native one. -- components: Installation, Windows messages: 413199 nosy: conio, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: installers on ARM64 suggest wrong folders type: behavior versions: Python 3.11 ___ Python tracker <https://bugs.python.org/issue46744> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46566] Support -3.11-arm64 in py.exe launcher
Change by conio : -- nosy: +conio ___ Python tracker <https://bugs.python.org/issue46566> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46744] installers on ARM64 suggest wrong folders
conio added the comment: I understand. Though I think the naming scheme that includes platform identification is better, if *all* installers include the platform name unconditionally, including both amd64 and arm64, that's also an improvement. (So the names will be `Python311-32`, `Python311-amd64` and `Python311-arm64` - each in the appropriate Program Files folder.) The convention would be uniform, there won't be a collision between arm64 and amd64 on the same system, and amd64 won't get preferential treatment even on non-amd64 systems. Assuming `py.exe` will be fixed to recognize the arm64 versions in the Registry, I would be able to change the folder from `Python311-arm64` to `Python311` myself in the installer if it's so important to me and everything will work just the same. I do wonder though - is there no platform detection code today in the installer? Would the x86 versions install into "PythonXY-32" even on 32-bit Windows? If there already is, then adding a call to `IsWow64Process2` doesn't sound that difficult. Especially since that's almost the same couple of lines that will have to added to the PyLauncher anyway. Could you please point me to where the code for the Windows Python installer is so I could also take a look? -- ___ Python tracker <https://bugs.python.org/issue46744> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46744] installers on ARM64 suggest wrong folders
conio added the comment: Thank you very much, Steve. I took a look but didn't get to making the patch. I'm happy to see it was just removing the calculation of the PF(ARM) folder. For the second issue, even though I prefer it the way I said (unqualified = native), since (i) the default is using the value of `sys.winver` at the end of the path, and it's "VER" for amd64 Python and "VER-32" for x86 Python regardless of the OS (i.e. even on 32-bit Windows); (ii) this has been the situation long enough to be a compatibility concern as you said, and (iii) if someone really wants the names to be the other way around they may choose whatever they like during the install, and it's only the defaults that are that way I think you are right in keeping it out for now. I wouldn't insist on it. If there comes a time when more arguments in favor of this change come up or the circumstances change (e.g. the compatibility issue becomes less of a concern) I'm sure you'd revisit this. I did notice one small issue when I tried to build Python for ARM64 following your message from 2022-02-15. The help message for `Tools/msi/build.bat` says to use the `-ARM64` flag to build installers for ARM64 but it didn't work for me. I took me a few attempts at clean and rebuild before I finally looked at the script itself and saw that it actually expects `-arm64` in lowercase. If you could change either the help string or the flag itself so they'd math it would be great. Uppercase is nice because it is consistent with `PCbuild/build.bat` and lowercase is nice because if there's come CI that uses this flag it wouldn't have to be modified too. Obviously you if there are such consideration better than me so I leave the decision to you. If there's no problem or difficulty in changing the arguments for `Tools/msi/build.bat` it might be nice if building for ARM64 would be "-ARM64" and building for x86 would be "-Win32" to match the platform names for `PCbuild/build.bat`. -- ___ Python tracker <https://bugs.python.org/issue46744> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46744] installers on ARM64 suggest wrong folders
conio added the comment: I opened a PR for this change (https://github.com/python/cpython/pull/31803). I'd appreciate your comments and/or approval. I didn't add anything to the NEWS.d folder since it seems to me like something completely internal to the build process and so minor not worth mentioning there. -- ___ Python tracker <https://bugs.python.org/issue46744> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com