Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.0 Squirrel.exe seems to return a -1 to the console #204

Closed
dealproc opened this issue Jan 27, 2015 · 16 comments
Closed

0.8.0 Squirrel.exe seems to return a -1 to the console #204

dealproc opened this issue Jan 27, 2015 · 16 comments

Comments

@dealproc
Copy link

During a build, the Squirrel.exe application during a -releaseify run seems to be returning a -1 to the console, which is causing TeamCity/MSBuild to call the execution a failure.

Is there/was there a change to -releaseify= that is causing this -1 to be kicked to the console?

Console Output (From TeamCity)

[20:41:08][MSBuild output]   C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4429,5): error MSB3073: The command " [C:\TeamCity\buildAgent\work\98d761d7fb411ae2\source\ClientApp.WinHost\ClientApp.WinHost.csproj]
[20:41:08][MSBuild output] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4429,5): error MSB3073:       C:\TeamCity\buildAgent\work\98d761d7fb411ae2\.nuget\nuget.exe pack C:\TeamCity\buildAgent\work\98d761d7fb411ae2\source\ClientApp.WinHost\ClientApp.WinHost.nuspec -Prop Configuration=Release -Version 0.0.103.0 -OutputDirectory C:\TeamCity\buildAgent\work\98d761d7fb411ae2\package [C:\TeamCity\buildAgent\work\98d761d7fb411ae2\source\ClientApp.WinHost\ClientApp.WinHost.csproj]
[20:41:08][MSBuild output] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(4429,5): error MSB3073:       C:\TeamCity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools\squirrel.exe -releasify=C:\TeamCity\buildAgent\work\98d761d7fb411ae2\package\ClientApp.0.0.103.0.nupkg --releaseDir=C:\TeamCity\buildAgent\work\98d761d7fb411ae2\releases\ClientApp\" exited with code -1. [C:\TeamCity\buildAgent\work\98d761d7fb411ae2\source\ClientApp.WinHost\ClientApp.WinHost.csproj]

Maybe I did something incorrectly on the update to 0.8.0, but i feel as if this is something new in Squirrel.Windows 0.8.0

@anaisbetts
Copy link
Contributor

Squirrel.exe's exit code should only be non-zero if an exception was thrown, check the SquirrelSetup.log file that got generated (it's right next to Squirrel.exe as I recall)

@dealproc
Copy link
Author

Seems to only be happening on the build server(s)... I have a production build server, and one I was using for experiments... Both TeamCity, both 9.0.1....

The SquirrelSetup.log file contains:

Program: Starting Squirrel Updater: -releasify=C:\TeamCity\buildAgent\work\98d761d7fb411ae2\package\ClientApp.WinHost.0.0.110.0.nupkg --releaseDir=C:\TeamCity\buildAgent\work\98d761d7fb411ae2\releases\ClientApp\
Program: Bootstrapper EXE found at:C:\TeamCity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools\Setup.exe
Program: Creating release package: C:\TeamCity\buildAgent\work\98d761d7fb411ae2\releases\ClientApp\ClientApp.WinHost.0.0.110.0.nupkg
ReleasePackage: Creating release package: C:\TeamCity\buildAgent\work\98d761d7fb411ae2\releases\ClientApp\ClientApp.WinHost.0.0.110.0.nupkg => C:\TeamCity\buildAgent\work\98d761d7fb411ae2\releases\ClientApp\clientapp.winhost-0.0.110.0-full.nupkg
ReleasePackage: Extracting dependent packages: []
ReleasePackage: Removing unnecessary data
ReleasePackage: No release notes found in C:\TeamCity\buildAgent\temp\buildTmp\a\clientapp.winhost.nuspec
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\lib
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\lib\net45
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\package
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\package\services
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\package\services\metadata
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\package\services\metadata\core-properties
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a\_rels
Program: Building embedded zip file for Setup.exe
Utility: Starting to delete folder: C:\TeamCity\buildAgent\temp\buildTmp\a

No errors... so confusing why this is throwing a -1. If I build the same project on my dev machine, it works as expected. Both Servers are Server 2012 R2, and my development machine is Windows 8.1

Should I not be executing the pack as a PostBuild of my WPF app project's build process?

@anaisbetts
Copy link
Contributor

Should I not be executing the pack as a PostBuild of my WPF app project's build process?

That should be fine. Are you sure you're capturing stdout / stderr from Squirrel? I feel like an exception should show up in either there or the SquirrelSetup.log file

@dealproc
Copy link
Author

Agreed. What you're seeing is what is in the log file and what came out of MSBuild during the build operation.

I'm going to see if i can run msbuild on the build server, and see if that brings further clues.

Maybe a MSBuild extension for this tool?

@dealproc
Copy link
Author

