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 ARM64 builds for Windows #387

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Add ARM64 builds for Windows #387

wants to merge 2 commits into from

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Oct 30, 2024

Picking up #93

@zanieb
Copy link
Member Author

zanieb commented Oct 30, 2024

We're failing missing applink.c:


cpython>     38>ClCompile:
cpython>          C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.41.34120\bin\HostX64\arm64\CL.exe /c /I"C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\openssl\arm64\include" /I"C:\Users\runneradmin\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\Include" /I"C:\Users\runneradmin\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\Include\internal" /I"C:\Users\runneradmin\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\Include\internal\mimalloc" /I"C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\PCbuild\obj\\313arm64_PGInstrument\pythoncore\\" /I"C:\Users\runneradmin\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\PC" /Zi /nologo /W3 /WX- /diagnostics:column /MP /O2 /Oi /Oy- /GL /D _CRT_SECURE_NO_WARNINGS /GF /Gm- /MD /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\PCbuild\obj\313arm64_PGInstrument\_ssl\\" /Fd"C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\PCbuild\obj\313arm64_PGInstrument\_ssl\vc143.pdb" /external:W3 /Gd /TC /analyze- /FC /errorReport:queue /utf-8 "C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\openssl\arm64\include\openssl\applink.c"
cpython>          applink.c
cpython>     38>C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\openssl\arm64\include\openssl\applink.c(1,1): error C1083: Cannot open source file: 'C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\openssl\arm64\include\openssl\applink.c': No such file or directory [C:\Users\RUNNER~1\AppData\Local\Temp\python-build-3k85bya8\Python-3.13.0\PCbuild\_ssl.vcxproj]
cpython>          (compiling source file '../../../../../../../RUNNER~1/AppData/Local/Temp/python-build-3k85bya8/openssl/arm64/include/openssl/applink.c')

on amd64, you can see we copy this file

openssl> *** Installing runtime libraries
openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install'
openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64'
openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/bin'
openssl> Copying: libcrypto-1_1-x64.dll to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/bin/libcrypto-1_1-x64.dll
openssl> Copying: libssl-1_1-x64.dll to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/bin/libssl-1_1-x64.dll
openssl> Copying: libcrypto-1_1-x64.pdb to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/bin/libcrypto-1_1-x64.pdb
openssl> Copying: libssl-1_1-x64.pdb to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/bin/libssl-1_1-x64.pdb
openssl> *** Installing development files
openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/include'
openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/include/openssl'
openssl> Copying: ./ms/applink.c to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-upok1jaj/x64/install/64/include/openssl/applink.c

but we don't on arm64

2024-10-30T14:25:05.2679998Z openssl> *** Installing runtime libraries
2024-10-30T14:25:05.2957214Z openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install'
2024-10-30T14:25:05.2959360Z openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64'
2024-10-30T14:25:05.2961110Z openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/bin'
2024-10-30T14:25:05.3572257Z openssl> Copying: libcrypto-3-arm64.dll to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/bin/libcrypto-3-arm64.dll
2024-10-30T14:25:05.3574146Z openssl> Copying: libssl-3-arm64.dll to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/bin/libssl-3-arm64.dll
2024-10-30T14:25:05.4293375Z openssl> Copying: libcrypto-3-arm64.pdb to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/bin/libcrypto-3-arm64.pdb
2024-10-30T14:25:05.4295870Z openssl> Copying: libssl-3-arm64.pdb to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/bin/libssl-3-arm64.pdb
2024-10-30T14:25:05.4709900Z openssl> *** Installing development files
2024-10-30T14:25:05.4964299Z openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/include'
2024-10-30T14:25:05.4966851Z openssl> created directory `C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/include/openssl'
2024-10-30T14:25:05.5798950Z openssl> Copying: ./include/openssl/aes.h to C:/Users/RUNNER~1/AppData/Local/Temp/openssl-build-hynbk0h3/arm64/install/arm64/include/openssl/aes.h

Looks like -D"OPENSSL_USE_APPLINK" is set on amd64 but not arm64

@zanieb zanieb force-pushed the zb/arm64 branch 2 times, most recently from 9ada4a7 to 49b6f84 Compare October 30, 2024 16:51
Co-authored-by: Adrian Antkowiak <[email protected]>
@zanieb
Copy link
Member Author

zanieb commented Oct 30, 2024

By manually copying the applink.c file, we make it to

2024-10-30T17:22:46.9472354Z Traceback (most recent call last):
2024-10-30T17:22:46.9481385Z   File "D:\a\python-build-standalone\python-build-standalone\cpython-windows\build.py", line 2046, in <module>
2024-10-30T17:22:46.9482543Z     sys.exit(main())
2024-10-30T17:22:46.9483423Z   File "D:\a\python-build-standalone\python-build-standalone\cpython-windows\build.py", line 2010, in main
2024-10-30T17:22:46.9484169Z     tar_path = build_cpython(
2024-10-30T17:22:46.9485025Z   File "D:\a\python-build-standalone\python-build-standalone\cpython-windows\build.py", line 1596, in build_cpython
2024-10-30T17:22:46.9486058Z     tests = subprocess.run(
2024-10-30T17:22:46.9486654Z   File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\subprocess.py", line 505, in run
2024-10-30T17:22:46.9488654Z     with Popen(*popenargs, **kwargs) as process:
2024-10-30T17:22:46.9489422Z   File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\subprocess.py", line 951, in __init__
2024-10-30T17:22:46.9491810Z     self._execute_child(args, executable, preexec_fn, close_fds,
2024-10-30T17:22:46.9492618Z   File "C:\hostedtoolcache\windows\Python\3.9.13\x64\lib\subprocess.py", line 1420, in _execute_child
2024-10-30T17:22:46.9495394Z     hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
2024-10-30T17:22:46.9496711Z OSError: [WinError 216] This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher
2024-10-30T17:22:46.9845209Z ##[error]Process completed with exit code 1.

Where we fail to run the PGO tests because, of course, we're not on an ARM runner.

https://github.com/indygreg/python-build-standalone/blob/00ea84cd2a525c8d20566482633903878bae2996/cpython-windows/build.py#L1596-L1602

@zanieb
Copy link
Member Author

zanieb commented Oct 30, 2024

I don't really know what the plan is here. There aren't public ARM Windows runners (though they might be eventually actions/runner-images#10820 / github/roadmap#970). We (Astral) could pay for runners, but I can't set that up in this repository.

We could skip PGO, but we're still going to fail later (we need to invoke python.exe for various things).

@zanieb
Copy link
Member Author

zanieb commented Dec 18, 2024

Now that this is in the Astral org, I intend to try adding an ARM runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant