]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-46567: Add Tcl/Tk build for Windows ARM64 (GH-31574)
authorSteve Dower <steve.dower@python.org>
Mon, 28 Feb 2022 12:06:43 +0000 (12:06 +0000)
committerGitHub <noreply@github.com>
Mon, 28 Feb 2022 12:06:43 +0000 (12:06 +0000)
16 files changed:
.azure-pipelines/tcltk-build.yml
.azure-pipelines/windows-release/msi-steps.yml
.azure-pipelines/windows-release/stage-build.yml
.azure-pipelines/windows-release/stage-layout-full.yml
.azure-pipelines/windows-release/stage-layout-msix.yml
Misc/NEWS.d/next/Windows/2022-02-25-01-22-31.bpo-46567.37WEue.rst [new file with mode: 0644]
PCbuild/get_externals.bat
PCbuild/pcbuild.proj
PCbuild/prepare_tcltk.bat
PCbuild/tcl.vcxproj
PCbuild/tcltk.props
PCbuild/tix.vcxproj
PCbuild/tk.vcxproj
Tools/msi/bundle/Default.ARM64.xsl
Tools/msi/bundle/bundle.targets
Tools/msi/bundle/bundle.wxs

index 27968e886cc140d1037f68c1b4bf019942f4e1d9..f9e50d3711a4607ac421c0e7b32afb4497728eb4 100644 (file)
@@ -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'
index ef98d56c78363cfdbdca9af5ea4064b347f34840..3c08a0660abe9dee089da0609546601b23906285 100644 (file)
@@ -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)'
index f70414ba211452b96bd06668bce6e917351cc7d7..e45034f650fb9ef2a688ee8827168d571e2e91cb 100644 (file)
@@ -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
index 0ba2fc017d987a4b2fb9f0aacc7e13c6042bc4d3..3546df60e4e032369d67608f97813adda273c96a 100644 (file)
@@ -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
index 6efd327bdb32e5201fed98c26ff250cba332d785..913bfcd919704b0136b0555b0587deec0371544b 100644 (file)
@@ -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 (file)
index 0000000..10a2b76
--- /dev/null
@@ -0,0 +1,2 @@
+Adds Tcl and Tk support for Windows ARM64. This also adds IDLE to the
+installation.
index 5b0fe640eb84e15e7bcf250c55efbd5fc28abf2b..d4e052ef32c8248b84cc79fae80a06e7850bad02 100644 (file)
@@ -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 (
index f32422a0acf44a064de9fdeb83bb0cda2329c5aa..2ba0627b8336952caf278ada83be085b46144f47 100644 (file)
@@ -73,7 +73,7 @@
     <!-- _ssl will build _socket as well, which may cause conflicts in parallel builds -->
     <ExtensionModules Include="_socket" Condition="!$(IncludeSSL) or !$(IncludeExternals)" />
     <ExternalModules Include="_ssl;_hashlib" Condition="$(IncludeSSL)" />
-    <ExternalModules Include="_tkinter" Condition="$(IncludeTkinter) and $(Platform) != 'ARM' and $(Platform) != 'ARM64'" />
+    <ExternalModules Include="_tkinter" Condition="$(IncludeTkinter)" />
     <ExtensionModules Include="@(ExternalModules->'%(Identity)')" Condition="$(IncludeExternals)" />
     <Projects Include="@(ExtensionModules->'%(Identity).vcxproj')" Condition="$(IncludeExtensions)" />
     <!-- Test modules -->
index 77075af94f2c6958c1a51f3afedc06c35b6603b8..4a43ed1582ce33a0f82e8280bcd20ad2b5a1a6ac 100644 (file)
@@ -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
index 4536cbc925bd967251ce5f5e3e31ae207c99706c..ab68db9210fbe40d6eed74aea534074762898087 100644 (file)
       <Configuration>Release</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM64">
+      <Configuration>Release</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{B5FD6F1D-129E-4BFF-9340-03606FAC7283}</ProjectGuid>
@@ -59,8 +63,8 @@
     <NMakeBuildCommandLine>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"
 </NMakeBuildCommandLine>
   </PropertyGroup>
index 72cffc3ea1da6d1355eb8ded9379607235d9c8cd..7fd43e8279e8e4ef72aa748732ea25c6e1736d1d 100644 (file)
@@ -5,7 +5,7 @@
     <TclMajorVersion>8</TclMajorVersion>
     <TclMinorVersion>6</TclMinorVersion>
     <TclPatchLevel>12</TclPatchLevel>
-    <TclRevision>0</TclRevision>
+    <TclRevision>1</TclRevision>
     <TkMajorVersion>$(TclMajorVersion)</TkMajorVersion>
     <TkMinorVersion>$(TclMinorVersion)</TkMinorVersion>
     <TkPatchLevel>$(TclPatchLevel)</TkPatchLevel>
@@ -18,6 +18,9 @@
     <tkDir>$(ExternalsDir)tk-$(TkMajorVersion).$(TkMinorVersion).$(TkPatchLevel).$(TkRevision)\</tkDir>
     <tixDir>$(ExternalsDir)tix-$(TixMajorVersion).$(TixMinorVersion).$(TixPatchLevel).$(TixRevision)\</tixDir>
     <tcltkDir>$(ExternalsDir)tcltk-$(TclMajorVersion).$(TclMinorVersion).$(TclPatchLevel).$(TclRevision)\$(ArchName)\</tcltkDir>
+    <tclWin32Exe Condition="$(Platform) == 'Win32'">$(tcltkDir)\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe</tclWin32Exe>
+    <tclWin32Exe Condition="$(Platform) != 'Win32'">$(tcltkDir)\..\win32\bin\tclsh$(TclMajorVersion)$(TclMinorVersion)t.exe</tclWin32Exe>
+
     <!--<TclDebugExt Condition="'$(Configuration)' == 'Debug'">g</TclDebugExt>-->
     <tclDLLName>tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).dll</tclDLLName>
     <tclLibName>tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).lib</tclLibName>
