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
54 changes: 53 additions & 1 deletion MODULE.bazel.lock

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions docs/bazel.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ Library tests use the `library_test` macro from `src/tests/live_test.bzl`, which
runs a reflection-based test runner (`LibraryTestRunner.cs`) under `corerun`.
Each library test needs a `tests/BUILD.bazel` file.

**Summary**: 20 of ~187 libraries have Bazel test BUILD files.
**Summary**: 28 of ~187 libraries have Bazel test BUILD files.

### Tiers

Expand Down Expand Up @@ -588,35 +588,35 @@ Libraries are grouped by implementation complexity:
| System.Formats.Asn1 | ✅ | ✅ | 46 test files; ref-only dep |
| System.IO.FileSystem.AccessControl | ✅ | ❌ | Windows-specific tests |
| System.IO.FileSystem.DriveInfo | ✅ | ✅ | |
| System.IO.IsolatedStorage | ✅ | ❌ | |
| System.IO.MemoryMappedFiles | ✅ | ❌ | |
| System.IO.IsolatedStorage | ✅ | ❌ | Linked src files use SR (generated string resources) |
| System.IO.MemoryMappedFiles | ✅ | ❌ | Unix tests use LibraryImport partial methods needing source generator |
| System.Linq | ✅ | ✅ | 71 test files |
| System.Memory | ✅ | ✅ | 52143 tests (very large) |
| System.Net.Primitives | ✅ (ref only) | ❌ | Needs impl build; many tests depend on this |
| System.Numerics.Vectors | ✅ | ✅ | |
| System.ObjectModel | ✅ | ✅ | |
| System.Reflection.Emit | ✅ | ❌ | |
| System.Reflection.Emit | ✅ | ✅ | 2027/2625 pass; 598 need MetadataLoadContext impl at runtime |
| System.Reflection.Emit.ILGeneration | ✅ | ✅ | |
| System.Reflection.Emit.Lightweight | ✅ | ✅ | |
| System.Reflection.Metadata | ✅ | ❌ | |
| System.Reflection.Metadata | ✅ | ❌ | 22 embedded resource DLLs need resource embedding support |
| System.Reflection.TypeExtensions | ✅ | ✅ | 1 test skipped (TinyAssembly.dll content file) |
| System.Resources.Writer | ✅ | ✅ | |
| System.Runtime.CompilerServices.VisualC | ✅ | ✅ | |
| System.Runtime.InteropServices | ✅ | ❌ | |
| System.Runtime.Intrinsics | ✅ | ❌ | |
| System.Runtime.Loader | ✅ | ❌ | |
| System.Runtime.InteropServices | ✅ | ✅ | UnitTests; 2504/2505 pass; Windows/Drawing tests excluded |
| System.Runtime.Intrinsics | ✅ | ✅ | 12704 tests; Wasm PackedSimd tests excluded |
| System.Runtime.Loader | ✅ | ❌ | 34 ProjectReferences to sub-projects need separate builds |
| System.Runtime.Numerics | ✅ | ✅ | 176 tests pass (large) |
| System.Runtime.Serialization.Formatters | ✅ | ❌ | |
| System.Runtime.Serialization.Formatters | ✅ | ❌ | Needs ~10 external library builds (CodeDom, Composition, etc.) |
| System.Security.AccessControl | ✅ | ❌ | Windows-specific tests |
| System.Security.Claims | ✅ | ✅ | |
| System.Security.Cryptography | ✅ | ❌ | |
| System.Security.Principal.Windows | ✅ | ❌ | Windows-specific tests |
| System.Text.Encoding.Extensions | ✅ | ✅ | |
| System.Threading | ✅ | ❌ | |
| System.Threading.Overlapped | ✅ | ❌ | |
| System.Threading.Tasks.Parallel | ✅ | ❌ | |
| System.Threading.Thread | ✅ | ❌ | |
| System.Threading.ThreadPool | ✅ | ❌ | |
| System.Threading | ✅ | ✅ | 591 tests pass |
| System.Threading.Overlapped | ✅ | ✅ | 21 tests; 2 skipped |
| System.Threading.Tasks.Parallel | ✅ | ✅ | 262 tests pass |
| System.Threading.Thread | ✅ | ✅ | 45/53 pass; 8 need ApartmentState sub-project binaries |
| System.Threading.ThreadPool | ✅ | ✅ | 69 tests; 1 skipped |

### Tier 2 — Self-contained, need source BUILD first

Expand Down
12 changes: 12 additions & 0 deletions src/libraries/System.Net.Sockets/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
load("//src/libraries:defs.bzl", "netcoreapp_ref_assembly")

