Buddy Build: Resyncing Fails

Mar 3, 2009 at 10:24 PM
Below is the section from the build log that is failing. The unshelving is working fine, but I have yet to get BuddyBuild to work. It appears that BuddyBuild is not properly formatting the get command from the log below. I can run the following from the command prompt on the server without error: "e:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\tf.exe" get  /version:C72438 /recursive /noprompt"

Any thoughts on how I can resolve this issue would be greatly appreciated. Thanks.

Build Log:
  BuildStep TeamFoundationServerUrl="http://pgesf4:8080/" BuildUri="vstfs:///Build/Build/1370" ID="-1" Message="Buddy Build: Resyncing sources after unshelving." Status="InProgress"
  Resyncing after unshelve using TF.EXE at: '"e:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\tf.exe"'.
  '""e:\Program' is not recognized as an internal or external command,
  operable program or batch file.
  The command """e:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\tf.exe"" get  /version:C72438 /recursive /noprompt" exited with code 9009.
  Resync failed (tf get exit code: 9009).
  BuildStep TeamFoundationServerUrl="http://pgesf4:8080/" BuildUri="vstfs:///Build/Build/1370" ID="4725157" Status="Failed"
  Updating buddy build work item with resolution=Rejected (failed auto resolve).
  Skipping updating buddy build work item (failed auto resolve): SkipUpdateBuddyBuildWorkItem = true.
  Skipping updating buddy build work item (failed auto resolve): Provided work item is blank or '0'.
C:\Program Files\MSBuild\Microsoft\VisualStudio\TeamBuild\BuddyBuildExtensions.targets(517,9): error : Resolving conflicts failed (exit code: 9009). Updated buddy build work item with resolution=Rejected (failed auto resolve).
Done Building Project "e:\a\8\BuildType\TFSBuild.proj" (EndToEndIteration target(s)) -- FAILED.
Mar 3, 2009 at 11:03 PM
From the log, it seems that the value of the <TfCommand> property in the BuddyBuildExtensions.targets file has changed. The default value looks like this: <TfCommand>$(TeamBuildRefPath)\..\tf.exe</TfCommand>.
In your case, it looks like the value got changed to the following:
<TfCommand>"e:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\tf.exe"</TfCommand>

If that is the case, I suggest removing the quotation marks surrounding the path. They will be applied in the script where appropriate, and they need not be specified in the path defined in the TfCommand property.

I will add a comment above the property in the next version so that others will not make the same mistake.

Sorry for the inconvenience and wasted time this has caused you. Hopefully, you will get the buddy build working for you after you make the change. Please let us know if that does not work.
Mar 4, 2009 at 1:30 PM
Thanks. Although the issue wasn't exactly where you directed me to in the targets file, your comment did help me fix the issue. I had not altered the BuddyBuildExtensions.targets file. After installation it had several of the the Exec Command statements set like this:
        <Exec Command="&quot;$(TfCommand)&quot; get $(GetFilespec) /version:$(GetVersion) /recursive /noprompt"
              IgnoreExitCode="true" >
            <Output PropertyName="ResolveExitCode"
              TaskParameter="ExitCode" />

I changed the &quot;$(TfCommand)&quot; to just $(TfCommand).

This seems to have gotten me by this problem.
Mar 4, 2009 at 5:15 PM
This is great news. I'm glad you are unblocked. I was trying to avoid making changes as you've done, as this does not expose the root cause of the issue and it will become an issue again when a new version of the script is released. You don't want to keep editing the file...
The path with embedded spaces should work fine. Do you know if by any chance your Team Build script (TfsBuild.proj or any scripts it might include) sets a property with the same name, i.e. TfCommand?
Mar 4, 2009 at 6:29 PM
Good point, I don't want to create extra maintenance down the road. Thanks for your help.

Our build script does set TfCommand: <TfCommand>&quot;e:\Program Files\Microsoft Visual Studio 9.0\Common7\ide\tf.exe&quot;</TfCommand>. So maybe removing the quotes there would have fixed the issue? I need to speak with the original developer of that script before trying that to make sure there wasn't a specific reason for have quotes around it.
Mar 4, 2009 at 7:25 PM
I checked with the original developer and we were able to remove the TfCommand completely from our build file. So I rolled back my changes to the BuddyBuildExtensions.targets file and it appears to be functioning fine now.
Mar 4, 2009 at 8:17 PM
Very cool! Please let us know if you run into any issues or have any feedback for us regarding your experience using the tool and ways to improve it.