Linux/UNIX build for NuGet.CommandLine #10603
Replies: 1 comment 2 replies
-
@YakoYakoYokuYoku Have you tried using the Unfortunately self-contained .NET Core apps are not a direct replacement for ILMerged .NET Framework apps. .NET Core apps, during the publish step, need to select a runtime identifier (RID). This makes the publish output specific to Windows, Linux or Mac, and therefore a single executable is no longer compatible with all platforms like a .NET Framework assembly is thanks to mono. Hence, I advocate to make NuGet's features in the dotnet CLI a superset of nuget.exe, and then we can make nuget.exe obsolete. There are still some gaps, but if customers give us feedback about which commands are most important to them, we can prioritize the most requested commands. |
Beta Was this translation helpful? Give feedback.
-
Long ago the
nuget
CLI could be built using Monoxbuild
. But as time passed andxbuild
wasn't making the cut and it was trimmed off the repository while leaving no documented way of building it for Linux or UNIX-like distros.Time has passed since with no news about it until recently. Back in February of the past year I published a patch in the Solus Phabricator that updated it to a much newer version of NuGet (latest version of the package was
2.11
, still supportingxbuild
). Although I haven't updated it since then because of failing builds withmono-msbuild
, I'll now explain how I've built version5.10.0.7131
.Basically the steps are:
build/bootstrap.proj
andsrc/NuGet.Clients/NuGet.CommandLine.csproj
.dotnet
src/NuGet.Clients/NuGet.CommandLine.csproj
with theSkipILMergeOfNuGetExe
property set totrue
.NuGet.exe
and its*.dll
dependencies and install it to the proper dir or...dotnet publish -o <your output path>
.Microsoft.VisualStudio.Setup.Configuration.Interop.dll
to avoid licensing issues.mono
runsNuGet.exe
as intended although I couldn't find the way to do it withdotnet
yet.As an alternative to
ilmerge.exe
(as it uses native Windows libs) I'd suggest to produce self-contained applications.Beta Was this translation helpful? Give feedback.
All reactions