Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine($"<arguments>{string.Join(",", args)}</arguments>");
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
5 changes: 5 additions & 0 deletions csharp/ql/integration-tests/linux/dotnet_10_rc2/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "10.0.100-rc.2.25502.107"
}
}
6 changes: 6 additions & 0 deletions csharp/ql/integration-tests/linux/dotnet_10_rc2/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
import runs_on

@runs_on.linux
def test(codeql, csharp):
codeql.database.create()
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine($"<arguments>{string.Join(",", args)}</arguments>");
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "10.0.100-rc.2.25502.107"
}
}
6 changes: 6 additions & 0 deletions csharp/ql/integration-tests/windows/dotnet_10_rc2/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import os
import runs_on

@runs_on.windows
def test(codeql, csharp):
codeql.database.create()
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.
4 changes: 2 additions & 2 deletions csharp/tools/tracing-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ function RegisterExtractorPack(id)
}
local posixMatchers = {
DotnetMatcherBuild,
CreatePatternMatcher({ '^mcs%.exe$', '^csc%.exe$' }, MatchCompilerName,
CreatePatternMatcher({ '^mcs%.exe$', '^csc%.exe$', '^csc$' }, MatchCompilerName,
extractor, {
prepend = { '--compiler', '"${compiler}"' },
prepend = { '--compiler', '${compiler}' },
order = ORDER_BEFORE
}),
MsBuildMatcher,
Expand Down