From 400d8c111f7c9c71d392951f6639b4db6ea5c2de Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Fri, 31 Jul 2026 21:13:38 +0300 Subject: [PATCH] Fix Windows layout directory for both Tcl 8 and 9 --- windows-release/stage-layout-full.yml | 11 ++++++++++- windows-release/stage-layout-msix.yml | 15 ++++++++++----- windows-release/stage-layout-pymanager.yml | 11 ++++++++++- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/windows-release/stage-layout-full.yml b/windows-release/stage-layout-full.yml index c092a558..6a29fce3 100644 --- a/windows-release/stage-layout-full.yml +++ b/windows-release/stage-layout-full.yml @@ -125,7 +125,16 @@ jobs: targetPath: $(Pipeline.Workspace)\$(TclLibrary) - powershell: | - Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$(Pipeline.Workspace)\$(TclLibrary)\tcl8" + # PC\layout copies the *parent* of TCL_LIBRARY into the layout, so it only + # needs to name a directory that exists inside the artifact: tcl8 for + # Tcl 8.6, tk9.0 for Tcl 9 (which embeds its scripts in the DLL). + $tcl = Get-ChildItem "$(Pipeline.Workspace)\$(TclLibrary)" -Directory | + Where-Object { $_.Name -match '^t(cl|k)\d' } | Select-Object -First 1 + if (-not $tcl) { + Write-Host "##[error]No Tcl/Tk library directory found in $(Pipeline.Workspace)\$(TclLibrary)" + exit 1 + } + Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$($tcl.FullName)" displayName: 'Update TCL_LIBRARY' condition: and(succeeded(), variables['TclLibrary']) diff --git a/windows-release/stage-layout-msix.yml b/windows-release/stage-layout-msix.yml index d5e4cbd8..8bf407bc 100644 --- a/windows-release/stage-layout-msix.yml +++ b/windows-release/stage-layout-msix.yml @@ -63,7 +63,16 @@ jobs: targetPath: $(Pipeline.Workspace)\$(TclLibrary) - powershell: | - Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$(Pipeline.Workspace)\$(TclLibrary)\tcl8" + # PC\layout copies the *parent* of TCL_LIBRARY into the layout, so it only + # needs to name a directory that exists inside the artifact: tcl8 for + # Tcl 8.6, tk9.0 for Tcl 9 (which embeds its scripts in the DLL). + $tcl = Get-ChildItem "$(Pipeline.Workspace)\$(TclLibrary)" -Directory | + Where-Object { $_.Name -match '^t(cl|k)\d' } | Select-Object -First 1 + if (-not $tcl) { + Write-Host "##[error]No Tcl/Tk library directory found in $(Pipeline.Workspace)\$(TclLibrary)" + exit 1 + } + Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$($tcl.FullName)" displayName: 'Update TCL_LIBRARY' condition: and(succeeded(), variables['TclLibrary']) @@ -94,8 +103,6 @@ jobs: Remove-Item "$(Build.ArtifactStagingDirectory)\appx-store" -Recurse -Force -EA 0 $(LayoutCmd) --copy "$(Build.ArtifactStagingDirectory)\appx-store" --preset-appx $(ExtraOptions) displayName: 'Generate store APPX layout' - env: - TCL_LIBRARY: $(TclLibrary) - ${{ if parameters.SigningCertificate }}: # The dotnet sign tool shouldn't need this, but we do because of the sccd file @@ -110,8 +117,6 @@ jobs: Remove-Item "$(Build.ArtifactStagingDirectory)\appx" -Recurse -Force -EA 0 $(LayoutCmd) --copy "$(Build.ArtifactStagingDirectory)\appx" --preset-appx --include-symbols --include-tests $(ExtraOptions) displayName: 'Generate sideloading APPX layout' - env: - TCL_LIBRARY: $(TclLibrary) - publish: '$(Build.ArtifactStagingDirectory)\appx-store' artifact: layout_appxstore_$(Name) diff --git a/windows-release/stage-layout-pymanager.yml b/windows-release/stage-layout-pymanager.yml index d64748a3..8dddcd63 100644 --- a/windows-release/stage-layout-pymanager.yml +++ b/windows-release/stage-layout-pymanager.yml @@ -169,7 +169,16 @@ jobs: targetPath: $(Pipeline.Workspace)\$(TclLibrary) - powershell: | - Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$(Pipeline.Workspace)\$(TclLibrary)\tcl8" + # PC\layout copies the *parent* of TCL_LIBRARY into the layout, so it only + # needs to name a directory that exists inside the artifact: tcl8 for + # Tcl 8.6, tk9.0 for Tcl 9 (which embeds its scripts in the DLL). + $tcl = Get-ChildItem "$(Pipeline.Workspace)\$(TclLibrary)" -Directory | + Where-Object { $_.Name -match '^t(cl|k)\d' } | Select-Object -First 1 + if (-not $tcl) { + Write-Host "##[error]No Tcl/Tk library directory found in $(Pipeline.Workspace)\$(TclLibrary)" + exit 1 + } + Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$($tcl.FullName)" displayName: 'Update TCL_LIBRARY' condition: and(succeeded(), variables['TclLibrary'])