@@ -241,12 +241,24 @@ jobs:
241241 # Dynamically find dist-info folder
242242 DIST_INFO=$(ls -d pygpukit-*.dist-info | head -1)
243243 echo "Found dist-info folder: $DIST_INFO"
244- find pygpukit -type f | while read f; do
245- hash=$(python -c "import hashlib, base64; print('sha256=' + base64.urlsafe_b64encode(hashlib.sha256(open('$f', 'rb').read()).digest()).rstrip(b'=').decode())")
246- size=$(stat -c%s "$f")
247- echo "$f,$hash,$size"
248- done > "$DIST_INFO/RECORD"
249- echo "$DIST_INFO/RECORD,," >> "$DIST_INFO/RECORD"
244+
245+ # Generate RECORD with ALL files (pygpukit/ + dist-info/)
246+ {
247+ # All files in pygpukit/
248+ find pygpukit -type f | while read f; do
249+ hash=$(python -c "import hashlib, base64; print('sha256=' + base64.urlsafe_b64encode(hashlib.sha256(open('$f', 'rb').read()).digest()).rstrip(b'=').decode())")
250+ size=$(stat -c%s "$f")
251+ echo "$f,$hash,$size"
252+ done
253+ # All files in dist-info/ except RECORD
254+ find "$DIST_INFO" -type f ! -name RECORD | while read f; do
255+ hash=$(python -c "import hashlib, base64; print('sha256=' + base64.urlsafe_b64encode(hashlib.sha256(open('$f', 'rb').read()).digest()).rstrip(b'=').decode())")
256+ size=$(stat -c%s "$f")
257+ echo "$f,$hash,$size"
258+ done
259+ # RECORD itself (no hash)
260+ echo "$DIST_INFO/RECORD,,"
261+ } > "$DIST_INFO/RECORD"
250262
251263 # Repack wheel
252264 cd ..
@@ -558,16 +570,20 @@ jobs:
558570 $distInfoName = $distInfo.Name
559571 Write-Host "Found dist-info folder: $distInfoName"
560572 $recordPath = "wheel-contents/$distInfoName/RECORD"
573+ $wheelContentsPath = (Resolve-Path "wheel-contents").Path
561574 $newRecord = @()
562- Get-ChildItem wheel-contents/pygpukit -File | ForEach-Object {
563- $relativePath = "pygpukit/$($_.Name)"
575+
576+ # All files in pygpukit/ (recursive)
577+ Get-ChildItem wheel-contents/pygpukit -File -Recurse | ForEach-Object {
578+ $relativePath = $_.FullName.Substring($wheelContentsPath.Length + 1).Replace('\', '/')
564579 $bytes = [System.IO.File]::ReadAllBytes($_.FullName)
565580 $hash = [System.Security.Cryptography.SHA256]::Create().ComputeHash($bytes)
566581 $hashB64 = [Convert]::ToBase64String($hash).TrimEnd('=').Replace('+', '-').Replace('/', '_')
567582 $size = $_.Length
568583 $newRecord += "$relativePath,sha256=$hashB64,$size"
569584 }
570- # Add dist-info files
585+
586+ # All files in dist-info/ except RECORD
571587 Get-ChildItem "wheel-contents/$distInfoName" -File | Where-Object { $_.Name -ne "RECORD" } | ForEach-Object {
572588 $relativePath = "$distInfoName/$($_.Name)"
573589 $bytes = [System.IO.File]::ReadAllBytes($_.FullName)
@@ -576,8 +592,13 @@ jobs:
576592 $size = $_.Length
577593 $newRecord += "$relativePath,sha256=$hashB64,$size"
578594 }
595+
596+ # RECORD itself (no hash)
579597 $newRecord += "$distInfoName/RECORD,,"
580- $newRecord | Out-File -FilePath $recordPath -Encoding utf8NoBOM
598+
599+ # Write with Unix line endings (LF only)
600+ $newRecord -join "`n" | Set-Content -Path $recordPath -NoNewline -Encoding utf8NoBOM
601+ Add-Content -Path $recordPath -Value "" -NoNewline -Encoding utf8NoBOM
581602
582603 # Repack wheel
583604 Remove-Item $wheel.FullName
0 commit comments