Skip to content

bpo-33125: Enables building traditional installer for Windows ARM64 #30885

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

Merged
merged 12 commits into from
Jan 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions .azure-pipelines/windows-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ parameters:
displayName: "Signature description"
type: string
default: 'Built: $(Build.BuildNumber)'
- name: DoARM64
displayName: "Publish ARM64 build"
type: boolean
default: true
- name: DoPGO
displayName: "Run PGO"
type: boolean
Expand Down Expand Up @@ -64,25 +68,26 @@ parameters:
default: '0'

variables:
__RealSigningCertificate: 'Python Software Foundation'
${{ if ne(parameters.GitRemote, '(Other)') }}:
GitRemote: ${{ parameters.GitRemote }}
${{ else }}:
GitRemote: ${{ parameters.GitRemote_Other }}
SourceTag: ${{ parameters.SourceTag }}
DoPGO: ${{ parameters.DoPGO }}
${{ if ne(parameters.SigningCertificate, 'Unsigned') }}:
SigningCertificate: ${{ parameters.SigningCertificate }}
SigningDescription: ${{ parameters.SigningDescription }}
DoLayout: ${{ parameters.DoLayout }}
DoMSIX: ${{ parameters.DoMSIX }}
DoNuget: ${{ parameters.DoNuget }}
DoEmbed: ${{ parameters.DoEmbed }}
DoMSI: ${{ parameters.DoMSI }}
DoPublish: ${{ parameters.DoPublish }}
__RealSigningCertificate: 'Python Software Foundation'
${{ if ne(parameters.GitRemote, '(Other)') }}:
GitRemote: ${{ parameters.GitRemote }}
${{ else }}:
GitRemote: ${{ parameters.GitRemote_Other }}
SourceTag: ${{ parameters.SourceTag }}
DoPGO: ${{ parameters.DoPGO }}
${{ if ne(parameters.SigningCertificate, 'Unsigned') }}:
SigningCertificate: ${{ parameters.SigningCertificate }}
SigningDescription: ${{ parameters.SigningDescription }}
DoLayout: ${{ parameters.DoLayout }}
DoMSIX: ${{ parameters.DoMSIX }}
DoNuget: ${{ parameters.DoNuget }}
DoEmbed: ${{ parameters.DoEmbed }}
DoMSI: ${{ parameters.DoMSI }}
DoPublish: ${{ parameters.DoPublish }}
PublishARM64: ${{ parameters.DoARM64 }}
# QUEUE TIME VARIABLES
# PyDotOrgUsername: ''
# PyDotOrgServer: ''
# PyDotOrgUsername: ''
# PyDotOrgServer: ''

trigger: none
pr: none
Expand Down
46 changes: 42 additions & 4 deletions .azure-pipelines/windows-release/msi-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ steps:
artifactName: bin_amd64_d
targetPath: $(Build.BinariesDirectory)\amd64

- task: DownloadPipelineArtifact@1
displayName: 'Download artifact: bin_arm64'
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
inputs:
artifactName: bin_arm64
targetPath: $(Build.BinariesDirectory)\arm64

- task: DownloadPipelineArtifact@1
displayName: 'Download artifact: bin_arm64_d'
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
inputs:
artifactName: bin_arm64_d
targetPath: $(Build.BinariesDirectory)\arm64

- task: DownloadPipelineArtifact@1
displayName: 'Download artifact: tcltk_lib_win32'
inputs:
Expand Down Expand Up @@ -84,32 +98,45 @@ steps:

- script: |
%MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
%MSBUILD% Tools\msi\bundle\releaseweb.wixproj /t:Rebuild /p:RebuildAll=false
displayName: 'Build win32 installer'
env:
Platform: x86
Py_OutDir: $(Build.BinariesDirectory)
PYTHON: $(Build.BinariesDirectory)\win32\python.exe
PythonForBuild: $(Build.BinariesDirectory)\win32\python.exe
PYTHONHOME: $(Build.SourcesDirectory)
TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_win32
BuildForRelease: true
SuppressMinGWLib: true

- script: |
%MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
%MSBUILD% Tools\msi\bundle\releaseweb.wixproj /t:Rebuild /p:RebuildAll=false
displayName: 'Build amd64 installer'
env:
Platform: x64
Py_OutDir: $(Build.BinariesDirectory)
PYTHON: $(Build.BinariesDirectory)\amd64\python.exe
PythonForBuild: $(Build.BinariesDirectory)\amd64\python.exe
PYTHONHOME: $(Build.SourcesDirectory)
TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_amd64
BuildForRelease: true
SuppressMinGWLib: true

