TeamCity build step fails during Squirrel releasify while creating delta package
See original GitHub issueI have a .NET 5.0 project which uses the Clowd.Squirrel package (2.7.79-pre at the time of writing).
I use a powershell command to releasify my NuGet package of the project. It works perfectly when used directly from a powershell window (paths and names are simplified here, but otherwise the same command):
& "C:\Program Files\Clowd.Squirrel\Squirrel.exe" releasify --releaseDir "C:\My Releases" --package "C:\My NuGet Packages\My_App.0.1.2.nupkg" --framework "net5" --splashImage "C:\My Resources\splash.png" --icon "C:\My Resources\logo.ico" --appIcon "C:\My Resources\logo.ico"
This creates all the necessary files, the setup works and the application updates correctly.
I use a TeamCity build pipeline to automate my release process. Using the previous command in a powershell build step yields the following messages:
Step 7/7: Clowd Squirrel Releasify (PowerShell) (6s)
[11:13:11][Step 7/7] PowerShell Executable: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
[11:13:11][Step 7/7] Working directory: C:\TeamCity\buildAgent\work\d720619d382a4b8a
[11:13:11][Step 7/7] Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
[11:13:11][Step 7/7] PowerShell arguments: -NoProfile, -NonInteractive, -ExecutionPolicy, ByPass, -File, C:\TeamCity\buildAgent\temp\buildTmp\powershell8389058061481115215.ps1
[11:13:12][Step 7/7] [INFO] SingleFileBundle: Extracting Update.exe resources to temp directory
[11:13:12][Step 7/7] [INFO] SingleFileBundle: Patching Update.exe icon
[11:13:13][Step 7/7]
[11:13:13][Step 7/7] [INFO] SingleFileBundle: Re-packing Update.exe bundle
[11:13:14][Step 7/7] [INFO] Program: Creating release package: C:\My Releases\My_App.0.1.2.nupkg
[11:13:14][Step 7/7] [INFO] ReleasePackage: Creating release package: C:\My Releases\My_App.0.1.2.nupkg => C:\My Releases\My_App-0.1.2-full.nupkg
[11:13:14][Step 7/7] [INFO] ReleasePackage: Removing unnecessary data
[11:13:15][Step 7/7] [INFO] Program: Creating stub executables
[11:13:15][Step 7/7] [INFO] Program: Using app icon from command line arguments
[11:13:15][Step 7/7] [INFO] EasyZip: Compressing 'C:\Windows\system32\config\systemprofile\AppData\Local\SquirrelClowdTemp\tempb' to 'C:\My Releases\My_App-0.1.2-full.nupkg'...
[11:13:17][Step 7/7] [INFO] DeltaPackageBuilder: Extracting C:\My Releases\My_App-0.1.1-full.nupkg and C:\My Releases\My_App-0.1.2-full.nupkg into C:\Windows\system32\config\systemprofile\AppData\Local\SquirrelClowdTemp\tempc
[11:13:17][Step 7/7] [INFO] EasyZip: Extracting 'C:\My Releases\My_App-0.1.1-full.nupkg' to 'C:\Windows\system32\config\systemprofile\AppData\Local\SquirrelClowdTemp\tempb'...
[11:13:17][Step 7/7] [INFO] EasyZip: Extracting 'C:\My Releases\My_App-0.1.2-full.nupkg' to 'C:\Windows\system32\config\systemprofile\AppData\Local\SquirrelClowdTemp\tempc'...
[11:13:17][Step 7/7]
[11:13:17][Step 7/7] [ERRO] System.InvalidOperationException: Sequence contains no matching element
[11:13:17][Step 7/7] at System.Linq.ThrowHelper.ThrowNoMatchException()
[11:13:17][Step 7/7] at Squirrel.DeltaPackageBuilder.CreateDeltaPackage(ReleasePackage basePackage, ReleasePackage newPackage, String outputFile) in ./Internal/DeltaPackage.cs:line 40
[11:13:17][Step 7/7] at SquirrelCli.Program.Releasify(ReleasifyOptions options) in ./Program.cs:line 258
[11:13:17][Step 7/7] at SquirrelCli.CommandAction`1.Execute(IEnumerable`1 args) in ./ValidatedOptionSet.cs:line 160
[11:13:17][Step 7/7] at SquirrelCli.CommandSet.Execute(String[] args) in ./ValidatedOptionSet.cs:line 194
[11:13:17][Step 7/7] at SquirrelCli.Program.Main(String[] args) in ./Program.cs:line 77
I have tried:
- Placing the command into a .ps1 file to run it in the build step (instead of pasting the command into TeamCity)
- Running Command Line to execute the same .ps1 file Both cases produced the same error.
Workaround: Adding the –noDelta flag skips the delta package building, where the build step otherwise fails. This works both “by hand” and “through TeamCity”. On the flip side, updating the application will always download the full package (since there or no deltas).
Personal findings: It seems that the DeltaPackageBuilder fails because the packages have wrong version numbers (based on source code). This was also evident when I checked the SquirrelClowdTemp temporary folders. One of the .nuspec files contained an earlier version number, while the newest one was nowhere to be found.
I don’t entirely understand the releasify process and I currently don’t have the time to dive into it so that’s why I opened this issue.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Scratch that, I will not be adding an additional cli parameter, but you can override the squirrel temporary directory already by creating the following environment variable:
CLOWD_SQUIRREL_TEMP
and setting it to a folder without filesystem virtualisation. (eg. not in the system32 folder)I can confirm that this indeed solved my issue. Thank you very much!