Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ public CompilerVersion(Options options)
specifiedFramework = compilerDir;
}

var versionInfo = FileVersionInfo.GetVersionInfo(SpecifiedCompiler);
// If csc is specified as compiler name, then attempt to read the version information from csc.dll
var compilerBinaryName = Path.GetFileName(SpecifiedCompiler) == "csc" ? $"{SpecifiedCompiler}.dll" : SpecifiedCompiler;
var versionInfo = FileVersionInfo.GetVersionInfo(File.Exists(compilerBinaryName) ? compilerBinaryName : SpecifiedCompiler);
if (!knownCompilerNames.TryGetValue(versionInfo.OriginalFilename ?? string.Empty, out var vendor))
{
SkipExtractionBecause("the compiler name is not recognised");
Expand Down
4 changes: 4 additions & 0 deletions csharp/ql/lib/change-notes/2025-10-21-dotnet-rc2-tracing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* Added tracer support for macOS and Linux when the .NET CLI (`dotnet`) directly invokes the C# compiler (`csc`). This enhancement provides basic tracing and extraction capabilities for .NET 10 RC2 on these platforms.
5 changes: 5 additions & 0 deletions csharp/tools/tracing-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,11 @@ function RegisterExtractorPack(id)
prepend = { '--compiler', '"${compiler}"' },
order = ORDER_BEFORE
}),
CreatePatternMatcher({ '^csc$' }, MatchCompilerName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just include '^csc$' in the list above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to the quotation in the above.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our offline discussion, the matchers have been merged, which means that the quotation has been removed for the .exe cases.

extractor, {
prepend = { '--compiler', '${compiler}' },
order = ORDER_BEFORE
}),
MsBuildMatcher,
function(compilerName, compilerPath, compilerArguments, _languageId)
-- handle cases like `dotnet exec csc.dll <args>` and `mono(-sgen64) csc.exe <args>`
Expand Down