diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml
index 99028b8011cb..ac78401fc9d4 100644
--- a/.github/workflows/codeql-analysis.yml
+++ b/.github/workflows/codeql-analysis.yml
@@ -34,7 +34,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 10.0.201
+ dotnet-version: 11.0.100
- name: Checkout repository
uses: actions/checkout@v5
diff --git a/.github/workflows/csharp-qltest.yml b/.github/workflows/csharp-qltest.yml
index 38ba6b9afacf..137e716fa853 100644
--- a/.github/workflows/csharp-qltest.yml
+++ b/.github/workflows/csharp-qltest.yml
@@ -51,14 +51,14 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 10.0.201
+ dotnet-version: 11.0.100
- name: Extractor unit tests
run: |
dotnet tool restore
- dotnet test -p:RuntimeFrameworkVersion=10.0.5 extractor/Semmle.Util.Tests
- dotnet test -p:RuntimeFrameworkVersion=10.0.5 extractor/Semmle.Extraction.Tests
- dotnet test -p:RuntimeFrameworkVersion=10.0.5 autobuilder/Semmle.Autobuild.CSharp.Tests
- dotnet test -p:RuntimeFrameworkVersion=10.0.5 autobuilder/Semmle.Autobuild.Cpp.Tests
+ dotnet test -p:RuntimeFrameworkVersion=11.0.0 extractor/Semmle.Util.Tests
+ dotnet test -p:RuntimeFrameworkVersion=11.0.0 extractor/Semmle.Extraction.Tests
+ dotnet test -p:RuntimeFrameworkVersion=11.0.0 autobuilder/Semmle.Autobuild.CSharp.Tests
+ dotnet test -p:RuntimeFrameworkVersion=11.0.0 autobuilder/Semmle.Autobuild.Cpp.Tests
shell: bash
stubgentest:
runs-on: ubuntu-latest
diff --git a/MODULE.bazel b/MODULE.bazel
index e33e1ff68331..23ccc2740b02 100644
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -28,7 +28,7 @@ bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.2", repo_name = "json")
bazel_dep(name = "fmt", version = "12.2.0.bcr.1-codeql.1")
bazel_dep(name = "rules_kotlin", version = "2.4.21-codeql.1")
bazel_dep(name = "gazelle", version = "0.54.0")
-bazel_dep(name = "rules_dotnet", version = "0.22.2-codeql.1")
+bazel_dep(name = "rules_dotnet")
bazel_dep(name = "googletest", version = "1.18.0.bcr.1")
bazel_dep(name = "rules_rust", version = "0.75.0")
bazel_dep(name = "rules_swift", version = "4.2.2-codeql.1")
@@ -37,6 +37,18 @@ bazel_dep(name = "zstd", version = "1.5.7.bcr.3")
bazel_dep(name = "buildifier_prebuilt", version = "10.1.0", dev_dependency = True)
+# TODO: Cleanup our own codeql version of rules_dotnet.
+# Remember that we need to delete the old patch.
+git_override(
+ module_name = "rules_dotnet",
+ commit = "8db43484722080564c2abd04bc09f43f61bf6c65",
+ patch_strip = 1,
+ # Keep the patch in a separate package so it can load when the enclosing build
+ # marks misc/bazel as deleted.
+ patches = ["//misc/bazel/patches:rules_dotnet_nuget_archive.patch"],
+ remote = "https://github.com/bazel-contrib/rules_dotnet.git",
+)
+
# Pin the compiler to support the Kotlin 1.8 and 1.9 language versions required by older extractors.
kotlin = use_extension("@rules_kotlin//src/main/starlark/core/repositories:bzlmod_setup.bzl", "rules_kotlin_extensions")
kotlin.kotlinc_version(
@@ -222,7 +234,7 @@ http_archive(
)
dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
-dotnet.toolchain(dotnet_version = "10.0.201")
+dotnet.toolchain(dotnet_version = "11.0.100")
use_repo(dotnet, "dotnet_toolchains")
register_toolchains("@dotnet_toolchains//:all")
diff --git a/csharp/.config/dotnet-tools.json b/csharp/.config/dotnet-tools.json
index f4f161bafeeb..4965bfecf746 100644
--- a/csharp/.config/dotnet-tools.json
+++ b/csharp/.config/dotnet-tools.json
@@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"paket": {
- "version": "10.3.1",
+ "version": "12.0.0",
"commands": [
"paket"
]
diff --git a/csharp/.paket/Paket.Restore.targets b/csharp/.paket/Paket.Restore.targets
index 8f48b933eb93..18536c51aef2 100644
--- a/csharp/.paket/Paket.Restore.targets
+++ b/csharp/.paket/Paket.Restore.targets
@@ -16,21 +16,6 @@
$(MSBuildThisFileDirectory)..\
$(PaketRootPath)paket-files\paket.restore.cached
$(PaketRootPath)paket.lock
- classic
- proj
- assembly
- native
- /Library/Frameworks/Mono.framework/Commands/mono
- mono
-
-
- $(PaketRootPath)paket.bootstrapper.exe
- $(PaketToolsPath)paket.bootstrapper.exe
- $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\
-
- "$(PaketBootStrapperExePath)"
- $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"
-
@@ -47,29 +32,32 @@
-
+
+
-
-
-
- $(PaketRootPath)paket
- $(PaketToolsPath)paket
-
-
-
+
+
+
-
- $(PaketRootPath)paket.exe
- $(PaketToolsPath)paket.exe
+ <_PaketFullRootPath>$([System.IO.Path]::GetFullPath('$(PaketRootPath)'))
+ <_DotnetToolsJsonDir>$([MSBuild]::GetDirectoryNameOfFileAbove('$(_PaketFullRootPath)', '.config/dotnet-tools.json'))
+ <_DotnetToolsJson Condition=" '$(_DotnetToolsJsonDir)' != '' ">$([System.IO.File]::ReadAllText("$(_DotnetToolsJsonDir)/.config/dotnet-tools.json"))
+ <_RootDotnetToolsJsonDir>$([MSBuild]::GetDirectoryNameOfFileAbove('$(_PaketFullRootPath)', 'dotnet-tools.json'))
+ <_DotnetToolsJson Condition=" '$(_RootDotnetToolsJsonDir)' != '' ">$(_DotnetToolsJson)$([System.IO.File]::ReadAllText("$(_RootDotnetToolsJsonDir)/dotnet-tools.json"))
+ <_ConfigContainsPaket Condition=" '$(_DotnetToolsJson)' != ''">$([System.Text.RegularExpressions.Regex]::IsMatch(`$(_DotnetToolsJson)`, `(?i)"paket"\s*:\s*\{`))
+ <_ConfigContainsPaket Condition=" '$(_ConfigContainsPaket)' == ''">false
-
-
+
+
- <_DotnetToolsJson Condition="Exists('$(PaketRootPath)/.config/dotnet-tools.json')">$([System.IO.File]::ReadAllText("$(PaketRootPath)/.config/dotnet-tools.json"))
- <_ConfigContainsPaket Condition=" '$(_DotnetToolsJson)' != ''">$(_DotnetToolsJson.Contains('"paket"'))
- <_ConfigContainsPaket Condition=" '$(_ConfigContainsPaket)' == ''">false
+ <_PaketToolPathExeName Condition=" '$(OS)' != 'Windows_NT' ">paket
+ <_PaketToolPathExeName Condition=" '$(OS)' == 'Windows_NT' ">paket.exe
+ <_PaketToolPathExe Condition=" $([System.IO.File]::Exists('$(_PaketFullRootPath)$(_PaketToolPathExeName)')) ">$(_PaketFullRootPath)$(_PaketToolPathExeName)
+ <_PaketToolPathExe Condition=" '$(_PaketToolPathExe)' == '' AND $([System.IO.File]::Exists('$(PaketToolsPath)$(_PaketToolPathExeName)')) ">$(PaketToolsPath)$(_PaketToolPathExeName)
+ $(_PaketToolPathExe)
+
@@ -82,21 +70,15 @@
<_PaketCommand>dotnet paket
-
+
-
- $(PaketToolsPath)paket
- $(PaketBootStrapperExeDir)paket
-
-
- paket
+ paket
<_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)"))
<_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)"
- <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)"
<_PaketCommand Condition=" '$(_PaketCommand)' == '' ">"$(PaketExePath)"
@@ -107,14 +89,13 @@
-
-
-
+
+
-
+
@@ -165,8 +146,6 @@
-
-
@@ -201,6 +180,41 @@
false
+
+
+ $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.lock.hash
+
+
+
+ $(PaketRestoreLockFileHash)
+
+
+
+
+
+ $([System.IO.File]::ReadAllText('$(PaketProjectLockHashCacheFilePath)').Trim())
+ true
+ paket.lock content changed since last per-project restore
+
+
+
+ true
+ per-project paket.lock hash cache missing
+
+
false
@@ -218,6 +232,11 @@
+
+
+
false
@@ -315,6 +334,15 @@
<_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/>
+
+ <_PrimaryNuspecFile Include="@(_NuspecFiles)" Exclude="$(AdjustedNuspecOutputPath)\*.symbols.nuspec" Condition="@(_NuspecFiles) != ''" />
+ <_PrimaryNuspecFile Include="@(_NuspecFiles)" Condition="@(_PrimaryNuspecFile) == '' And @(_NuspecFiles) != ''" />
@@ -326,12 +354,15 @@
<_ConditionsParameter>
- <_ConditionsParameter Condition="@(_DefinedConditionProperties) != ''">--conditions @(_DefinedConditionProperties)
+
+ <_ConditionsParameter Condition="@(_DefinedConditionProperties) != ''">--conditions "@(_DefinedConditionProperties)"
-
+
@@ -383,7 +414,10 @@
PackageLicenseExpression="$(PackageLicenseExpression)"
PackageLicenseExpressionVersion="$(PackageLicenseExpressionVersion)"
Readme="$(PackageReadmeFile)"
- NoDefaultExcludes="$(NoDefaultExcludes)"/>
+ NoDefaultExcludes="$(NoDefaultExcludes)"
+ NoWarn="$(NoWarn)"
+ TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
+ WarningsAsErrors="$(WarningsAsErrors)"/>
- net10.0
+ net11.0
win-x64;linux-x64;osx-x64
enable
true
diff --git a/csharp/actions/create-extractor-pack/action.yml b/csharp/actions/create-extractor-pack/action.yml
index 05b11dad8c3c..f2e7a0bc1506 100644
--- a/csharp/actions/create-extractor-pack/action.yml
+++ b/csharp/actions/create-extractor-pack/action.yml
@@ -7,7 +7,7 @@ runs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
- dotnet-version: 10.0.201
+ dotnet-version: 11.0.100
- name: Build Extractor
shell: bash
run: scripts/create-extractor-pack.sh
diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs
index 4bd6f6f94870..d5904868bccf 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/DotNet.cs
@@ -150,7 +150,7 @@ public IList GetNugetFeedsFromFolder(string folderPath)
}
// The version number should be kept in sync with the version .NET version used for building the application.
- public const string LatestDotNetSdkVersion = "10.0.201";
+ public const string LatestDotNetSdkVersion = "11.0.100";
public static ReadOnlyDictionary MinimalEnvironment => IDotNetCliInvoker.MinimalEnvironment;
diff --git a/csharp/extractor/Semmle.Extraction.CSharp.DependencyStubGenerator/Semmle.Extraction.CSharp.DependencyStubGenerator.csproj b/csharp/extractor/Semmle.Extraction.CSharp.DependencyStubGenerator/Semmle.Extraction.CSharp.DependencyStubGenerator.csproj
index 2f05a1f9fe44..31e1839b7cba 100644
--- a/csharp/extractor/Semmle.Extraction.CSharp.DependencyStubGenerator/Semmle.Extraction.CSharp.DependencyStubGenerator.csproj
+++ b/csharp/extractor/Semmle.Extraction.CSharp.DependencyStubGenerator/Semmle.Extraction.CSharp.DependencyStubGenerator.csproj
@@ -2,7 +2,7 @@
Exe
- net10.0
+ net11.0
Semmle.Extraction.CSharp.DependencyStubGenerator
Semmle.Extraction.CSharp.DependencyStubGenerator
enable
diff --git a/csharp/paket.dependencies b/csharp/paket.dependencies
index 9935a83d4162..2fc374a2b5b3 100644
--- a/csharp/paket.dependencies
+++ b/csharp/paket.dependencies
@@ -1,4 +1,4 @@
-framework: net10.0
+framework: net11.0
storage: none
source https://api.nuget.org/v3/index.json
# behave like nuget in choosing transitive dependency versions
diff --git a/csharp/paket.lock b/csharp/paket.lock
index d5cf7b70d95c..f149bf7b4501 100644
--- a/csharp/paket.lock
+++ b/csharp/paket.lock
@@ -1,6 +1,6 @@
STORAGE: NONE
STRATEGY: MAX
-RESTRICTION: == net10.0
+RESTRICTION: == net11.0
NUGET
remote: https://api.nuget.org/v3/index.json
Basic.CompilerLog.Util (0.9.66)
@@ -120,10 +120,7 @@ NUGET
System.Memory (4.6.3)
System.Numerics.Vectors (4.6.1)
System.Reflection.Metadata (11.0)
- System.Collections.Immutable (>= 11.0)
System.Reflection.MetadataLoadContext (11.0)
- System.Collections.Immutable (>= 11.0)
- System.Reflection.Metadata (>= 11.0)
System.Runtime.CompilerServices.Unsafe (6.1.2)
System.Security.Cryptography.ProtectedData (11.0)
System.Text.Encoding.CodePages (11.0)
diff --git a/csharp/scripts/create-extractor-pack.sh b/csharp/scripts/create-extractor-pack.sh
index 4fbb866b028e..d3e2dbcbc4af 100755
--- a/csharp/scripts/create-extractor-pack.sh
+++ b/csharp/scripts/create-extractor-pack.sh
@@ -21,7 +21,7 @@ mkdir -p extractor-pack
mkdir -p extractor-pack/tools/${platform}
function dotnet_publish {
- dotnet publish --self-contained --configuration Release --runtime ${dotnet_platform} -p:RuntimeFrameworkVersion=10.0.5 $1 --output extractor-pack/tools/${platform}
+ dotnet publish --self-contained --configuration Release --runtime ${dotnet_platform} -p:RuntimeFrameworkVersion=11.0.0 $1 --output extractor-pack/tools/${platform}
}
dotnet tool restore
diff --git a/csharp/scripts/gen-assembly-info.py b/csharp/scripts/gen-assembly-info.py
index 9937477f70de..7ec6a57a823a 100644
--- a/csharp/scripts/gen-assembly-info.py
+++ b/csharp/scripts/gen-assembly-info.py
@@ -28,7 +28,7 @@ def options():
[assembly: AssemblyCompany("GitHub")]
[assembly: AssemblyCopyright("Copyright © 2024 GitHub")]
-[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")]
+[assembly: System.Runtime.Versioning.TargetFramework(".NETCoreApp,Version=v11.0", FrameworkDisplayName = ".NET 11.0")]
"""
output_file.write_text(output_file_contents)
diff --git a/misc/bazel/csharp.bzl b/misc/bazel/csharp.bzl
index 0cf2e30d0de7..7275b941c7dc 100644
--- a/misc/bazel/csharp.bzl
+++ b/misc/bazel/csharp.bzl
@@ -2,7 +2,7 @@ load("@rules_dotnet//dotnet:defs.bzl", "csharp_binary", "csharp_library", "cshar
load("@rules_pkg//pkg:mappings.bzl", "strip_prefix")
load("//misc/bazel:pkg.bzl", "codeql_pkg_files")
-TARGET_FRAMEWORK = "net10.0"
+TARGET_FRAMEWORK = "net11.0"
def _gen_assembly_info(name):
assembly_info_gen = name + "-assembly-info"
diff --git a/misc/bazel/patches/BUILD.bazel b/misc/bazel/patches/BUILD.bazel
new file mode 100644
index 000000000000..aa517dba9f09
--- /dev/null
+++ b/misc/bazel/patches/BUILD.bazel
@@ -0,0 +1 @@
+exports_files(["rules_dotnet_nuget_archive.patch"])
diff --git a/misc/bazel/patches/rules_dotnet_nuget_archive.patch b/misc/bazel/patches/rules_dotnet_nuget_archive.patch
new file mode 100644
index 000000000000..7df659192d2d
--- /dev/null
+++ b/misc/bazel/patches/rules_dotnet_nuget_archive.patch
@@ -0,0 +1,13 @@
+--- a/dotnet/private/rules/nuget/nuget_archive.bzl
++++ b/dotnet/private/rules/nuget/nuget_archive.bzl
+@@ -219,6 +219,9 @@ def _process_group_with_tfm(groups, group_name, file):
+ groups["unsupported_tfms"][folder] = True
+ return
+-
++
++ if len(parts) > 3:
++ return
++
+ # Registered before the file is looked at, so that a `_._` placeholder still
+ # claims the framework: it says the package brings nothing for it, not that
+ # it does not support it.