index 51682094cb8444ba5e668ed492d148d31bb0cb5b..48abcd27c87759aab92d83b62c7cfd19aae62efb 100644 (file)
       <Configuration>Release</Configuration>
       <Platform>x64</Platform>
     </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|ARM64">
+      <Configuration>Release</Configuration>
+      <Platform>ARM64</Platform>
+    </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
     <ProjectGuid>{C5A3E7FB-9695-4B2E-960B-1D9F43F1E555}</ProjectGuid>
@@ -53,7 +57,7 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   
   <PropertyGroup>
-    <TixDirs>BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))"</TixDirs>
+    <TixDirs>BUILDDIRTOP="$(BuildDirTop)" TCL_DIR="$(tclDir.TrimEnd(`\`))" TK_DIR="$(tkDir.TrimEnd(`\`))" INSTALL_DIR="$(OutDir.TrimEnd(`\`))" TCLSH_EXE="$(tclWin32Exe)"</TixDirs>
     <DebugFlags Condition="'$(Configuration)' == 'Debug'">DEBUG=1 NODEBUG=0 TCL_DBGX=g TK_DBGX=g</DebugFlags>
     <DebugFlags Condition="'$(Configuration)' != 'Debug'">DEBUG=0 NODEBUG=1</DebugFlags>
     <CFlags>-c -W3 -nologo -MD -wd4028 -wd4090 -wd4244 -wd4267 -wd4312</CFlags>
index 70b5459a081c226b0e4c57239d18a4128e1c51d6..b111969ca5de6c7c48922f051a2be3b8e9950125 100644 (file)
     <ProjectConfiguration Include="Release|x64">
       <Configuration>Release</Configuration>
       <Platform>x64</Platform>
+    </ProjectConfiguration>
+        <ProjectConfiguration Include="Release|ARM64">
+      <Configuration>Release</Configuration>
+      <Platform>ARM64</Platform>
     </ProjectConfiguration>
   </ItemGroup>
   <PropertyGroup Label="Globals">
@@ -60,8 +64,8 @@
     <NMakeBuildCommandLine>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"
 </NMakeBuildCommandLine>
   </PropertyGroup>
index 0dd1c9e6a3d521944b22ddb23eccc238869de707..f63da4e7274cbef3fad6ded88933413904bc2dd7 100644 (file)
     <xsl:template match="*[local-name()='String' and @Id='InstallButtonNote']">
         <String Id="InstallButtonNote">[TargetDir]
 
-Includes pip and documentation
+Includes IDLE, pip and documentation
 Creates shortcuts but no file associations</String>
     </xsl:template>
 
     <xsl:template match="*[local-name()='String' and @Id='Include_launcherHelp']">
         <String Id="Include_launcherHelp">(The 'py' launcher is currently unavailable on ARM64.)</String>
     </xsl:template>
-    <xsl:template match="*[local-name()='String' and @Id='Include_tcltkHelpLabel']">
-        <String Id="Include_tcltkHelpLabel">(tcl/tk and IDLE are currently unavailable on ARM64.)</String>
-    </xsl:template>
 </xsl:stylesheet>
\ No newline at end of file
index 4f4306f7b61f01778191a9e95b23022ac24dac47..89a5960a50efe1192abea3eeaa170ed2319772bb 100644 (file)
@@ -69,7 +69,7 @@
         <Package Include="..\path\path*.wixproj" />
         <Package Include="..\appendpath\appendpath*.wixproj" />
         <Package Include="..\pip\pip*.wixproj" />
-        <Package Include="..\tcltk\tcltk*.wixproj" Condition="$(Platform) != 'ARM64'" />
+        <Package Include="..\tcltk\tcltk*.wixproj" />
         <Package Include="..\test\test*.wixproj" />
         <Package Include="..\tools\tools*.wixproj" />
         <Package Include="..\ucrt\ucrt*.wixproj" Condition="$(Platform) != 'ARM64'" />
index 5c9fd6dca394c58a858f525f169f9e952d25c9dd..340c72acf408be6f5e95f9c6c303a8f40661e687 100644 (file)
     <Variable Name="Include_test" Value="1" bal:Overridable="yes" />
     <Variable Name="Include_doc" Value="1" bal:Overridable="yes" />
     <Variable Name="Include_tools" Value="1" bal:Overridable="yes" />
-    <?if $(var.Platform)~="ARM64" ?>
-    <Variable Name="Include_tcltk" Value="0" />
-    <Variable Name="Include_tcltkState" Value="disable" />
-    <?else ?>
     <Variable Name="Include_tcltk" Value="1" bal:Overridable="yes" />
-    <?endif ?>
     <Variable Name="Include_pip" Value="1" bal:Overridable="yes" />
     <?if $(var.Platform)~="ARM64" ?>
     <Variable Name="Include_launcher" Value="0" bal:Overridable="yes" />
       <PackageGroupRef Id="test" />
       <PackageGroupRef Id="doc" />
       <PackageGroupRef Id="tools" />
-      <?if $(var.Platform)!="ARM64" ?>
       <PackageGroupRef Id="tcltk" />
+      <?if $(var.Platform)!="ARM64" ?>
       <PackageGroupRef Id="launcher" />
       <?endif ?>
       <PackageGroupRef Id="pip" />