mono / debugger-libs

Debugger libraries
MIT License
78 stars 73 forks source link

Trying to build debugger-libs as a dep of sdb #408

Open franciscod opened 4 days ago

franciscod commented 4 days ago

Hi. I'm trying to build https://github.com/mono/sdb which has debugger-libs as a submodule.

I get the following error:

/home/.../sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs(8,12): error CS0234: The type or namespace name 'Cecil' does not exist in the namespace 'Mono' (are you missing an assembly reference?) [/home/.../sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj]

Here's the command being run for the build: msbuild /nologo /property:Configuration=Debug /verbosity:quiet /r debugger-libs.sln

msbuild is at version 16.10.1.26701

I've tried adding Cecil via nuget but I didn't succeed. I don't have much experience developing things on the .NET ecosystem.

What can I do to get this to build? Any hints? Thanks in advance!

franciscod commented 4 days ago

The submodule on sdb's dep/debugger-libs points to a really old commit. I've updated to latest main and it's past the previous error!

Getting other errors now:

/nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to find package Microsoft.SymbolStore. No packages exist with this id in source(s): nuget.org [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to find package Microsoft.FileFormats. No packages exist with this id in source(s): nuget.org [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): warning : Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): warning : Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to find package Microsoft.SymbolStore. No packages exist with this id in source(s): nuget.org [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/lib/mono/msbuild/Current/bin/NuGet.targets(131,5): error : Unable to find package Microsoft.FileFormats. No packages exist with this id in source(s): nuget.org [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln]

franciscod commented 4 days ago

I've noticed that SymbolStore lived at this repo: https://github.com/dotnet/symstore

and also there's a NuGet.config which refers to something related:

<configuration>
    <config>
        <add key="repositoryPath" value="packages" />
        <add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
    </config>
</configuration>

I've tried nuget restore:

> nuget restore
This folder contains more than one solution file.
> nuget restore debugger-libs.sln
MSBuild auto-detection: using msbuild version '' from '/nix/store/jh2b4g269z8lzmqvkf76fnrr49if8zxn-msbuild-16.10.1+xamarinxplat.2021.05.26.14.00/bin'.
Error parsing solution file at /home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln: Invalid Image
  Invalid Image
franciscod commented 4 days ago

Shot in the dark, trying the nuget install manually:

> nuget install dotnet-tools -FallbackSource "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"
Feeds used:
  https://api.nuget.org/v3/index.json
  https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json

Installing package 'dotnet-tools' to '/home/fd/fd/git/sdb/dep/debugger-libs/packages'.
  GET https://api.nuget.org/v3/registration5-gz-semver2/dotnet-tools/index.json
  NotFound https://api.nuget.org/v3/registration5-gz-semver2/dotnet-tools/index.json 863ms
  GET https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/d1622942-d16f-48e5-bc83-96f4539e7601/nuget/v3/registrations2-semver2/dotnet-tools/index.json
  NotFound https://pkgs.dev.azure.com/dnceng/9ee6d478-d288-47f7-aacc-f6e6d082ae6d/_packaging/d1622942-d16f-48e5-bc83-96f4539e7601/nuget/v3/registrations2-semver2/dotnet-tools/index.json 197ms
Unable to find package 'dotnet-tools'
franciscod commented 4 days ago

This worked!

nuget install Microsoft.SymbolStore -FallbackSource "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"

But I got a newer incompatible version. I specified the version later:

nuget install Microsoft.SymbolStore -Version 1.0.411401 -FallbackSource "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json"

After installing, I retried the build and still got some errors, some saying that I'm using an old version of .NET. I guessed this might be related to using msbuild so I switched it to dotnet msbuild:

$ make cd dep/debugger-libs && dotnet msbuild /nologo /property:Configuration=Debug /verbosity:quiet /r debugger-libs.sln /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1603: Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj : warning NU1603: Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. [/home/fd/fd/git/sdb/dep/debugger-libs/debugger-libs.sln] /nix/store/fq0zjifrs44af3zpz16gf67mk2sx2f03-dotnet-sdk-6.0.422/sdk/6.0.422/Microsoft.Common.CurrentVersion.targets(1220,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/fd/fd/git/sdb/dep/debugger-libs/UnitTests/MonoDevelop.Debugger.Tests.AppDomainClient/MonoDevelop.Debugger.Tests.AppDomainClient.csproj] /nix/store/fq0zjifrs44af3zpz16gf67mk2sx2f03-dotnet-sdk-6.0.422/sdk/6.0.422/Microsoft.Common.CurrentVersion.targets(1220,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/fd/fd/git/sdb/dep/nrefactory/ICSharpCode.NRefactory/ICSharpCode.NRefactory.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj : warning NU1603: Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1603: Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging/Mono.Debugging.csproj : warning NU1603: Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs(261,13): warning CS0219: The variable 'typeInfo' is assigned but its value is never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs(262,8): warning CS0219: The variable 'methodIdxAsm' is assigned but its value is never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj : warning NU1603: Mono.Debugging depends on Microsoft.CodeAnalysis.CSharp (>= 4.5.0-1.22517.2) but Microsoft.CodeAnalysis.CSharp 4.5.0-1.22517.2 was not found. An approximate best match of Microsoft.CodeAnalysis.CSharp 4.5.0-2.final was resolved. /nix/store/fq0zjifrs44af3zpz16gf67mk2sx2f03-dotnet-sdk-6.0.422/sdk/6.0.422/Microsoft.Common.CurrentVersion.targets(1220,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/fd/fd/git/sdb/dep/nrefactory/ICSharpCode.NRefactory.CSharp/ICSharpCode.NRefactory.CSharp.csproj] /nix/store/fq0zjifrs44af3zpz16gf67mk2sx2f03-dotnet-sdk-6.0.422/sdk/6.0.422/Microsoft.Common.CurrentVersion.targets(1220,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/fd/fd/git/sdb/dep/debugger-libs/UnitTests/MonoDevelop.Debugger.Tests.NonUserCodeTestLib/MonoDevelop.Debugger.Tests.NonUserCodeTestLib.csproj] /nix/store/fq0zjifrs44af3zpz16gf67mk2sx2f03-dotnet-sdk-6.0.422/sdk/6.0.422/Microsoft.Common.CurrentVersion.targets(1220,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.5 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks [/home/fd/fd/git/sdb/dep/debugger-libs/UnitTests/MonoDevelop.Debugger.Tests.TestApp/MonoDevelop.Debugger.Tests.TestApp.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging/Mono.Debugging.Evaluation/RemoteFrameObject.cs(74,26): warning CS0809: Obsolete member 'RemoteFrameObject.InitializeLifetimeService()' overrides non-obsolete member 'MarshalByRefObject.InitializeLifetimeService()' [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging/Mono.Debugging.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/DataConverter.cs(466,10): warning SYSLIB0001: 'Encoding.UTF7' is obsolete: 'The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.' [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/DataConverter.cs(673,11): warning SYSLIB0001: 'Encoding.UTF7' is obsolete: 'The UTF-7 encoding is insecure and should not be used. Consider using UTF-8 instead.' [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs(261,13): warning CS0219: The variable 'typeInfo' is assigned but its value is never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft/AssemblyMirror.cs(262,8): warning CS0219: The variable 'methodIdxAsm' is assigned but its value is never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugger.Soft/Mono.Debugger.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs(1448,31): warning CS0168: The variable 'exc' is declared but never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs(2320,4): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs(112,28): warning CS0169: The field 'SoftDebuggerSession._tracer' is never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs(1448,31): warning CS0168: The variable 'exc' is declared but never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs(2320,4): warning CS4014: Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call. [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj] /home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/SoftDebuggerSession.cs(112,28): warning CS0169: The field 'SoftDebuggerSession._tracer' is never used [/home/fd/fd/git/sdb/dep/debugger-libs/Mono.Debugging.Soft/Mono.Debugging.Soft.csproj] make: *** [Makefile:180: bin/ICSharpCode.NRefactory.dll] Error 1

I guess I might be at the point of either moving my build environment to an older version, or update the code to use the new environment. What would be best here?

I'll try to install the mentioned developer packs, or retarget the application. (I'm trying to run this on Linux) Maybe the requisite of .NET 4.5 means this will only build for Windows? Maybe this applies only for some parts. Will dig more later.

Any hints will be very appreciated. I literally don't know what I'm doing here :)