netcoreapp_ref_assembly(
name = "ref_System.Net.Sockets",
srcs = [
"ref/System.Net.Sockets.cs",
],
deps = [
"//src/libraries:ref_System.Runtime",
"//src/libraries/System.Net.Primitives:ref_System.Net.Primitives",
],
)
36 changes: 36 additions & 0 deletions src/libraries/System.Reflection.Emit/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
load("//src/tests:live_test.bzl", "library_test")

library_test(
name = "System.Reflection.Emit.Tests",
srcs = glob(
["**/*.cs"],
exclude = [
# Missing closing brace - upstream bug
"TypeBuilder/TypeBuilderInstantiationErrorMessageTests.cs",
],
) + [
"//src/libraries/Common/tests:System/IO/TempFile.cs",
],
deps = [
"//src/libraries/System.Reflection.Emit:ref_System.Reflection.Emit",
"//src/libraries/System.Reflection.Emit.ILGeneration:ref_System.Reflection.Emit.ILGeneration",
"//src/libraries/System.Reflection.Emit.Lightweight:ref_System.Reflection.Emit.Lightweight",
"//src/libraries/System.Reflection.MetadataLoadContext:live_System.Reflection.MetadataLoadContext",
"//src/libraries/System.Reflection.Metadata:ref_System.Reflection.Metadata",
"//src/libraries/System.Reflection.Primitives:ref_System.Reflection.Primitives",
"//src/libraries/System.Collections.Immutable:ref_System.Collections.Immutable",
"//src/libraries/System.Collections.Concurrent:ref_System.Collections.Concurrent",
"//src/libraries/System.Diagnostics.StackTrace:ref_System.Diagnostics.StackTrace",
"//src/libraries/System.Resources.Writer:ref_System.Resources.Writer",
"//src/libraries/System.Threading:ref_System.Threading",
"//src/libraries/Common/tests:TestUtilities",
"@paket.main//microsoft.dotnet.remoteexecutor",
"@paket.main//microsoft.dotnet.xunitassert",
"@paket.main//microsoft.dotnet.xunitextensions",
"@paket.main//xunit.abstractions",
"@paket.main//xunit.extensibility.core",
],
allow_unsafe_blocks = True,
size = "large",
keyfile = "@nuget.microsoft.dotnet.arcade.sdk.v10.0.0-beta.26102.102//:tools/snk/Open.snk",
)
43 changes: 43 additions & 0 deletions src/libraries/System.Reflection.MetadataLoadContext/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
load("//src/libraries:defs.bzl", "netcoreapp_impl_assembly", "netcoreapp_ref_assembly", "ref_impl_pair")

netcoreapp_ref_assembly(
name = "ref_System.Reflection.MetadataLoadContext",
srcs = [
"ref/System.Reflection.MetadataLoadContext.cs",
],
deps = [
"//src/libraries:ref_System.Runtime",
],
)

netcoreapp_impl_assembly(
name = "impl_System.Reflection.MetadataLoadContext",
srcs = glob(
["src/**/*.cs"],
exclude = [
# netstandard-only; TypeExtensions.net.cs is used for netcoreapp
"src/System/Reflection/TypeLoading/General/TypeExtensions.netstandard.cs",
],
) + [
"//src/libraries/Common:src/System/Obsoletions.cs",
],
resx_file = "src/Resources/Strings.resx",
allow_unsafe_blocks = True,
deps = [
"//src/libraries:ref_System.Runtime",
"//src/libraries/System.Collections:ref_System.Collections",
"//src/libraries/System.Collections.Concurrent:ref_System.Collections.Concurrent",
"//src/libraries/System.Collections.Immutable:ref_System.Collections.Immutable",
"//src/libraries/System.Memory:ref_System.Memory",
"//src/libraries/System.Reflection.Metadata:ref_System.Reflection.Metadata",
"//src/libraries/System.Runtime.InteropServices:ref_System.Runtime.InteropServices",
"//src/libraries/System.Threading:ref_System.Threading",
],
)

ref_impl_pair(
name = "live_System.Reflection.MetadataLoadContext",
ref = ":ref_System.Reflection.MetadataLoadContext",
lib = ":impl_System.Reflection.MetadataLoadContext",
visibility = ["//visibility:public"],
)
48 changes: 48 additions & 0 deletions src/libraries/System.Runtime.InteropServices/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,54 @@ csharp_library(
visibility = ["//visibility:public"],
)

