kou commented on code in PR #2858:
URL: https://github.com/apache/arrow-adbc/pull/2858#discussion_r2641580837


##########
.github/workflows/native-windows.yml:
##########
@@ -260,6 +260,49 @@ jobs:
         with:
           fetch-depth: 0
           persist-credentials: false
+      - name: Set Winlibs version
+        id: winlibs-version
+        shell: pwsh
+        run: |
+          $winlibs_asset_name = 
"winlibs-x86_64-posix-seh-gcc-15.2.0-mingw-w64ucrt-13.0.0-r4.7z"
+          echo "winlibs_asset_name=$winlibs_asset_name" >> $env:GITHUB_OUTPUT
+
+      - name: Cache Winlibs
+        id: cache-winlibs
+        uses: actions/cache@v5
+        with:
+          path: ${{ runner.temp }}/winlibs
+          key: winlibs-${{ steps.winlibs-version.outputs.winlibs_asset_name }}
+
+      - name: Download and setup Winlibs
+        if: steps.cache-winlibs.outputs.cache-hit != 'true'
+        shell: pwsh
+        run: |
+          $base_url = 
"https://github.com/brechtsanders/winlibs_mingw/releases/download/15.2.0posix-13.0.0-ucrt-r4/";
+          $asset_name = "${{ steps.winlibs-version.outputs.winlibs_asset_name 
}}"
+          $hash_expected = 
"148175f2ba3c4ab0bfd93116b75f7ff172e9e0d06ca8680c8a98c375ec45abb5"
+          $url = $base_url + $asset_name
+
+          Write-Host "Downloading $asset_name..."
+          Invoke-WebRequest -Uri $url -OutFile $asset_name -UseBasicParsing
+
+          Write-Host "Verifying hash..."
+          $hash_actual = (Get-FileHash -Path $asset_name -Algorithm 
SHA256).Hash.ToLower()
+          if ($hash_actual -ne $hash_expected) {
+            throw "SHA256 mismatch! Expected: $hash_expected, Got: 
$hash_actual"
+          }
+
+          Write-Host "Extracting..."
+          7z x $asset_name -o"${{ runner.temp }}/winlibs" -y
+          Remove-Item $asset_name -Force
+
+      - name: Add Winlibs to PATH
+        shell: pwsh
+        run: |
+          $winlibsMingwBin = Join-Path "${{ runner.temp }}" 
"winlibs\mingw64\bin"
+          $env:PATH="$winlibsMingwBin;${env:PATH}"
+          echo "PATH=$env:PATH" >> $env:GITHUB_ENV

Review Comment:
   
https://github.com/apache/arrow-adbc/pull/2858/changes/a6dbf1da90af410c49c0aa6f4c3835bbcda4491a
 is the related commit, right?
   
   `GITHUB_PATH` is used after the next step. So `which gcc` in the same step 
doesn't work.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to