Replies: 3 comments 3 replies
|
NuGet.exe is a full framework executable and requires either .NET Framework on Windows or Mono on unix. .NET Core Global tools are executing under the .NET Core Runtime, which can run Full framework executables on Windows as Windows natively supports it. |
|
Right, I'm sure it works well on Windows. But using the .NET Core Global tool on Linux doesn't have the same benefit. |
|
@qayshp if they would make the NuGet.exe available as a .NET Tool it would be a lot easier as .NET tools provide a native shim. So those can easily just be made to work and be executed without the need for mono. All tools that are natively available on Linux will just work fine i.e. all the .NET CLI aliases, as there's a native dotnet binary made for each platform. We just released the .NET tool and will see where we can make the experience better, and we'll take contributions to do so. I.e. for the octopus deploy cli there's now a .NET tool and we've added that to the tool resolution so that will be available and just work with the next release of Cake. If the nuget.exe was made available as a .NET tool we could add that to the tool resolution here cake/src/Cake.Common/Tools/NuGet/NuGetTool.cs Lines 54 to 57 in 5e7716a |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What You Are Seeing?
When running Cake as a global dotnet tool (invoked as
dotnet cake build.cake {args}) with a script trying to useCake.Common.Tools.NuGet.NuGetAliases.NuGetList(ICakeContext, string)from Linux, we getSystem.ComponentModel.Win32Exception: Exec format error.From the stack trace this seems to be caused by the call to
Runfrom v0.30.0#Cake.Common.Tools.NuGet.NuGetList#L69-L70 which leads to v0.30.0#Cake.Core.Tooling.Tool#L90-L126.Unfortunately I'm not yet familiar enough with cake, so it's unclear to me if the executable name of
NuGet.exein this case is coming from v0.30.0#Cake.Common.Tools.NuGet.NuGetTool.cs or v0.30.0#Cake.Core.IO.NuGet.NuGetToolResolver.csWhat is Expected?
Cake.Common.Tools.NuGet.NuGetAliases.NuGetList(ICakeContext, string)to work, as expected from a build script on Linux when invoked using the Cake.Tool dotnet tool.Perhaps mistakenly, from the 0.30.0 blog post we had thought that mono might no longer be required for cake.
Doing a bit of mucking around with the
nuget.exewe've downloaded, I can get this to run by creating a shell script that executes nuget through mono and getting cake to use that.What version of Cake are you using?
0.30.0
Are you running on a 32 or 64 bit system?
64
What environment are you running on? Windows? Linux? Mac?
Linux and macOS
Are you running on a CI Server? If so, which one?
Yes, using Docker as part of an internal pipeline using gitlab and gitlab-ci.
How Did You Get This To Happen? (Steps to Reproduce)
I don't have a public repro of this issue at the moment, but can create one if needed.
Output Log
All reactions