- script: |
%MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
displayName: 'Build arm64 installer'
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
env:
Platform: ARM64
Py_OutDir: $(Build.BinariesDirectory)
PYTHON: $(Build.BinariesDirectory)\win32\python.exe
PythonForBuild: $(Build.BinariesDirectory)\win32\python.exe
PYTHONHOME: $(Build.SourcesDirectory)
BuildForRelease: true
SuppressMinGWLib: true

- task: CopyFiles@2
displayName: 'Assemble artifact: msi (1/2)'
displayName: 'Assemble artifact: msi (win32)'
inputs:
sourceFolder: $(Build.BinariesDirectory)\win32\en-us
targetFolder: $(Build.ArtifactStagingDirectory)\msi\win32
Expand All @@ -119,7 +146,7 @@ steps:
*.exe

- task: CopyFiles@2
displayName: 'Assemble artifact: msi (2/2)'
displayName: 'Assemble artifact: msi (amd64)'
inputs:
sourceFolder: $(Build.BinariesDirectory)\amd64\en-us
targetFolder: $(Build.ArtifactStagingDirectory)\msi\amd64
Expand All @@ -128,6 +155,17 @@ steps:
*.cab
*.exe

- task: CopyFiles@2
displayName: 'Assemble artifact: msi (arm64)'
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
inputs:
sourceFolder: $(Build.BinariesDirectory)\arm64\en-us
targetFolder: $(Build.ArtifactStagingDirectory)\msi\arm64
contents: |
*.msi
*.cab
*.exe

- task: PublishPipelineArtifact@0
displayName: 'Publish MSI'
inputs:
Expand Down
4 changes: 2 additions & 2 deletions .azure-pipelines/windows-release/stage-publish-nugetorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:


- powershell: 'gci pythonarm*.nupkg | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
displayName: 'Prevent publishing ARM/ARM64 packages'
displayName: 'Prevent publishing ARM64 packages'
workingDirectory: '$(Build.BinariesDirectory)\nuget'
condition: and(succeeded(), not(variables['PublishArmPackages']))
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))

- task: NuGetCommand@2
displayName: Push packages
Expand Down
5 changes: 3 additions & 2 deletions .azure-pipelines/windows-release/stage-publish-pythonorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ jobs:
downloadPath: $(Build.BinariesDirectory)


# Note that ARM64 MSIs are skipped at build when this option is specified
- powershell: 'gci *embed-arm*.zip | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
displayName: 'Prevent publishing ARM/ARM64 packages'
displayName: 'Prevent publishing ARM64 packages'
workingDirectory: '$(Build.BinariesDirectory)\embed'
condition: and(succeeded(), not(variables['PublishArmPackages']))
condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))


- template: ./gpg-sign.yml
Expand Down
8 changes: 4 additions & 4 deletions .azure-pipelines/windows-release/stage-test-msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ jobs:
strategy:
matrix:
win32_User:
ExeMatch: 'python-[\dabrc.]+-webinstall\.exe'
ExeMatch: 'python-[\dabrc.]+\.exe'
Logs: $(Build.ArtifactStagingDirectory)\logs\win32_User
InstallAllUsers: 0
win32_Machine:
ExeMatch: 'python-[\dabrc.]+-webinstall\.exe'
ExeMatch: 'python-[\dabrc.]+\.exe'
Logs: $(Build.ArtifactStagingDirectory)\logs\win32_Machine
InstallAllUsers: 1
amd64_User:
ExeMatch: 'python-[\dabrc.]+-amd64-webinstall\.exe'
ExeMatch: 'python-[\dabrc.]+-amd64\.exe'
Logs: $(Build.ArtifactStagingDirectory)\logs\amd64_User
InstallAllUsers: 0
amd64_Machine:
ExeMatch: 'python-[\dabrc.]+-amd64-webinstall\.exe'
ExeMatch: 'python-[\dabrc.]+-amd64\.exe'
Logs: $(Build.ArtifactStagingDirectory)\logs\amd64_Machine
InstallAllUsers: 1

Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/build_msi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,11 @@ jobs:
- uses: actions/checkout@v2
- name: Build CPython installer
run: .\Tools\msi\build.bat -x64

