Skip to content

Commit 400d8c1

Browse files
committed
Fix Windows layout directory for both Tcl 8 and 9
1 parent 425324c commit 400d8c1

3 files changed

Lines changed: 30 additions & 7 deletions

File tree

windows-release/stage-layout-full.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,16 @@ jobs:
125125
targetPath: $(Pipeline.Workspace)\$(TclLibrary)
126126

127127
- powershell: |
128-
Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$(Pipeline.Workspace)\$(TclLibrary)\tcl8"
128+
# PC\layout copies the *parent* of TCL_LIBRARY into the layout, so it only
129+
# needs to name a directory that exists inside the artifact: tcl8 for
130+
# Tcl 8.6, tk9.0 for Tcl 9 (which embeds its scripts in the DLL).
131+
$tcl = Get-ChildItem "$(Pipeline.Workspace)\$(TclLibrary)" -Directory |
132+
Where-Object { $_.Name -match '^t(cl|k)\d' } | Select-Object -First 1
133+
if (-not $tcl) {
134+
Write-Host "##[error]No Tcl/Tk library directory found in $(Pipeline.Workspace)\$(TclLibrary)"
135+
exit 1
136+
}
137+
Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$($tcl.FullName)"
129138
displayName: 'Update TCL_LIBRARY'
130139
condition: and(succeeded(), variables['TclLibrary'])
131140

windows-release/stage-layout-msix.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,16 @@ jobs:
6363
targetPath: $(Pipeline.Workspace)\$(TclLibrary)
6464

6565
- powershell: |
66-
Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$(Pipeline.Workspace)\$(TclLibrary)\tcl8"
66+
# PC\layout copies the *parent* of TCL_LIBRARY into the layout, so it only
67+
# needs to name a directory that exists inside the artifact: tcl8 for
68+
# Tcl 8.6, tk9.0 for Tcl 9 (which embeds its scripts in the DLL).
69+
$tcl = Get-ChildItem "$(Pipeline.Workspace)\$(TclLibrary)" -Directory |
70+
Where-Object { $_.Name -match '^t(cl|k)\d' } | Select-Object -First 1
71+
if (-not $tcl) {
72+
Write-Host "##[error]No Tcl/Tk library directory found in $(Pipeline.Workspace)\$(TclLibrary)"
73+
exit 1
74+
}
75+
Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$($tcl.FullName)"
6776
displayName: 'Update TCL_LIBRARY'
6877
condition: and(succeeded(), variables['TclLibrary'])
6978
@@ -94,8 +103,6 @@ jobs:
94103
Remove-Item "$(Build.ArtifactStagingDirectory)\appx-store" -Recurse -Force -EA 0
95104
$(LayoutCmd) --copy "$(Build.ArtifactStagingDirectory)\appx-store" --preset-appx $(ExtraOptions)
96105
displayName: 'Generate store APPX layout'
97-
env:
98-
TCL_LIBRARY: $(TclLibrary)
99106
100107
- ${{ if parameters.SigningCertificate }}:
101108
# The dotnet sign tool shouldn't need this, but we do because of the sccd file
@@ -110,8 +117,6 @@ jobs:
110117
Remove-Item "$(Build.ArtifactStagingDirectory)\appx" -Recurse -Force -EA 0
111118
$(LayoutCmd) --copy "$(Build.ArtifactStagingDirectory)\appx" --preset-appx --include-symbols --include-tests $(ExtraOptions)
112119
displayName: 'Generate sideloading APPX layout'
113-
env:
114-
TCL_LIBRARY: $(TclLibrary)
115120
116121
- publish: '$(Build.ArtifactStagingDirectory)\appx-store'
117122
artifact: layout_appxstore_$(Name)

windows-release/stage-layout-pymanager.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,16 @@ jobs:
169169
targetPath: $(Pipeline.Workspace)\$(TclLibrary)
170170

171171
- powershell: |
172-
Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$(Pipeline.Workspace)\$(TclLibrary)\tcl8"
172+
# PC\layout copies the *parent* of TCL_LIBRARY into the layout, so it only
173+
# needs to name a directory that exists inside the artifact: tcl8 for
174+
# Tcl 8.6, tk9.0 for Tcl 9 (which embeds its scripts in the DLL).
175+
$tcl = Get-ChildItem "$(Pipeline.Workspace)\$(TclLibrary)" -Directory |
176+
Where-Object { $_.Name -match '^t(cl|k)\d' } | Select-Object -First 1
177+
if (-not $tcl) {
178+
Write-Host "##[error]No Tcl/Tk library directory found in $(Pipeline.Workspace)\$(TclLibrary)"
179+
exit 1
180+
}
181+
Write-Host "##vso[task.setvariable variable=TCL_LIBRARY]$($tcl.FullName)"
173182
displayName: 'Update TCL_LIBRARY'
174183
condition: and(succeeded(), variables['TclLibrary'])
175184

0 commit comments

Comments
 (0)