From da7d99a4de72aac8d436cecedf16ab2676f9b785 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Mon, 28 Feb 2022 12:06:43 +0000 Subject: bpo-46567: Add Tcl/Tk build for Windows ARM64 (GH-31574) --- .azure-pipelines/tcltk-build.yml | 6 ++++++ .azure-pipelines/windows-release/msi-steps.yml | 11 ++++++++--- .azure-pipelines/windows-release/stage-build.yml | 13 +++++++++++++ .azure-pipelines/windows-release/stage-layout-full.yml | 1 + .azure-pipelines/windows-release/stage-layout-msix.yml | 1 + .../next/Windows/2022-02-25-01-22-31.bpo-46567.37WEue.rst | 2 ++ PCbuild/get_externals.bat | 6 +++--- PCbuild/pcbuild.proj | 2 +- PCbuild/prepare_tcltk.bat | 4 ++++ PCbuild/tcl.vcxproj | 8 ++++++-- PCbuild/tcltk.props | 5 ++++- PCbuild/tix.vcxproj | 6 +++++- PCbuild/tk.vcxproj | 8 ++++++-- Tools/msi/bundle/Default.ARM64.xsl | 5 +---- Tools/msi/bundle/bundle.targets | 2 +- Tools/msi/bundle/bundle.wxs | 7 +------ 16 files changed, 63 insertions(+), 24 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2022-02-25-01-22-31.bpo-46567.37WEue.rst diff --git a/.azure-pipelines/tcltk-build.yml b/.azure-pipelines/tcltk-build.yml index 27968e8..f9e50d3 100644 --- a/.azure-pipelines/tcltk-build.yml +++ b/.azure-pipelines/tcltk-build.yml @@ -60,6 +60,12 @@ jobs: & "$(msbuild)" PCbuild\tix.vcxproj "@msbuild.rsp" /p:Platform=x64 /p:tcltkDir="$(OutDir)\amd64" displayName: 'Build for amd64' + - powershell: | + & "$(msbuild)" PCbuild\tcl.vcxproj "@msbuild.rsp" /p:Platform=ARM64 /p:tcltkDir="$(OutDir)\arm64" + & "$(msbuild)" PCbuild\tk.vcxproj "@msbuild.rsp" /p:Platform=ARM64 /p:tcltkDir="$(OutDir)\arm64" + & "$(msbuild)" PCbuild\tix.vcxproj "@msbuild.rsp" /p:Platform=ARM64 /p:tcltkDir="$(OutDir)\arm64" + displayName: 'Build for arm64' + - publish: '$(OutDir)' artifact: 'tcltk' displayName: 'Publishing tcltk' diff --git a/.azure-pipelines/windows-release/msi-steps.yml b/.azure-pipelines/windows-release/msi-steps.yml index ef98d56..3c08a06 100644 --- a/.azure-pipelines/windows-release/msi-steps.yml +++ b/.azure-pipelines/windows-release/msi-steps.yml @@ -71,6 +71,13 @@ steps: artifactName: tcltk_lib_amd64 targetPath: $(Build.BinariesDirectory)\tcltk_lib_amd64 + - task: DownloadPipelineArtifact@1 + displayName: 'Download artifact: tcltk_lib_arm64' + condition: and(succeeded(), eq(variables['PublishARM64'], 'true')) + inputs: + artifactName: tcltk_lib_arm64 + targetPath: $(Build.BinariesDirectory)\tcltk_lib_arm64 + - powershell: | copy $(Build.BinariesDirectory)\amd64\Activate.ps1 Lib\venv\scripts\common\Activate.ps1 -Force displayName: 'Copy signed files into sources' @@ -107,7 +114,6 @@ steps: 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 @@ -120,7 +126,6 @@ steps: 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 @@ -132,8 +137,8 @@ steps: PYTHON: $(Build.BinariesDirectory)\win32\python.exe PythonForBuild: $(Build.BinariesDirectory)\win32\python.exe PYTHONHOME: $(Build.SourcesDirectory) + TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_arm64 BuildForRelease: true - SuppressMinGWLib: true - task: CopyFiles@2 displayName: 'Assemble artifact: msi (win32)' diff --git a/.azure-pipelines/windows-release/stage-build.yml b/.azure-pipelines/windows-release/stage-build.yml index f70414b..e45034f 100644 --- a/.azure-pipelines/windows-release/stage-build.yml +++ b/.azure-pipelines/windows-release/stage-build.yml @@ -166,6 +166,13 @@ jobs: platform: x64 msbuildArguments: /t:CopyTclTkLib /p:OutDir="$(Build.ArtifactStagingDirectory)\tcl_amd64" + - task: MSBuild@1 + displayName: 'Copy Tcl/Tk lib for publish' + inputs: + solution: PCbuild\tcltk.props + platform: ARM64 + msbuildArguments: /t:CopyTclTkLib /p:OutDir="$(Build.ArtifactStagingDirectory)\tcl_arm64" + - task: PublishPipelineArtifact@0 displayName: 'Publish artifact: tcltk_lib_win32' inputs: @@ -177,3 +184,9 @@ jobs: inputs: targetPath: '$(Build.ArtifactStagingDirectory)\tcl_amd64' artifactName: tcltk_lib_amd64 + + - task: PublishPipelineArtifact@0 + displayName: 'Publish artifact: tcltk_lib_arm64' + inputs: + targetPath: '$(Build.ArtifactStagingDirectory)\tcl_arm64' + artifactName: tcltk_lib_arm64 diff --git a/.azure-pipelines/windows-release/stage-layout-full.yml b/.azure-pipelines/windows-release/stage-layout-full.yml index 0ba2fc0..3546df6 100644 --- a/.azure-pipelines/windows-release/stage-layout-full.yml +++ b/.azure-pipelines/windows-release/stage-layout-full.yml @@ -26,6 +26,7 @@ jobs: HostArch: amd64 Python: $(Build.BinariesDirectory)\bin_amd64\python.exe PYTHONHOME: $(Build.SourcesDirectory) + TclLibrary: $(Build.BinariesDirectory)\tcltk_lib\tcl8 steps: - template: ./checkout.yml diff --git a/.azure-pipelines/windows-release/stage-layout-msix.yml b/.azure-pipelines/windows-release/stage-layout-msix.yml index 6efd327..913bfcd 100644 --- a/.azure-pipelines/windows-release/stage-layout-msix.yml +++ b/.azure-pipelines/windows-release/stage-layout-msix.yml @@ -25,6 +25,7 @@ jobs: HostArch: amd64 Python: $(Build.BinariesDirectory)\bin_amd64\python.exe PYTHONHOME: $(Build.SourcesDirectory) + TclLibrary: $(Build.BinariesDirectory)\tcltk_lib\tcl8 steps: - template: ./checkout.yml diff --git a/Misc/NEWS.d/next/Windows/2022-02-25-01-22-31.bpo-46567.37WEue.rst b/Misc/NEWS.d/next/Windows/2022-02-25-01-22-31.bpo-46567.37WEue.rst new file mode 100644 index 0000000..10a2b76 --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2022-02-25-01-22-31.bpo-46567.37WEue.rst @@ -0,0 +1,2 @@ +Adds Tcl and Tk support for Windows ARM64. This also adds IDLE to the +installation. diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat index 5b0fe64..d4e052e 100644 --- a/PCbuild/get_externals.bat +++ b/PCbuild/get_externals.bat @@ -55,8 +55,8 @@ set libraries=%libraries% bzip2-1.0.6 if NOT "%IncludeLibffiSrc%"=="false" set libraries=%libraries% libffi-3.4.2 if NOT "%IncludeSSLSrc%"=="false" set libraries=%libraries% openssl-1.1.1m set libraries=%libraries% sqlite-3.37.2.0 -if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.12.0 -if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.12.0 +if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tcl-core-8.6.12.1 +if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tk-8.6.12.1 if NOT "%IncludeTkinterSrc%"=="false" set libraries=%libraries% tix-8.4.3.6 set libraries=%libraries% xz-5.2.2 set libraries=%libraries% zlib-1.2.11 @@ -78,7 +78,7 @@ echo.Fetching external binaries... set binaries= if NOT "%IncludeLibffi%"=="false" set binaries=%binaries% libffi-3.4.2 if NOT "%IncludeSSL%"=="false" set binaries=%binaries% openssl-bin-1.1.1m -if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.12.0 +if NOT "%IncludeTkinter%"=="false" set binaries=%binaries% tcltk-8.6.12.1 if NOT "%IncludeSSLSrc%"=="false" set binaries=%binaries% nasm-2.11.06 for %%b in (%binaries%) do ( diff --git a/PCbuild/pcbuild.proj b/PCbuild/pcbuild.proj index f32422a..2ba0627 100644 --- a/PCbuild/pcbuild.proj +++ b/PCbuild/pcbuild.proj @@ -73,7 +73,7 @@ - + diff --git a/PCbuild/prepare_tcltk.bat b/PCbuild/prepare_tcltk.bat index 77075af..4a43ed1 100644 --- a/PCbuild/prepare_tcltk.bat +++ b/PCbuild/prepare_tcltk.bat @@ -53,3 +53,7 @@ call "%PCBUILD%\get_externals.bat" --tkinter-src %ORG_SETTING% %MSBUILD% "%PCBUILD%\tcl.vcxproj" /p:Configuration=Release /p:Platform=x64 %MSBUILD% "%PCBUILD%\tk.vcxproj" /p:Configuration=Release /p:Platform=x64 %MSBUILD% "%PCBUILD%\tix.vcxproj" /p:Configuration=Release /p:Platform=x64 + +%MSBUILD% "%PCBUILD%\tcl.vcxproj" /p:Configuration=Release /p:Platform=ARM64 +%MSBUILD% "%PCBUILD%\tk.vcxproj" /p:Configuration=Release /p:Platform=ARM64 +%MSBUILD% "%PCBUILD%\tix.vcxproj" /p:Configuration=Release /p:Platform=ARM64 diff --git a/PCbuild/tcl.vcxproj b/PCbuild/tcl.vcxproj index 4536cbc..ab68db9 100644 --- a/PCbuild/tcl.vcxproj +++ b/PCbuild/tcl.vcxproj @@ -33,6 +33,10 @@ Release x64 + + Release + ARM64 + {B5FD6F1D-129E-4BFF-9340-03606FAC7283} @@ -59,8 +63,8 @@ setlocal set VCINSTALLDIR=$(VCInstallDir) cd /D "$(tclDir)win" -nmake -f makefile.vc MACHINE=$(TclMachine) OPTS=$(TclOpts) $(TclDirs) $(DebugFlags) $(WarningsFlags) core shell dlls -nmake -f makefile.vc MACHINE=$(TclMachine) OPTS=$(TclOpts) $(TclDirs) $(DebugFlags) $(WarningsFlags) install-binaries install-libraries +nmake -f makefile.vc MACHINE=$(TclMachine) OPTS=$(TclOpts) $(TclDirs) $(DebugFlags) $(WarningsFlags) TCLSH_NATIVE="$(tclWin32Exe)" core shell dlls +nmake -f makefile.vc MACHINE=$(TclMachine) OPTS=$(TclOpts) $(TclDirs) $(DebugFlags) $(WarningsFlags) TCLSH_NATIVE="$(tclWin32Exe)" install-binaries install-libraries copy /Y ..\license.terms "$(OutDir)\tcllicense.terms" diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props index 72cffc3..7fd43e8 100644 --- a/PCbuild/tcltk.props +++ b/PCbuild/tcltk.props @@ -5,7 +5,7 @@ 8 6 12 - 0 + 1 $(TclMajorVersion) $(TclMinorVersion) $(TclPatchLevel) @@ -18,6 +18,9 @@ $(ExternalsDir)tk-$(TkMajorVersion).$(TkMinorVersion).$(TkPatchLevel).$(TkRevision)\ $(ExternalsDir)tix-$(TixMajorVersion).$(TixMinorVersion).$(TixPatchLevel).$(TixRevision)\ $(ExternalsDir)tcltk-$(TclMajorVersion).$(TclMinorVersion).$(TclPatchLevel).$(TclRevision)\$(ArchName)\ + $(tcltkDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe + $(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe + tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).dll tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).lib diff --git a/PCbuild/tix.vcxproj b/PCbuild/tix.vcxproj index 5168209..48abcd2 100644 --- a/PCbuild/tix.vcxproj +++ b/PCbuild/tix.vcxproj @@ -33,6 +33,10 @@ Release x64 + + Release + ARM64 + {C5A3E7FB-9695-4B2E-960B-1D9F43F1E555} @@ -53,7 +57,7 @@ - BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))" + BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))" TCLSH_EXE="$(tclWin32Exe)" DEBUG=1 NODEBUG=0 TCL_DBGX=g TK_DBGX=g DEBUG=0 NODEBUG=1 -c -W3 -nologo -MD -wd4028 -wd4090 -wd4244 -wd4267 -wd4312 diff --git a/PCbuild/tk.vcxproj b/PCbuild/tk.vcxproj index 70b5459..b111969 100644 --- a/PCbuild/tk.vcxproj +++ b/PCbuild/tk.vcxproj @@ -33,6 +33,10 @@ Release x64 + + Release + ARM64 + {7E85ECCF-A72C-4DA4-9E52-884508E80BA1} @@ -60,8 +64,8 @@ setlocal set VCINSTALLDIR=$(VCInstallDir) cd /D "$(tkDir)win" -nmake /nologo -f makefile.vc RC=rc MACHINE=$(TclMachine) OPTS=$(TkOpts) $(TkDirs) $(DebugFlags) $(WarningsFlags) all -nmake /nologo -f makefile.vc RC=rc MACHINE=$(TclMachine) OPTS=$(TkOpts) $(TkDirs) $(DebugFlags) $(WarningsFlags) install-binaries install-libraries +nmake /nologo -f makefile.vc RC=rc MACHINE=$(TclMachine) OPTS=$(TkOpts) $(TkDirs) $(DebugFlags) $(WarningsFlags) TCLSH_NATIVE="$(tclWin32Exe)" all +nmake /nologo -f makefile.vc RC=rc MACHINE=$(TclMachine) OPTS=$(TkOpts) $(TkDirs) $(DebugFlags) $(WarningsFlags) TCLSH_NATIVE="$(tclWin32Exe)" install-binaries install-libraries copy /Y ..\license.terms "$(OutDir)\tklicense.terms" diff --git a/Tools/msi/bundle/Default.ARM64.xsl b/Tools/msi/bundle/Default.ARM64.xsl index 0dd1c9e..f63da4e 100644 --- a/Tools/msi/bundle/Default.ARM64.xsl +++ b/Tools/msi/bundle/Default.ARM64.xsl @@ -13,14 +13,11 @@ [TargetDir] -Includes pip and documentation +Includes IDLE, pip and documentation Creates shortcuts but no file associations (The 'py' launcher is currently unavailable on ARM64.) - - (tcl/tk and IDLE are currently unavailable on ARM64.) - \ No newline at end of file diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets index 4f4306f..89a5960 100644 --- a/Tools/msi/bundle/bundle.targets +++ b/Tools/msi/bundle/bundle.targets @@ -69,7 +69,7 @@ - + diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index 5c9fd6d..340c72a 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -77,12 +77,7 @@ - - - - - @@ -122,8 +117,8 @@ - + -- cgit v0.12