Closed dennisroche closed 6 years ago
@dennisroche hmm, I am not able to reproduce this issue...
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.102.0\tasks\Cake\0.1.7\Cake.ps1
Creating tools directory...
Installing Cake...
Installing 'Cake 0.14.0'.
Successfully installed 'Cake 0.14.0'.
C:\a\1\s\Build\tools\Cake\Cake.exe "C:\a\1\s\Build\build.cake" -target="Default" -verbosity="Diagnostic" --paths_tools="C:\a\1\s\Build\tools" --BuildScriptsDirectory="C:\Development\VSTS\Build" --OutputDirectory="C:\a\1\a" --MajVer=11 --MinVer=12 --Patch=13
Module directory does not exist.
Analyzing build script...
Analyzing C:/a/1/s/Build/build.cake...
Processing build script...
Installing tools...
Installing NuGet package NUnit.ConsoleRunner...
Executing: "C:/a/1/s/Build/tools/nuget.exe" install "NUnit.ConsoleRunner" -OutputDirectory "C:/a/1/s/Build/tools" -Version "3.2.1" -ExcludeVersion -NonInteractive -NoCache
Installing NuGet package GitVersion.CommandLine...
Executing: "C:/a/1/s/Build/tools/nuget.exe" install "GitVersion.CommandLine" -OutputDirectory "C:/a/1/s/Build/tools" -ExcludeVersion -NonInteractive -NoCache
Creating script session...
Downloading and installing Roslyn...
I am NOT using a nuget.config file, as the issue that you reference was actually closed in version 0.1.7.
Have you tried this without using a nuget.config file?
This is the project that I used for testing...
https://github.com/gep13/CakeVstsTest/blob/master/Build/build.cake
@gep13 thanks for taking the time to look at this
Removing the nuget.config
from the tools/
folder, results in
******************************************************************************
Starting task: Cake
******************************************************************************
Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\1.102.0\tasks\Cake\0.1.7\Cake.ps1
Restoring packages...
System.Management.Automation.RemoteException: Unable to find version '0.14.0' of package 'Cake'.
Installing Cake...
System.Management.Automation.RemoteException: Unable to find package 'Cake'.
System.Management.Automation.RuntimeException: Could not find Cake.exe at C:\a\1\s\tools\Cake\Cake.exe ---> System.Management.Automation.RuntimeException: Could not find Cake.exe at C:\a\1\s\tools\Cake\Cake.exe
--- End of inner exception stack trace ---
at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
at System.Management.Automation.PowerShell.Worker.ConstructPipelineAndDoWork(Runspace rs, Boolean performSyncInvoke)
at System.Management.Automation.PowerShell.Worker.CreateRunspaceIfNeededAndDoWork(Runspace rsToUse, Boolean isSync)
at System.Management.Automation.PowerShell.CoreInvokeHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
at Microsoft.TeamFoundation.DistributedTask.Handlers.PowerShellHandler.Execute(ITaskContext context, CancellationToken cancellationToken, Int32 timeoutInMinutes)
at Microsoft.TeamFoundation.DistributedTask.Worker.JobRunner.RunTask(ITaskContext context, TaskWrapper task, CancellationTokenSource tokenSource)
******************************************************************************
Finishing task: Cake
*****************************************************************************
I do have another nuget.config
in the root of the repository, next to the build.cake
.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- http://docs.nuget.org/consume/nuget-config-file -->
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
<add key="libs" value="https://dennisroche.pkgs.visualstudio.com/_packaging/libs/nuget/v3/index.json" />
</packageSources>
<bindingRedirects>
<add key="skip" value="True" />
</bindingRedirects>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
If I remove this nuget.config
, it then works on VSTS.
As I'm using a private nuget feed, I do need to have this root nuget.config
.
@devlead can you add anything to this one?
@dennisroche when you say you are using a private nuget feed, can you confirm for which part of the build process that is for?
the private feed is for our own nupkg's that developed internally - these are pulled in during the dotnet restore
. it shouldn't be impacting the build.cake
.
@dennisroche said... these are pulled in during the dotnet restore. it shouldn't be impacting the build.cake.
Agreed, I am not entirely clear on what is going on here.
For now, any reason to not set the sources on the DotNetCoreRestoreSettings class, as per this example:
http://cakebuild.net/api/cake.common.tools.dotnetcore/df2c8647/7df943ec
That would work on VSTS, however would break the tooling in VS2015, i.e. wouldn't be able to add update packages from our feed. I could ask the team to manually add the feed to VS2015.
I have a decent workaround using the build.ps1
, skipping the VSTS Cake extension.
@dennisroche said... I have a decent workaround using the build.ps1, skipping the VSTS Cake extension.
What workaround?
Running the bootstrap build.ps1
provided by Cake in PowerShell VSTS step.
What You Are Seeing?
An error when installing a tool when running
build.cake
via VSTS extension.Error: Cake.Core.CakeException: Failed to install tool 'GitVersion.CommandLine'.
What is Expected?
build.cake
to execute the same if executed using thebuild.ps1
bootstrapper. Usingbuild.ps1
on the build agent executes as expected.What version of Cake are you using?
Using
0.1.7
that was updated 25/06/2016 3:43:49 AMAre you running on a 32 or 64 bit system?
Using a hosted agent on VSTS which is Windows Server 2012 R2, 64-bit environment, with Windows PowerShell
What environment are you running on? Hosted? Custom?
Hosted.
How Did You Get This To Happen? (Steps to Reproduce)
https://gist.github.com/dennisroche/084eff333760f2bf473f7dff6746997d
The above gist has the
build.cake
and the contents of thetools\**
. I've using anuget.config
file to workaround the issue https://github.com/cake-build/cake-vso/issues/5.Remember, this works it using the
build.ps1
bootstrapper.Output Log