csharp_library(
name = "ComInterfaceGenerator",
out = "Microsoft.Interop.ComInterfaceGenerator",
srcs = glob(["gen/ComInterfaceGenerator/**/*.cs"]) + [
"//src/libraries/System.Private.CoreLib:src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs",
"//src/libraries/System.Private.CoreLib:src/System/Runtime/CompilerServices/IsExternalInit.cs",
"//src/libraries/System.Private.CoreLib:src/System/Index.cs",

"//src/libraries/Common:src/Roslyn/DiagnosticDescriptorHelper.cs",
"//src/libraries/Common:src/Roslyn/GetBestTypeByMetadataName.cs",
"//src/libraries/Common:src/System/SR.cs",

"gen/Common/OperationExtensions.cs",
"gen/Common/ConvertToSourceGeneratedInteropFixer.cs",
"gen/Common/FixAllContextExtensions.cs",
"gen/Common/UnreachableException.cs",

# Production source included in the generator
"src/System/Runtime/InteropServices/Marshalling/ComInterfaceOptions.cs",

# Test common source
"tests/Common/ExceptionMarshalling.cs",
],
target_frameworks = ["netstandard2.0"],
langversion = "preview",
cls_compliant = False,
nullable = "annotations",
allow_unsafe_blocks = True,
defines = ["MICROSOFT_INTEROP_COMINTERFACEGENERATOR", "BAZEL"],
deps = [
":Microsoft.Interop.SourceGeneration",
"@paket.main//microsoft.codeanalysis.common",
"@paket.main//microsoft.codeanalysis.csharp",
"@paket.main//microsoft.codeanalysis.workspaces.common",
"@paket.main//microsoft.codeanalysis.csharp.workspaces",
"@paket.main//system.composition.attributedmodel",
"@paket.main//system.collections.immutable",
"@paket.main//system.memory",
],
resx_file = "gen/Common/Resources/Strings.resx",
nowarn = [
"CS3003",
# MSBuild does not generate XML docs for generator projects
"CS1574",
],
visibility = ["//visibility:public"],
)

