Fix extraction of Xamarin.Build.Download
Fix #1047
Before fix:
https://github.com/user-attachments/assets/7fd28774-bfd8-4af3-86eb-31dd23a57be8
After fix:
Yes, a new folder will be created every time, but I will definitely reproduce this
It has been staying in Extracting
テスト プロジェクトのビルド ========== テストの実行を開始しています ========== [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.5+1caef2f33e (64-bit .NET 9.0.0) [xUnit.net 00:00:00.46] Starting: Xamarin.Build.Download.Tests Build started. Project "project.csproj" (_XamarinBuildDownload target(s)): Target "_XamarinBuildAddDownloadedItems" in file "D:\practice\android-libraries\util\Xamarin.Build.Download\source\Xamarin.Build.Download.Tests\bin\Release\net9.0\Xamarin.Build.Download.targets" from project "C:\Users\wangyk\AppData\Local\Temp\tmpavnnef.tmp\project.csproj" (target "_XamarinBuildDownload" depends on it): Done building target "_XamarinBuildAddDownloadedItems" in project "project.csproj". Target "_XamarinBuildDownloadCore" in file "D:\practice\android-libraries\util\Xamarin.Build.Download\source\Xamarin.Build.Download.Tests\bin\Release\net9.0\Xamarin.Build.Download.targets" from project "C:\Users\wangyk\AppData\Local\Temp\tmpavnnef.tmp\project.csproj" (target "_XamarinBuildDownload" depends on it): The ".overridetasks" files could not be successfully loaded from their expected location "D:\practice\android-libraries\util\Xamarin.Build.Download\source\Xamarin.Build.Download.Tests\bin\Release\net9.0". Default tasks will not be overridden. The ".tasks" files could not be successfully loaded from their expected location "D:\practice\android-libraries\util\Xamarin.Build.Download\source\Xamarin.Build.Download.Tests\bin\Release\net9.0". Default tasks will not be available. Using "XamarinDownloadArchives" task from assembly "D:\practice\android-libraries\util\Xamarin.Build.Download\source\Xamarin.Build.Download.Tests\bin\Release\net9.0\Xamarin.Build.Download.dll". Task "XamarinDownloadArchives" D:\Program Files\7-Zip C:\Program Files\Microsoft Visual Studio\2022\Enterprise
Downloading https://dl.google.com/firebase/ios/analytics/4d5ec9a36b6d4fd4/GoogleAppMeasurement-10.28.0.tar.gz to C:\Users\wangyk\AppData\Local\Temp\tmpavnnef.tmp\unpacked\GAppM-10.28.0.tgz (2271/10038515b), total 0.0% (1004512/10038515b), total 10.0% (2015232/10038515b), total 20.0% (3014640/10038515b), total 30.0% (4030448/10038515b), total 40.0% (5029856/10038515b), total 50.0% (6029280/10038515b), total 60.0% (7028688/10038515b), total 70.0% (8044496/10038515b), total 80.0% (9043904/10038515b), total 90.0% (10038515/10038515b), total 100.0% Downloading Complete Extracting C:\Users\wangyk\AppData\Local\Temp\tmpavnnef.tmp\unpacked\GAppM-10.28.0.tgz to C:\Users\wangyk\AppData\Local\Temp\tmpavnnef.tmp\unpacked\GAppM-10.28.0
The only difference is that I set the compilation environment to net9
It is not a download, but a decompression problem of GAppM-10.28.0
It is not a download, but a decompression problem of GAppM-10.28.0
Sure, but I still don't understand what the root issue is.
When we decompress GAppM-10.28.0, why do the file(s) already exist?
- If this is the first time it is running, then the folder should be empty and there won't be any existing files.
- If this is the second time it is running, it should have detected that the file(s) already exist and it shouldn't be downloading or extracting them again.
Perhaps another way to explore this:
- Does the
TestGMapsDownloadtest fail for you as well without this change? - If not, why does it succeed but
TestGoogleAppMeasurementDownloadhangs? They are exactly the same test but with a different.tar.gzfile, so what makesGoogleAppMeasurement-10.28.0.tar.gzhang whilec0e534927c0c955e-GoogleMaps-1.11.1.tar.gzsucceeds?
In fact, tar.gz performs two extractions. The first extraction is successful, but during the second extraction, a confirmation about the existence of the file will appear.
The first extraction:
psi| 名前 | 値 | 種類 | |
|---|---|---|---|
| ◢ | psi | FileName = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\7-Zip\7z.exe",Arguments = "e "-oC:\Users\wangyk\AppData\Local\Temp\tmpp0glvd.tmp\unpacked\GAppM-10.28.0" "C:\Users\wangyk\AppData\Local\Temp\tmpp0glvd.tmp\unpacked\GAppM-10.28.0.tgz"", WorkingDirectory = "" | System.Diagnostics.ProcessStartInfo |
The next extraction:
psi| 名前 | 値 | 種類 | |
|---|---|---|---|
| ◢ | psi | FileName = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\7-Zip\7z.exe", Arguments = "x -snl- "-oC:\Users\wangyk\AppData\Local\Temp\tmpp0glvd.tmp\unpacked\GAppM-10.28.0" "C:\Users\wangyk\AppData\Local\Temp\tmpp0glvd.tmp\unpacked\GAppM-10.28.0\GAppM-10.28.0.tar"", WorkingDirectory = "" | System.Diagnostics.ProcessStartInfo |
Now that we have obtained the execution parameters for the two decompressions, try to execute them in PowerShell
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\7-Zip\7z.exe" e "-oD:\Test\GAppM-10.28.0" "D:\Test\GAppM-10.28.0.tgz"
PS D:\Test> & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\7-Zip\7z.exe" e "-oD:\Test\GAppM-10.28.0" "D:\Test\GAppM-10.28.0.tgz"
7-Zip 18.05 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30
Scanning the drive for archives:
1 file, 10038515 bytes (9804 KiB)
Extracting archive: D:\Test\GAppM-10.28.0.tgz
--
Path = D:\Test\GAppM-10.28.0.tgz
Type = gzip
Headers Size = 10
Everything is Ok
Size: 40711680
Compressed: 10038515
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\7-Zip\7z.exe" x -snl- "-oD:\Test\GAppM-10.28.0" "D:\Test\GAppM-10.28.0\GAppM-10.28.0.tar"
PS D:\Test> & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\Extensions\Xamarin.VisualStudio\7-Zip\7z.exe" x -snl- "-oD:\Test\GAppM-10.28.0" "D:\Test\GAppM-10.28.0\GAppM-10.28.0.tar"
7-Zip 18.05 (x86) : Copyright (c) 1999-2018 Igor Pavlov : 2018-04-30
Scanning the drive for archives:
1 file, 40711680 bytes (39 MiB)
Extracting archive: D:\Test\GAppM-10.28.0\GAppM-10.28.0.tar
WARNINGS:
Headers Error
--
Path = D:\Test\GAppM-10.28.0\GAppM-10.28.0.tar
Type = tar
WARNINGS:
Headers Error
Physical Size = 40711680
Headers Size = 124416
Code Page = UTF-8
Would you like to replace the existing file:
Path: D:\Test\GAppM-10.28.0\GoogleAppMeasurement-10.28.0\Frameworks\GoogleAppMeasurementIdentitySupport.xcframework\ios-arm64_x86_64-maccatalyst\GoogleAppMeasurementIdentitySupport.framework\PaxHeader\GoogleAppMeasurementIdentitySupport
Size: 44 bytes (1 KiB)
Modified: 2024-06-11 03:14:30
with the file from archive:
Path: .\GoogleAppMeasurement-10.28.0\Frameworks\GoogleAppMeasurementIdentitySupport.xcframework\ios-arm64_x86_64-maccatalyst\GoogleAppMeasurementIdentitySupport.framework\PaxHeader\GoogleAppMeasurementIdentitySupport
Size: 14 bytes (1 KiB)
Modified: 2024-06-11 03:11:10
? (Y)es / (N)o / (A)lways / (S)kip all / A(u)to rename all / (Q)uit?
When extracting GAppM-10.28.0.tgz and GAppM-10.28.0.tar, it prompts whether to overwrite because they contain files with the same name.
Is this a problem unique to GAppM-10.28.0?