@@ -89,16 +89,69 @@ stages:
8989 env:
9090 DB_PASSWORD: $(DB_PASSWORD)
9191
92- - task : DownloadPipelineArtifact@2
92+ - powershell : |
93+ # Download Python ARM64 from NuGet (contains libs directory with python.lib)
94+ $pythonVer = "${{ parameters.pythonVersion }}"
95+
96+ # Map version to NuGet package version
97+ $nugetVersion = switch ($pythonVer) {
98+ "3.10" { "3.10.11" }
99+ "3.11" { "3.11.9" }
100+ "3.12" { "3.12.7" }
101+ "3.13" { "3.13.0" }
102+ "3.14" { "3.14.0-a2" }
103+ default { throw "Unsupported Python version: $pythonVer" }
104+ }
105+
106+ $nugetUrl = "https://www.nuget.org/api/v2/package/pythonarm64/$nugetVersion"
107+ $nugetFile = "$(Build.SourcesDirectory)\pythonarm64.nupkg"
108+ $zipFile = "$(Build.SourcesDirectory)\pythonarm64.zip"
109+ $extractPath = "$(Build.SourcesDirectory)\pythonarm64-nuget"
110+ $destPath = "$(Build.SourcesDirectory)\mssql_python\pybind\python_libs\arm64"
111+
112+ Write-Host "Downloading Python $pythonVer ARM64 NuGet package from: $nugetUrl"
113+ Invoke-WebRequest -Uri $nugetUrl -OutFile $nugetFile -UseBasicParsing
114+
115+ Write-Host "Renaming .nupkg to .zip for extraction..."
116+ Move-Item -Path $nugetFile -Destination $zipFile -Force
117+
118+ Write-Host "Extracting NuGet package..."
119+ Expand-Archive -Path $zipFile -DestinationPath $extractPath -Force
120+
121+ Write-Host "`nSearching for libs directory..."
122+ $libsDir = Get-ChildItem -Path $extractPath -Recurse -Directory -Filter "libs" | Select-Object -First 1
123+
124+ if ($libsDir) {
125+ Write-Host "Found libs at: $($libsDir.FullName)"
126+ New-Item -ItemType Directory -Force -Path $destPath | Out-Null
127+ Copy-Item -Path "$($libsDir.FullName)\*" -Destination $destPath -Recurse -Force
128+ Write-Host "✓ Copied .lib files from NuGet package"
129+ } else {
130+ Write-Host "libs directory not found, searching for .lib files..."
131+ $libFiles = Get-ChildItem -Path $extractPath -Recurse -Filter "*.lib"
132+ New-Item -ItemType Directory -Force -Path $destPath | Out-Null
133+ foreach ($lib in $libFiles) {
134+ Write-Host " Copying $($lib.Name)"
135+ Copy-Item -Path $lib.FullName -Destination $destPath -Force
136+ }
137+ }
138+
139+ Write-Host "`nContents of $destPath :"
140+ Get-ChildItem $destPath | ForEach-Object { Write-Host " - $($_.Name)" }
141+
142+ $expectedLib = "python$($pythonVer.Replace('.', '')).lib"
143+ if (Test-Path "$destPath\$expectedLib") {
144+ Write-Host "`n✓ $expectedLib found"
145+ } else {
146+ Write-Error "$expectedLib not found in NuGet package!"
147+ exit 1
148+ }
149+
150+ # Cleanup
151+ Remove-Item -Path $zipFile -Force -ErrorAction SilentlyContinue
152+ Remove-Item -Path $extractPath -Recurse -Force -ErrorAction SilentlyContinue
93153 condition: eq(variables['targetArch'], 'arm64')
94- inputs :
95- buildType : ' specific'
96- project : ' $(System.TeamProject)'
97- definition : 2162
98- buildVersionToDownload : ' latest'
99- artifactName : ' mssql-python-arm64-libs'
100- targetPath : ' $(Build.SourcesDirectory)\mssql_python\pybind\python_libs\arm64'
101- displayName : ' Download ARM64 Python libs'
154+ displayName: 'Download Python ARM64 libs from NuGet'
102155
103156 - script : |
104157 echo "Python Version: $(pythonVersion)"
0 commit comments