Repository navigation
Enable native Bazel builds and experimental CI cache dogfooding #12204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Amaury Levé (Evangelink)
merged 62 commits into
main
from
dev/amauryleve/bazel-build-migration
Nov 6, 2026
Merged
Changes from 58 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
1ec3737
Enable staged native Bazel builds and validation
Evangelink 22a3f9d
Align Bazel test tuple names with repository conventions
Evangelink 6bc33c4
Expand native Bazel builds, packages, and runtime validation
Evangelink 2d79cf5
Align experimental package versions and isolated validation options
Evangelink 797eb6f
Support native C# reference aliases for Bazel test consumers
Evangelink 7bc60a3
Package MSTest analyzers natively with Bazel
Evangelink bb3d555
Validate analyzer package preview identities and isolated consumers
Evangelink 67046b4
Add native netstandard platform and MSBuild targets
Evangelink 05c7c92
Emit exact framework metadata for native compatibility assemblies
Evangelink 112c626
Record analyzer package counterfactual evidence
Evangelink 325eca5
Preserve no-op removals in native JSON source selection
Evangelink 1a4d289
Add native MSTest SDK and meta-package generation
Evangelink 256c9f2
Align native SDK package prerelease versions
Evangelink 0a1443c
Isolate inherited MSBuild executable selection in SDK consumers
Evangelink 9036c23
Record native SDK package and sensitivity evidence
Evangelink 11ae3b9
Expand SDK consumer contract and producer provenance checks
Evangelink 99f775b
Resolve independent Bazel consumer SDKs from materialized repositories
Evangelink bacbfc3
Share exact framework metadata across native compatibility outputs
Evangelink 9c78819
Add native MSTest package layouts and consumer validation
Evangelink aa8d2d2
Preserve SDK environment isolation in MSTest package consumers
Evangelink 9f900a4
Match native MSTest discovery display names exactly
Evangelink 49f7424
Carry native task runtime assets and isolate package restore
Evangelink 3bd4f87
Expose platform constraints for native adapter package selection
Evangelink a7e253d
Resolve native platform dependency ranges before packing
Evangelink 960366e
Verify native SDK and meta-package consumer boundaries
Evangelink aff2cf0
Preserve native public signing and friend assembly identities
Evangelink e09b5fe
Validate negative consumer failures from their TRX result nodes
Evangelink 4b6fa98
Preserve quoted consumer arguments through MSBuild properties
Evangelink 698f9ba
Prove native MSTest package consumers and satellite sensitivity
Evangelink 3a3d939
Add native netstandard and net462 compatibility variants
Evangelink 633efe3
Add opt-in engineering SDK registration for native Bazel
Evangelink bc934dc
Record native SDK 12 compiler and explorer evidence
Evangelink 8fa0c6d
Verify bounded and expanded native SDK compiler actions
Evangelink 6562a8a
Record verified SDK 12 package and runtime compatibility
Evangelink 39a9567
Pin isolated native Bazel test dependencies
Evangelink a6c666d
Run terminal contract and self-real tests natively with Bazel
Evangelink fe2870b
Record signed SDK 12 package and publisher validation
Evangelink 26b69b3
Record successful signed SDK and meta-package consumers
Evangelink 023ae49
Preserve Arcade source-root paths in native Bazel compilation
Evangelink abbe8a5
Verify signed native MSTest packages across real runtime consumers
Evangelink e849263
Document integrated native Bazel packages and compatibility validation
Evangelink edccfc9
Run aliased platform suites through native Bazel hosts
Evangelink 0f3039a
Add native Windows targeting to experimental Bazel rules
Evangelink 96af2d8
Build native Windows library flavors and app-model controllers
Evangelink ac7f755
Validate signed compatibility runtime closures
Evangelink 9bb8383
Record signed analyzer refresh contract
Evangelink 48bc17a
Record signed analyzer compiler-host validation
Evangelink 2e461b3
Run existing analyzer tests with a native aligned test host
Evangelink dcc2e17
Expose all native unit projects and document integrated Windows valid…
Evangelink c910ab8
Wire existing portable samples and native browser publishing
Evangelink 5b51cb1
Record native AOT boundary and final Bazel preservation evidence
Evangelink 0dcfbd1
Record final integrated Bazel source, consumer, and runtime validation
Evangelink 8b4fd8b
Add an independent Bazel build and test cache dogfood pipeline
Evangelink 9a3d23a
Respect older PowerShell environment semantics in verifier tests
Evangelink 3256890
Merge main to align native Bazel CI with the current source graph
Evangelink e42e589
Fix native Bazel CI dependency and test-host parity
Evangelink 037269f
Relaunch the compiled adapter trace host without MSBuild evaluation
Evangelink 03e3d35
Handle ANSI-styled output in native Bazel validation
Evangelink 3504d98
Cover central package changes and normalize trace child result paths
Evangelink dbcd61c
Merge current main for native server-client validation
Evangelink 3431ca7
Align Bazel server-client sources and fixtures with main
Evangelink d45cf09
Fix heading spacing in Bazel validation notes
Evangelink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .dotnet | ||
| .packages | ||
| artifacts | ||
| packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| startup --windows_enable_symlinks | ||
| common --enable_bzlmod | ||
| common --enable_runfiles | ||
| common --incompatible_strict_action_env | ||
| build --@rules_dotnet//dotnet:target_framework=net10.0 | ||
| # Preserve SDK-style transitive ProjectReference/PackageReference compilation. | ||
| build --@rules_dotnet//dotnet/settings:strict_deps=false | ||
| build --verbose_failures | ||
| test --test_output=errors | ||
|
|
||
| try-import %workspace%/.bazelrc.local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9.1.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| name: Experimental Bazel build | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - '.bazel*' | ||
| - 'BUILD.bazel' | ||
| - 'MODULE.bazel*' | ||
| - 'eng/bazel.ps1' | ||
| - 'eng/bazel/**' | ||
| - 'eng/Versions.props' | ||
| - '.editorconfig' | ||
| - 'src/**' | ||
| - 'test/**' | ||
| - 'samples/public/mstest-runner/Simple1/**' | ||
| - 'samples/public/TestingPlatformExamples/TestingPlatformExplorer/**' | ||
| - '.github/workflows/bazel.yml' | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: bazel-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| baseline: | ||
| name: Native Bazel matrix (${{ matrix.os }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [windows-latest, ubuntu-latest] | ||
| runs-on: ${{ matrix.os }} | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| persist-credentials: false | ||
| - name: Build, test, and validate native consumers | ||
| shell: pwsh | ||
| run: .\eng\bazel\validate.ps1 | ||
| - name: Validate native packages and self-contained runtimes | ||
| shell: pwsh | ||
| run: .\eng\bazel\validate-packages.ps1 | ||
| - name: Preserve native build evidence | ||
| if: always() | ||
| uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 | ||
| with: | ||
| name: bazel-${{ matrix.os }} | ||
| path: | | ||
| artifacts/bazel-validation/ | ||
| artifacts/bazel-package-validation/**/*.log | ||
| artifacts/bazel-package-validation/**/*.json | ||
| artifacts/bazel-package-validation/**/*.binlog | ||
| artifacts/bazel-package-validation/**/*.trx | ||
| artifacts/bazel-package-validation/**/feed/*.nupkg | ||
| if-no-files-found: warn | ||
| - name: Stop the worktree's Bazel server | ||
| if: always() | ||
| shell: pwsh | ||
| run: .\eng\bazel.ps1 shutdown | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,290 @@ | ||
| load("@rules_dotnet//dotnet:defs.bzl", "csharp_binary") | ||
| load("//eng/bazel:analyzer-packages.bzl", "analyzer_packages") | ||
| load("//eng/bazel:analyzer-tests.bzl", "analyzer_unit_tests") | ||
| load("//eng/bazel:analyzers.bzl", "analyzer_libraries") | ||
| load("//eng/bazel:compatibility-tests.bzl", "compatibility_reference_tests") | ||
| load("//eng/bazel:compatibility.bzl", "compatibility_libraries") | ||
| load("//eng/bazel:defs.bzl", "testfx_binary", "testfx_matrix", "testfx_test") | ||
| load("//eng/bazel:extension-tests.bzl", "extension_unit_tests") | ||
| load("//eng/bazel:extensions.bzl", "extension_libraries") | ||
| load("//eng/bazel:extra-tests.bzl", "extra_unit_tests") | ||
| load("//eng/bazel:mstest-packages.bzl", "native_mstest_packages") | ||
| load("//eng/bazel:mstest.bzl", "mstest_libraries") | ||
| load("//eng/bazel:packages.bzl", "native_packages") | ||
| load("//eng/bazel:platform.bzl", "platform_libraries") | ||
| load("//eng/bazel:reference-alias-tests.bzl", "reference_alias_tests") | ||
| load("//eng/bazel:sdk-packages.bzl", "sdk_packages") | ||
| load("//eng/bazel:server-client.bzl", "server_client_library") | ||
| load("//eng/bazel:samples.bzl", "portable_samples") | ||
| load("//eng/bazel:tests.bzl", "unit_tests") | ||
| load("//eng/bazel:windows.bzl", "windows_libraries") | ||
| load("//eng/bazel/windows:asset_selection_tests.bzl", "windows_asset_selection_tests") | ||
| load("//eng/bazel/windows:targeting_tests.bzl", "windows_targeting_test") | ||
|
|
||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| exports_files(["LICENSE"]) | ||
|
|
||
| platform_libraries() | ||
|
|
||
| mstest_libraries() | ||
|
|
||
| extension_libraries() | ||
|
|
||
| analyzer_libraries() | ||
|
|
||
| analyzer_packages() | ||
|
|
||
| server_client_library() | ||
|
|
||
| compatibility_libraries() | ||
|
|
||
| compatibility_reference_tests() | ||
|
|
||
| unit_tests() | ||
|
|
||
| extra_unit_tests() | ||
|
|
||
| extension_unit_tests() | ||
|
|
||
| analyzer_unit_tests() | ||
|
|
||
| native_packages() | ||
|
|
||
| portable_samples() | ||
|
|
||
| reference_alias_tests() | ||
|
|
||
| native_mstest_packages() | ||
|
|
||
| sdk_packages() | ||
|
|
||
| windows_libraries() | ||
|
|
||
| windows_asset_selection_tests() | ||
|
|
||
| windows_targeting_test( | ||
| name = "windows_targeting_test", | ||
| size = "small", | ||
| ) | ||
|
|
||
| filegroup( | ||
| name = "managed", | ||
| srcs = [ | ||
| ":adapter", | ||
| ":ai", | ||
| ":analyzers", | ||
| ":assert_generator", | ||
| ":azdo_report", | ||
| ":azure_foundry", | ||
| ":codefixes", | ||
| ":configuration", | ||
| ":crashdump", | ||
| ":ctrf", | ||
| ":framework", | ||
| ":framework_extensions", | ||
| ":github_report", | ||
| ":globalconfigs_generator", | ||
| ":hangdump", | ||
| ":hosting", | ||
| ":hotreload", | ||
| ":html", | ||
| ":junit", | ||
| ":logging", | ||
| ":msbuild_extension", | ||
| ":mstest_generator", | ||
| ":mstest_hosting", | ||
| ":opentelemetry", | ||
| ":packaged_app", | ||
| ":platform", | ||
| ":platform_msbuild", | ||
| ":platform_services", | ||
| ":retry", | ||
| ":server_client", | ||
| ":telemetry", | ||
| ":trx", | ||
| ":trx_abstractions", | ||
| ":video", | ||
| ":vstest_bridge", | ||
| ], | ||
| ) | ||
|
|
||
| testfx_matrix( | ||
| name = "managed_all", | ||
| target = ":managed", | ||
| ) | ||
|
|
||
| # Short executable labels avoid Windows' doubled runfiles batch-file paths. | ||
| # The other explorer cases intentionally demonstrate failures and skips. | ||
| csharp_binary( | ||
| name = "explorer_released", | ||
| srcs = ["//samples/public/TestingPlatformExamples/TestingPlatformExplorer:sources"], | ||
| out = "TestingPlatformExplorer", | ||
| appsetting_files = ["//samples/public/TestingPlatformExamples/TestingPlatformExplorer:TestingPlatformExplorer.testingplatformconfig.json"], | ||
| generate_documentation_file = False, | ||
| langversion = "preview", | ||
| nullable = "enable", | ||
| target_frameworks = ["net10.0"], | ||
| deps = [ | ||
| "@paket.main//microsoft.testing.extensions.trxreport", | ||
| "@paket.main//microsoft.testing.extensions.trxreport.abstractions", | ||
| "@paket.main//microsoft.testing.platform", | ||
| ], | ||
| ) | ||
|
|
||
| csharp_binary( | ||
| name = "explorer", | ||
| srcs = ["//samples/public/TestingPlatformExamples/TestingPlatformExplorer:sources"], | ||
| out = "TestingPlatformExplorer", | ||
| appsetting_files = ["//samples/public/TestingPlatformExamples/TestingPlatformExplorer:TestingPlatformExplorer.testingplatformconfig.json"], | ||
| generate_documentation_file = False, | ||
| langversion = "preview", | ||
| nullable = "enable", | ||
| target_frameworks = ["net10.0"], | ||
| deps = [ | ||
| ":platform", | ||
| ":trx", | ||
| ":trx_abstractions", | ||
| ], | ||
| ) | ||
|
|
||
| testfx_test( | ||
| name = "explorer_test", | ||
| size = "small", | ||
| args = [ | ||
| "--filter-uid", | ||
| "TestingPlatformExplorer.UnitTests.SomeTests.TestMethod1", | ||
| ], | ||
| binary = ":explorer", | ||
| ) | ||
|
|
||
| testfx_test( | ||
| name = "explorer_released_test", | ||
| size = "small", | ||
| args = [ | ||
| "--filter-uid", | ||
| "TestingPlatformExplorer.UnitTests.SomeTests.TestMethod1", | ||
| ], | ||
| binary = ":explorer_released", | ||
| ) | ||
|
|
||
| testfx_binary( | ||
| name = "simple1", | ||
| defines = ["TESTFX_REPORTS"], | ||
| generate_documentation_file = False, | ||
| linked_srcs = ["//eng/bazel:TestMain.cs"], | ||
| polyfills = False, | ||
| project = "samples/public/mstest-runner/Simple1", | ||
| deps = [ | ||
| ":adapter", | ||
| ":ctrf", | ||
| ":framework", | ||
| ":framework_extensions", | ||
| ":html", | ||
| ":junit", | ||
| ":trx", | ||
| ], | ||
| ) | ||
|
|
||
| testfx_test( | ||
| name = "simple1_test", | ||
| size = "small", | ||
| args = [ | ||
| "--minimum-expected-tests", | ||
| "1", | ||
| ], | ||
| binary = ":simple1", | ||
| ) | ||
|
|
||
| testfx_binary( | ||
| name = "framework_tests_app", | ||
| assembly_name = "Microsoft.VisualStudio.TestPlatform.TestFramework.UnitTests", | ||
| defines = ["TESTFX_INTERNAL_TESTS"], | ||
| exclude = ["test/UnitTests/TestFramework.UnitTests/Program.cs"], | ||
| generate_documentation_file = False, | ||
| linked_srcs = [ | ||
| "//eng/bazel:TestMain.cs", | ||
| "test/Utilities/DiagnosticAssertionObserver.cs", | ||
| ], | ||
| project = "test/UnitTests/TestFramework.UnitTests", | ||
| deps = [ | ||
| ":assert_generator", | ||
| ":framework", | ||
| ":framework_extensions", | ||
| ":internal_test_framework", | ||
| ":trx", | ||
| "@paket.source//awesomeassertions", | ||
| "@paket.source//moq", | ||
| "@paket.generator//microsoft.codeanalysis.csharp", | ||
| ], | ||
| ) | ||
|
|
||
| testfx_test( | ||
| name = "framework_tests", | ||
| size = "medium", | ||
| args = [ | ||
| "--minimum-expected-tests", | ||
| "1", | ||
| ], | ||
| binary = ":framework_tests_app", | ||
| ) | ||
|
|
||
| testfx_test( | ||
| name = "explorer_failure_probe", | ||
| size = "small", | ||
| args = [ | ||
| "--filter-uid", | ||
| "TestingPlatformExplorer.UnitTests.SomeTests.TestMethod2", | ||
| ], | ||
| binary = ":explorer", | ||
| tags = ["manual"], | ||
| ) | ||
|
|
||
| _PORTABLE_BASELINE_TESTS = [ | ||
| ":adapter_tests", | ||
| ":build_tools_tests", | ||
| ":explorer_released_test", | ||
| ":explorer_test", | ||
| ":framework_tests", | ||
| ":simple1_test", | ||
| ] | ||
|
|
||
| _PORTABLE_CONTRACT_TESTS = [ | ||
| ":protocol_contract_tests", | ||
| ":source_generation_tests", | ||
| ":vstest_bridge_tests", | ||
| ] | ||
|
|
||
| test_suite( | ||
| name = "baseline_tests", | ||
| tests = _PORTABLE_BASELINE_TESTS + [":platform_services_tests"], | ||
| ) | ||
|
|
||
| test_suite( | ||
| name = "portable_tests", | ||
| tests = [":baseline_tests"] + _PORTABLE_CONTRACT_TESTS, | ||
| ) | ||
|
|
||
| test_suite( | ||
| name = "portable_non_windows_tests", | ||
| tests = _PORTABLE_BASELINE_TESTS + _PORTABLE_CONTRACT_TESTS, | ||
| ) | ||
|
|
||
| test_suite( | ||
| name = "all_unit_tests", | ||
| tests = [ | ||
| ":adapter_tests", | ||
| ":analyzer_tests", | ||
| ":extension_tests", | ||
| ":framework_tests", | ||
| ":msbuild_tests", | ||
| ":platform_services_tests", | ||
| ":platform_tests", | ||
| ":protocol_contract_tests", | ||
| ":self_real_tests", | ||
| ":server_client_tests", | ||
| ":source_generation_tests", | ||
| ":terminal_contract_tests", | ||
| ":vstest_bridge_tests", | ||
| ], | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.