Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.100
dotnet-version: 10.0.201

- name: Checkout repository
uses: actions/checkout@v5
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/csharp-qltest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ jobs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.100
dotnet-version: 10.0.201
- name: Extractor unit tests
run: |
dotnet tool restore

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

To use the runtime shipped with .NET 10.0.201, we should update -p:RuntimeFrameworkVersion=10.0.0 to p:RuntimeFrameworkVersion=10.0.5 (see my comment below)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For the tests the RuntimeFrameworkVersion is set here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dotnet test -p:RuntimeFrameworkVersion=10.0.0 extractor/Semmle.Util.Tests
dotnet test -p:RuntimeFrameworkVersion=10.0.0 extractor/Semmle.Extraction.Tests
dotnet test -p:RuntimeFrameworkVersion=10.0.0 autobuilder/Semmle.Autobuild.CSharp.Tests
dotnet test -p:RuntimeFrameworkVersion=10.0.0 autobuilder/Semmle.Autobuild.Cpp.Tests
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
shell: bash
stubgentest:
runs-on: ubuntu-latest
Expand Down
6 changes: 3 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ bazel_dep(name = "rules_shell", version = "0.8.0")
bazel_dep(name = "bazel_skylib", version = "1.9.2")
bazel_dep(name = "abseil-cpp", version = "20260817.0", repo_name = "absl")
bazel_dep(name = "nlohmann_json", version = "3.12.0.bcr.2", repo_name = "json")
bazel_dep(name = "fmt", version = "12.1.0-codeql.1")
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.21.5-codeql.1")
bazel_dep(name = "rules_dotnet", version = "0.22.2-codeql.1")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there an internal PR updating the rules_dotnet version number in MODULE.bazel in semmle-code?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not yet. That's next on my list.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It's also not critical. Bazel will pick up 0.22.2-codeql.1 when you're on a new enough ql commit.

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.0.0-rc5-codeql.3")
Expand Down Expand Up @@ -206,7 +206,7 @@ http_archive(
)

dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "10.0.100")
dotnet.toolchain(dotnet_version = "10.0.201")
Comment thread
jketema marked this conversation as resolved.
Resolved

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In relation to your comment about what we ship: I suppose that bazel will automatically target the runtime shipped with .NET 10.0.201 SDK (which is 10.0.5)?

use_repo(dotnet, "dotnet_toolchains")

register_toolchains("@dotnet_toolchains//:all")
Expand Down
2 changes: 1 addition & 1 deletion csharp/actions/create-extractor-pack/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.100
dotnet-version: 10.0.201
- name: Build Extractor
shell: bash
run: scripts/create-extractor-pack.sh

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In the create-extractor-pack.sh script we should also update -p:RuntimeFrameworkVersion=10.0.0 to -p:RuntimeFrameworkVersion=10.0.5 (otherwise the extractor still targets the runtime shipped with .NET 10.0.100).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll update, but my understanding of this is that it is unrelated to what we actually ship, as we do not use create-extractor-pack.sh when we create actual releases.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 77a4a35

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If the actual release automatically target the runtime framework version shipped with the .NET version (10.0.201), then we should probably update here anyway (otherwise there is a discrepancy between what the scripts creates and what we ship).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public IList<string> 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.100";
public const string LatestDotNetSdkVersion = "10.0.201";

public static ReadOnlyDictionary<string, string> MinimalEnvironment => IDotNetCliInvoker.MinimalEnvironment;

Expand Down
2 changes: 1 addition & 1 deletion csharp/scripts/create-extractor-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.0 $1 --output extractor-pack/tools/${platform}
dotnet publish --self-contained --configuration Release --runtime ${dotnet_platform} -p:RuntimeFrameworkVersion=10.0.5 $1 --output extractor-pack/tools/${platform}
}

dotnet tool restore
Expand Down
2 changes: 1 addition & 1 deletion csharp/scripts/stubs/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def make_stubs(self):
bqrsFile = os.path.join(rawOutputDir, outputName + '.bqrs')
jsonFile = os.path.join(rawOutputDir, outputName + '.json')

sdk_version = '10.0.100'
sdk_version = '10.0.201'
print("\n* Creating new global.json file and setting SDK to " + sdk_version)
self.run_cmd(['dotnet', 'new', 'globaljson', '--force', '--sdk-version', sdk_version, '--output', self.workDir])

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module(
name = "fmt",
version = "12.2.0.bcr.1-codeql.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 10,
)

bazel_dep(name = "package_metadata", version = "0.0.13")
bazel_dep(name = "rules_cc", version = "0.2.20")
bazel_dep(name = "rules_license", version = "1.0.0")
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
load("@package_metadata//licenses/rules:license.bzl", package_metadata_license = "license")
load("@package_metadata//purl:purl.bzl", "purl")
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_license//rules:license.bzl", "license")

package(
default_package_metadata = [
":license",
":package_metadata",
],
)

exports_files([
"LICENSE",
])

license(
name = "license",
license_kinds = ["@rules_license//licenses/spdx:MIT"],
license_text = "LICENSE",
)

package_metadata_license(
name = "package_metadata_license",
kind = "@package_metadata//licenses/spdx:MIT",
text = "LICENSE",
visibility = ["//visibility:public"],
)

package_metadata(
name = "package_metadata",
attributes = [":package_metadata_license"],
purl = purl.bazel(
module_name(),
module_version(),
),
visibility = ["//visibility:public"],
)

cc_library(
name = "fmt",
srcs = [
#"src/fmt.cc", # No C++ module support, yet in Bazel (https://github.com/bazelbuild/bazel/pull/19940)
"src/format.cc",
"src/os.cc",
],
hdrs = glob([
"include/fmt/*.h",
]),
# CodeQL change: disable UTF8 support, it's causing issues on Windows
defines = select({
"@rules_cc//cc/compiler:msvc-cl": ["FMT_UNICODE=0"],
"//conditions:default": [],
}),
includes = ["include"],
strip_include_prefix = "include", # workaround: only needed on some macOS systems (see https://github.com/bazelbuild/bazel-central-registry/issues/1537)
visibility = ["//visibility:public"],
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module(
name = "fmt",
version = "12.2.0.bcr.1-codeql.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 10,
)

bazel_dep(name = "package_metadata", version = "0.0.13")
bazel_dep(name = "rules_cc", version = "0.2.20")
bazel_dep(name = "rules_license", version = "1.0.0")
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/fmtlib/fmt/releases/download/12.2.0/fmt-12.2.0.zip",
"integrity": "sha256-ovSo1RF4+VTkwzkAf3ft12ugyy42+HpI5aVAPZvlh48=",
"strip_prefix": "fmt-12.2.0",
"overlay": {
"BUILD.bazel": "sha256-Zn5kky5jBkuqoek9UpzuHX4sTkqyhUKnjENJwJxRCEI=",
"MODULE.bazel": "sha256-WdW/GI1Ho1qVF/BZ8ZQTa71rB8F5QHkLv07kySMJfGI="
}
}
1 change: 1 addition & 0 deletions misc/bazel/registry/modules/fmt/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"github:fmtlib/fmt"
],
"versions": [
"12.2.0.bcr.1-codeql.1",
"12.1.0-codeql.1"
],
"yanked_versions": {}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
"rules_dotnet"

module(
name = "rules_dotnet",
version = "0.22.2-codeql.1",
bazel_compatibility = [">=8.0.0"],
compatibility_level = 0,
)

dotnet = use_extension("@rules_dotnet//dotnet:extensions.bzl", "dotnet")
dotnet.toolchain(dotnet_version = "10.0.201")

# This toolchain is used for building the apphost shimmer only. The apphost shimmer
# can not be buit with the toolchain that the end-user picks because the apphost builder
# always targets the latest SDK and the end-user can pick an older SDK that is incompatible with the apphost builder.
Comment thread
jketema marked this conversation as resolved.
Resolved
dotnet.toolchain(
name = "dotnet_apphost",
dotnet_version = "10.0.201",
)
use_repo(dotnet, "dotnet_toolchains")

# These toolchains are used to build the apphost shimmer
use_repo(dotnet, "dotnet_apphost_x86_64-unknown-linux-gnu")
use_repo(dotnet, "dotnet_apphost_arm64-unknown-linux-gnu")
use_repo(dotnet, "dotnet_apphost_aarch64-apple-darwin")
use_repo(dotnet, "dotnet_apphost_x86_64-apple-darwin")
use_repo(dotnet, "dotnet_apphost_x86_64-pc-windows-msvc")
use_repo(dotnet, "dotnet_apphost_arm64-pc-windows-msvc")

register_toolchains("@dotnet_toolchains//:all")

paket2bazel_dependencies_extension = use_extension("@rules_dotnet//dotnet:paket.paket2bazel_dependencies_extension.bzl", "paket2bazel_dependencies_extension")
use_repo(paket2bazel_dependencies_extension, "paket.paket2bazel_dependencies")

rules_dotnet_nuget_packages_extension = use_extension("@rules_dotnet//dotnet:paket.rules_dotnet_nuget_packages_extension.bzl", "rules_dotnet_nuget_packages_extension")
use_repo(rules_dotnet_nuget_packages_extension, "paket.rules_dotnet_nuget_packages")

targeting_packs_extension = use_extension("@rules_dotnet//dotnet/private/sdk/targeting_packs:dotnet.targeting_packs_extension.bzl", "targeting_packs_extension")
use_repo(targeting_packs_extension, "dotnet.targeting_packs")

runtime_packs_extension = use_extension("@rules_dotnet//dotnet/private/sdk/runtime_packs:dotnet.runtime_packs_extension.bzl", "runtime_packs_extension")
use_repo(runtime_packs_extension, "dotnet.runtime_packs")

apphost_packs_extension = use_extension("@rules_dotnet//dotnet/private/sdk/apphost_packs:dotnet.apphost_packs_extension.bzl", "apphost_packs_extension")
use_repo(apphost_packs_extension, "dotnet.apphost_packs")

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "bazel_lib", version = "3.0.0")
bazel_dep(name = "rules_shell", version = "0.6.1")

# Dev dependencies
bazel_dep(name = "rules_pkg", version = "1.1.0", dev_dependency = True)
bazel_dep(name = "gazelle", version = "0.51.3", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.9.0", dev_dependency = True)
bazel_dep(name = "rules_cc", version = "0.2.19", dev_dependency = True)
bazel_dep(name = "rules_testing", version = "0.8.0", dev_dependency = True)
bazel_dep(name = "bazel_ci_rules", version = "1.0.0", dev_dependency = True)
bazel_dep(name = "dotnet_test_resources_other_repo", version = "", dev_dependency = True)
local_path_override(
module_name = "dotnet_test_resources_other_repo",
path = "dotnet/private/tests/resources/other_repo",
)

rules_dotnet_dev_nuget_packages_extension = use_extension("@rules_dotnet//dotnet:paket.rules_dotnet_dev_nuget_packages_extension.bzl", "rules_dotnet_dev_nuget_packages_extension", dev_dependency = True)
use_repo(rules_dotnet_dev_nuget_packages_extension, "paket.rules_dotnet_dev_nuget_packages")

rules_dotnet_nuget_resource_assemblies_tests_extension = use_extension("@rules_dotnet//dotnet:paket.rules_dotnet_nuget_resource_assemblies_tests_extension.bzl", "rules_dotnet_nuget_resource_assemblies_tests_extension", dev_dependency = True)
use_repo(rules_dotnet_nuget_resource_assemblies_tests_extension, "paket.rules_dotnet_nuget_resource_assemblies_tests")

internal_dev_deps = use_extension("@rules_dotnet//dotnet:internal_dev_deps.bzl", "internal_dev_deps", dev_dependency = True)
use_repo(internal_dev_deps, "buildkite_config")

rules_dotnet_framework_override_not_provided_tests_extension = use_extension("@rules_dotnet//dotnet:paket.rules_dotnet_framework_override_not_provided_tests_extension.bzl", "rules_dotnet_framework_override_not_provided_tests_extension", dev_dependency = True)
use_repo(rules_dotnet_framework_override_not_provided_tests_extension, "paket.rules_dotnet_framework_override_not_provided_tests")

rules_dotnet_nuget_tool_tests_extension = use_extension("@rules_dotnet//dotnet:paket.rules_dotnet_nuget_tool_tests_extension.bzl", "rules_dotnet_nuget_tool_tests_extension", dev_dependency = True)
use_repo(rules_dotnet_nuget_tool_tests_extension, "paket.rules_dotnet_nuget_tool_tests")
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- a/MODULE.bazel
+++ b/MODULE.bazel
@@ -6 +6 @@
- version = "0.0.0",
+ version = "0.22.2-codeql.1",
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- a/dotnet/private/rules/nuget/nuget_archive.bzl
+++ b/dotnet/private/rules/nuget/nuget_archive.bzl
@@ -142 +142 @@
- if file.endswith(tfm) or file.endswith(tfm + "/"):
+ if file.find("/", tfm_end + 1) != -1:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"integrity": "sha256-zjXa0Y2zHNaDI7Vo3AnGicxtdewW66FRDM0Si7XxJk4=",
"strip_prefix": "rules_dotnet-0.22.2",
"docs_url": "https://github.com/bazel-contrib/rules_dotnet/releases/download/v0.22.2/rules_dotnet-v0.22.2.docs.tar.gz",
"url": "https://github.com/bazel-contrib/rules_dotnet/releases/download/v0.22.2/rules_dotnet-v0.22.2.tar.gz",
"patches": {
"module_dot_bazel_version.patch": "sha256-jS0bNBAwNeJOylIjBXVvQApWA4+pWAxWuD2FBbaBHX4=",
"revert_additional_files_in_nuget_archive.patch": "sha256-DgXRtEr+vmKXPJnWNDEmDw7VqFCpGh6zrHyVBclQ+/Q="
},
"patch_strip": 1
}
1 change: 1 addition & 0 deletions misc/bazel/registry/modules/rules_dotnet/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"github:bazel-contrib/rules_dotnet"
],
"versions": [
"0.22.2-codeql.1",
"0.21.5-codeql.1"
],
"yanked_versions": {}
Expand Down
Loading