build_win_arm64:
name: 'Windows (ARM64) Installer'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Build CPython installer
run: .\Tools\msi\build.bat -arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
The traditional EXE/MSI based installer for Windows is now available for
ARM64
9 changes: 7 additions & 2 deletions PCbuild/openssl.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,22 @@
<_DLLSuffix>-1_1</_DLLSuffix>
<_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
<_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
<OpenSSLDLLSuffix>$(_DLLSuffix)</OpenSSLDLLSuffix>
</PropertyGroup>
<ItemGroup>
<_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
<_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).pdb" />
<_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).dll" />
<_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).pdb" />
</ItemGroup>
<Target Name="_CopySSLDLL" Inputs="@(_SSLDLL)" Outputs="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
<Target Name="_CopySSLDLL"
Inputs="@(_SSLDLL)"
Outputs="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')"
Condition="$(SkipCopySSLDLL) == ''"
AfterTargets="Build">
<Copy SourceFiles="@(_SSLDLL)" DestinationFolder="$(OutDir)" />
</Target>
<Target Name="_CleanSSLDLL" BeforeTargets="Clean">
<Target Name="_CleanSSLDLL" Condition="$(SkipCopySSLDLL) == ''" BeforeTargets="Clean">
<Delete Files="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')" TreatErrorsAsWarnings="true" />
</Target>
</Project>
1 change: 1 addition & 0 deletions PCbuild/tcltk.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<tcltkLib>$(tcltkDir)lib\tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).lib;$(tcltkDir)lib\tk$(TkMajorVersion)$(TkMinorVersion)t$(TclDebugExt).lib</tcltkLib>
<TclMachine>IX86</TclMachine>
<TclMachine Condition="'$(Platform)' == 'x64'">AMD64</TclMachine>
<TclMachine Condition="'$(Platform)' == 'ARM64'">ARM64</TclMachine>
<TclVersions>TCL_MAJOR_VERSION=$(TclMajorVersion) TCL_MINOR_VERSION=$(TclMinorVersion) TCL_PATCH_LEVEL=$(TclPatchLevel)</TclVersions>
<TclShortVersions>TCL_MAJOR=$(TclMajorVersion) TCL_MINOR=$(TclMinorVersion) TCL_PATCH=$(TclPatchLevel)</TclShortVersions>
<TkVersions>TK_MAJOR_VERSION=$(TkMajorVersion) TK_MINOR_VERSION=$(TkMinorVersion) TK_PATCH_LEVEL=$(TkPatchLevel)</TkVersions>
Expand Down
2 changes: 1 addition & 1 deletion Tools/msi/appendpath/appendpath.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
<Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />

<PropertyRef Id="UpgradeTable" />
<PropertyRef Id="REGISTRYKEY" />
Expand Down
23 changes: 18 additions & 5 deletions Tools/msi/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ set PCBUILD=%D%..\..\PCbuild\

set BUILDX86=
set BUILDX64=
set BUILDARM64=
set BUILDDOC=
set BUILDTEST=
set BUILDPACK=
Expand All @@ -14,22 +15,23 @@ set REBUILD=
if "%~1" EQU "-h" goto Help
if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
if "%~1" EQU "-arm64" (set BUILDARM64=1) && shift && goto CheckOpts
if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
if "%~1" EQU "--test-marker" (set BUILDTEST=--test-marker) && shift && goto CheckOpts
if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts

if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM64 (set BUILDX86=1) && (set BUILDX64=1)

call "%D%get_externals.bat"
call "%PCBUILD%find_msbuild.bat" %MSBUILD%
if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)

if defined BUILDX86 (
call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
call "%PCBUILD%build.bat" -p Win32 -d -e %REBUILD% %BUILDTEST%
if errorlevel 1 goto :eof
call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
call "%PCBUILD%build.bat" -p Win32 -e %REBUILD% %BUILDTEST%
if errorlevel 1 goto :eof
)
if defined BUILDX64 (
Expand All @@ -38,6 +40,12 @@ if defined BUILDX64 (
call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
if errorlevel 1 goto :eof
)
if defined BUILDARM64 (
call "%PCBUILD%build.bat" -p ARM64 -d -e %REBUILD% %BUILDTEST%
if errorlevel 1 goto :eof
call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST%
if errorlevel 1 goto :eof
)

if defined BUILDDOC (
call "%PCBUILD%..\Doc\make.bat" htmlhelp
Expand All @@ -59,21 +67,26 @@ if defined REBUILD (
)

if defined BUILDX86 (
%MSBUILD% %BUILD_CMD%
%MSBUILD% /p:Platform=x86 %BUILD_CMD%
if errorlevel 1 goto :eof
)
if defined BUILDX64 (
%MSBUILD% /p:Platform=x64 %BUILD_CMD%
if errorlevel 1 goto :eof
)
if defined BUILDARM64 (
%MSBUILD% /p:Platform=ARM64 %BUILD_CMD%
if errorlevel 1 goto :eof
)

exit /B 0

:Help
echo build.bat [-x86] [-x64] [--doc] [-h] [--test-marker] [--pack] [-r]
echo build.bat [-x86] [-x64] [-arm64] [--doc] [-h] [--test-marker] [--pack] [-r]
echo.
echo -x86 Build x86 installers
echo -x64 Build x64 installers
echo -ARM64 Build ARM64 installers
echo --doc Build CHM documentation
echo --test-marker Build with test markers
echo --no-test-marker Build without test markers (default)
Expand Down
Loading