a bit more details:

  Attempting to build package from 'ClientApp.WinHost.nuspec'.
  Successfully created package 'C:\teamcity\buildAgent\work\98d761d7fb411ae2\package\clientapp.winhost.1.0.0.0.nupkg'.
  System.AggregateException: One or more errors occurred. ---> System.Exception: Failed to modify resources, command in
  voked was: 'C:\teamcity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools\rcedit.exe "C:\teamcit
  y\buildAgent\work\98d761d7fb411ae2\releases\ClientApp\Setup.exe" --set-version-string "CompanyName" "Richard A. Benne
  tt" --set-version-string "FileDescription" "demo of a client app package" --set-version-string "ProductName" "demo of
   a client app package" --set-file-version 1.0.0.0 --set-product-version 1.0.0.0'
     at Squirrel.Update.Program.<setPEVersionInfoAndIcon>d__95.MoveNext()
     --- End of inner exception stack trace ---
     at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
     at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
     at System.Threading.Tasks.Task.Wait()
     at Squirrel.Update.Program.Releasify(String package, String targetDir, String packagesDir, String bootstrapperExe,
   String backgroundGif, String signingOpts, String baseUrl, String setupIcon)
     at Squirrel.Update.Program.main(String[] args)
     at Squirrel.Update.Program.Main(String[] args)
  ---> (Inner Exception #0) System.Exception: Failed to modify resources, command invoked was: 'C:\teamcity\buildAgent\
  work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools\rcedit.exe "C:\teamcity\buildAgent\work\98d761d7fb411ae2\
  releases\ClientApp\Setup.exe" --set-version-string "CompanyName" "Richard A. Bennett" --set-version-string "FileDescr
  iption" "demo of a client app package" --set-version-string "ProductName" "demo of a client app package" --set-file-v
  ersion 1.0.0.0 --set-product-version 1.0.0.0'
     at Squirrel.Update.Program.<setPEVersionInfoAndIcon>d__95.MoveNext()<---

@anaisbetts
Copy link
Contributor

@dealproc Does that path exist? C:\teamcity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools\rcedit.exe

@dealproc
Copy link
Author

Seems to:

PS C:\teamcity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools> dir


    Directory: C:\teamcity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         1/26/2015   9:51 PM      53248 rcedit.exe
-a---         1/26/2015   9:51 PM     193536 Setup.exe
-a---         1/26/2015   9:51 PM     237392 signtool.exe
-a---         1/26/2015   9:51 PM       7680 Squirrel.com
-a---         1/26/2015   9:51 PM    1479680 Squirrel.exe
-a---         1/27/2015   9:36 AM       6110 SquirrelSetup.log
-a---         1/26/2015   9:51 PM    1762816 SyncGitHubReleases.exe


PS C:\teamcity\buildAgent\work\98d761d7fb411ae2\packages\squirrel.windows.0.8.0\tools>

@anaisbetts
Copy link
Contributor

@dealproc Can you run the rcedit command that it was trying to run and see what the output is? I've never heard of rcedit failing, it's super simple and dumb

@flagbug
Copy link
Member

flagbug commented Jan 27, 2015

Interesting, I'm also seeing this in my AppVeyor builds: https://ci.appveyor.com/project/flagbug/espera/build/2.12.504.2

Running the script locally works fine though

@dealproc
Copy link
Author

nothing, completely blank screen. no help text either.

@anaisbetts
Copy link
Contributor

@flagbug What happens when you remove the quotes from "party mode"?

@flagbug
Copy link
Member

flagbug commented Jan 27, 2015

@paulcbetts Yup, works now, thanks!

@dealproc
Copy link
Author

So still not convinced it's not something with Squirrel.Windows. I rolled back to 0.7.2 and it compiles fine both on a developer box, and on a build server... Rolled forward again to 0.8.0, and running into the same issue on the build server.

If you like, the repository is available here to work with:
https://github.com/dealproc/squirrel-poc/commits/develop

@anaisbetts
Copy link
Contributor

So still not convinced it's not something with Squirrel.Windows.

This is definitely a bug in Squirrel.Windows, it can just be worked around sometimes. Basically, we're building a command via string concatenation and that can fall over sometimes. What I don't understand is why this only happens to you on a build server

@dealproc
Copy link
Author

Yea, agreed. That's why i have a demo project that I'm experimenting with on this before I upgrade the main project, and why I offered you a solution to test.

I'm running this on a stock Server 2012 R2 Datacenter... This is what I have installed on the system...

  • JetBrains TeamCity 9.0.1
  • Microsoft Build Tools 2013
  • Octopus Deploy Server
  • Octopus Deploy Tentacle

If there's anything I can do in order to help you reproduce the issue, so that you can better see what's happening in your code, let me know, and I'll be happy to oblige.

@anaisbetts
Copy link
Contributor

0.8.2 should fix this issue, reopen it if you see it again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants