Skip to content

Commit 7174d3c

Browse files
authored
[dotnet-trace][collect-linux] Handle incompatible glibc (#5634)
Not all supported RIDs will be compatible with RecordTrace, which currently has a minimum requirement of glibc 2.34. So users running `dotnet-trace collect-linux` in older distros will be unable to p/invoke `librecordtrace.so` even though they are running on Linux x64/arm64.
1 parent 8d3bda1 commit 7174d3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Tools/dotnet-trace/CommandLine/Commands/CollectLinuxCommand.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ internal int CollectLinux(CollectLinuxArgs args)
9595
Console.Error.WriteLine($"[ERROR] {e.Message}");
9696
ret = (int)ReturnCode.TracingError;
9797
}
98+
catch (DllNotFoundException dnfe)
99+
{
100+
Console.Error.WriteLine($"[ERROR] Could not find or load dependencies for collect-linux. For requirements, please visit https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-trace");
101+
Console.Error.WriteLine($"[ERROR] {dnfe.Message}");
102+
ret = (int)ReturnCode.PlatformNotSupportedError;
103+
}
98104
catch (Exception ex)
99105
{
100106
Console.Error.WriteLine($"[ERROR] {ex}");

0 commit comments

Comments
 (0)