How to build on Linux?
Jfk-re opened this issue · comments
Hello,
I'm trying to build Reko on Debian Bullseye. I have .NET SDK 5.0 installed.
I have been trying to build Reko according to the docs with:
msbuild /p:Configuration=UnixRelease /p:Platform=x64 src/Reko-decompiler.sln
(.NET 5 on Linux doesn't seem to include msbuild, so msbuild from Mono is used)
That results in a long list of missing dependencies:
Project "/home/ghidra/reko/src/Reko-decompiler.sln" (1) is building "/home/ghidra/reko/src/Core/Core.csproj" (2) on node 1 (default targets). /usr/lib/mono/msbuild/Current/bin/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(234,5): error NETSDK1004: Assets file '/home/ghidra/reko/src/Core/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/home/ghidra/reko/src/Core/Core.csproj] Done Building Project "/home/ghidra/reko/src/Core/Core.csproj" (default targets) -- FAILED.
Project "/home/ghidra/reko/src/Reko-decompiler.sln" (1) is building "/home/ghidra/reko/src/Decompiler/Decompiler.csproj" (3) on node 1 (default targets). /usr/lib/mono/msbuild/Current/bin/Sdks/Microsoft.NET.Sdk/targets/Microsoft.PackageDependencyResolution.targets(234,5): error NETSDK1004: Assets file '/home/ghidra/reko/src/Decompiler/obj/project.assets.json' not found. Run a NuGet package restore to generate this file. [/home/ghidra/reko/src/Decompiler/Decompiler.csproj] Done Building Project "/home/ghidra/reko/src/Decompiler/Decompiler.csproj" (default targets) -- FAILED.
...
(110 errors in total)
I subsequently tried to build using 'dotnet build' from .NET 5:
dotnet build --configuration UnixRelease src/Reko-decompiler.sln
Now, I'm getting errors that build is only supported on Windows:
Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.
/home/ghidra/reko/src/Installers/WixInstaller/WixInstaller.wixproj : warning NU1503: Skipping restore for project '/home/ghidra/reko/src/Installers/WixInstaller/WixInstaller.wixproj'. The project file may be invalid or missing targets required for restore. [/home/ghidra/reko/src/Reko-decompiler.sln]
Determining projects to restore...
/usr/share/dotnet/sdk/5.0.404/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications.
[/home/ghidra/reko/src/Arch/X86.Design/X86.Design.csproj]
/usr/share/dotnet/sdk/5.0.404/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications.
[/home/ghidra/reko/src/Arch/M68k.Design/M68k.Design.csproj]
/usr/share/dotnet/sdk/5.0.404/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(89,5): error NETSDK1100: Windows is required to build Windows desktop applications.
[/home/ghidra/reko/src/Environments/Msdos.Design/Msdos.Design.csproj]
...
(and so on)
As I'm not particularly experienced with building .NET projects, could anyone point me in the right direction as to how to build reko on Linux?
Thanks in advance!
Strange that msbuild didn't do a restore
for you. You can try issuing the dotnet restore
command in the src
directory before issuing the msbuild
command. Let me know if that helps.
Closed due to no activity.