netcoreapp_ref_assembly(
name = "ref_System.Runtime.InteropServices",
srcs = [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
load("//src/tests:live_test.bzl", "library_test")

library_test(
name = "System.Runtime.InteropServices.Tests",
srcs = glob(
["**/*.cs"],
exclude = [
# Windows-specific tests
"System/Runtime/InteropServices/ComAwareEventInfoTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/ChangeWrapperHandleStrengthTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/CreateWrapperOfTypeTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/FinalReleaseComObjectTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GenerateGuidForTypeTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GenerateProgIdForTypeTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetComObjectDataTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetIDispatchForObjectTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetObjectForIUnknownTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetObjectForNativeVariantTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetStartComSlotTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetTypedObjectForIUnknownTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetUniqueObjectForIUnknownTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/IsComObjectTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/IsTypeVisibleFromComTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/QueryInterfaceTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/ReleaseComObjectTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/SetComObjectDataTests.Windows.cs",
"System/Runtime/InteropServices/Marshal/Common/CommonTypes.Windows.cs",
"System/Runtime/InteropServices/Marshal/GetEndComSlotTests.Windows.cs",
"System/Runtime/InteropServices/PosixSignalRegistrationTests.Windows.cs",
# Not included in the MSBuild project file
"System/Runtime/InteropServices/Marshalling/ComObjectTests.cs",
# Needs System.Drawing.Primitives (not yet in Bazel)
"System/Runtime/InteropServices/Marshal/GetNativeVariantForObjectTests.cs",
"System/Runtime/InteropServices/Marshal/GetObjectForNativeVariantTests.cs",
"System/Runtime/InteropServices/Marshal/GetObjectsForNativeVariantsTests.cs",
],
) + [
"//src/libraries/Common/tests:System/GenericMathHelpers.cs",
"//src/libraries/Common:src/Interop/Unix/Interop.Libraries.cs",
],
deps = [
"//src/libraries/System.Threading:ref_System.Threading",
"//src/libraries/System.Threading.Thread:ref_System.Threading.Thread",
"//src/libraries/System.Reflection.Emit:ref_System.Reflection.Emit",
"//src/libraries/System.Reflection.Emit.ILGeneration:ref_System.Reflection.Emit.ILGeneration",
"//src/libraries:ref_Microsoft.Win32.Primitives",
"//src/libraries/System.Collections.Concurrent:ref_System.Collections.Concurrent",
"//src/libraries/System.Collections.Immutable:ref_System.Collections.Immutable",
"//src/libraries/System.Runtime.Numerics:ref_System.Runtime.Numerics",
"//src/libraries/Common/tests:TestUtilities",
"@paket.main//microsoft.dotnet.remoteexecutor",
"@paket.main//microsoft.dotnet.xunitassert",
"@paket.main//microsoft.dotnet.xunitextensions",
"@paket.main//xunit.abstractions",
"@paket.main//xunit.extensibility.core",
],
analyzers = [
"//src/libraries/System.Runtime.InteropServices:ComInterfaceGenerator",
"//src/libraries/System.Runtime.InteropServices:Microsoft.Interop.SourceGeneration",
],
allow_unsafe_blocks = True,
size = "large",
keyfile = "@nuget.microsoft.dotnet.arcade.sdk.v10.0.0-beta.26102.102//:tools/snk/Open.snk",
)
30 changes: 30 additions & 0 deletions src/libraries/System.Runtime.Intrinsics/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
load("//src/tests:live_test.bzl", "library_test")

library_test(
name = "System.Runtime.Intrinsics.Tests",
srcs = glob(
["**/*.cs"],
exclude = [
# Wasm-specific tests (require PackedSimd hardware support)
"Wasm/**",
],
) + [
"//src/libraries/Common/tests:System/GenericMathTestMemberData.cs",
],
deps = [
"//src/libraries/System.Runtime.Numerics:ref_System.Runtime.Numerics",
"//src/libraries/Common/tests:TestUtilities",
"@paket.main//microsoft.dotnet.remoteexecutor",
"@paket.main//microsoft.dotnet.xunitassert",
"@paket.main//microsoft.dotnet.xunitextensions",
"@paket.main//xunit.abstractions",
"@paket.main//xunit.extensibility.core",
],
allow_unsafe_blocks = True,
nowarn = [
"1718",
"SYSLIB0013",
],
size = "large",
keyfile = "@nuget.microsoft.dotnet.arcade.sdk.v10.0.0-beta.26102.102//:tools/snk/Open.snk",
)
23 changes: 23 additions & 0 deletions src/libraries/System.Threading.Overlapped/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
load("//src/tests:live_test.bzl", "library_test")

library_test(
name = "System.Threading.Overlapped.Tests",
srcs = glob(["*.cs"]) + [
"//src/libraries/Common/tests:System/Threading/ThreadTestHelpers.cs",
],
deps = [
"//src/libraries/System.Threading.Overlapped:ref_System.Threading.Overlapped",
"//src/libraries/System.Threading:ref_System.Threading",
"//src/libraries/System.Threading.Thread:ref_System.Threading.Thread",
"//src/libraries/System.Threading.ThreadPool:ref_System.Threading.ThreadPool",
"//src/libraries:ref_Microsoft.Win32.Primitives",
"//src/libraries/Common/tests:TestUtilities",
"@paket.main//microsoft.dotnet.remoteexecutor",
"@paket.main//microsoft.dotnet.xunitassert",
"@paket.main//microsoft.dotnet.xunitextensions",
"@paket.main//xunit.abstractions",
"@paket.main//xunit.extensibility.core",
],
allow_unsafe_blocks = True,
keyfile = "@nuget.microsoft.dotnet.arcade.sdk.v10.0.0-beta.26102.102//:tools/snk/Open.snk",
)
27 changes: 27 additions & 0 deletions src/libraries/System.Threading.Tasks.Parallel/tests/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
load("//src/tests:live_test.bzl", "library_test")

library_test(
name = "System.Threading.Tasks.Parallel.Tests",
srcs = glob(["*.cs"]) + [
"//src/libraries/Common/tests:System/Diagnostics/Tracing/TestEventListener.cs",
"//src/libraries/Common/tests:System/Threading/ThreadPoolHelpers.cs",
],
deps = [
"//src/libraries/System.Threading.Tasks.Parallel:ref_System.Threading.Tasks.Parallel",
"//src/libraries/System.Threading:ref_System.Threading",
"//src/libraries/System.Threading.Thread:ref_System.Threading.Thread",
"//src/libraries/System.Threading.ThreadPool:ref_System.Threading.ThreadPool",
"//src/libraries/System.Collections.Concurrent:ref_System.Collections.Concurrent",
"//src/libraries/System.Collections.Immutable:ref_System.Collections.Immutable",
"//src/libraries/System.Runtime.Numerics:ref_System.Runtime.Numerics",
"//src/libraries/System.Diagnostics.Tracing:ref_System.Diagnostics.Tracing",
"//src/libraries/Common/tests:TestUtilities",
"@paket.main//microsoft.dotnet.remoteexecutor",
"@paket.main//microsoft.dotnet.xunitassert",
"@paket.main//microsoft.dotnet.xunitextensions",
"@paket.main//xunit.abstractions",
"@paket.main//xunit.extensibility.core",
],
size = "large",
keyfile = "@nuget.microsoft.dotnet.arcade.sdk.v10.0.0-beta.26102.102//:tools/snk/Open.snk",
)
Loading