Skip to content

Add deterministic version bump script for sync pipeline#83

Merged
agocke merged 1 commit into
bazelfrom
fix/deterministic-version-bumps
Mar 16, 2026
Merged

Add deterministic version bump script for sync pipeline#83
agocke merged 1 commit into
bazelfrom
fix/deterministic-version-bumps

Conversation

@agocke
Copy link
Copy Markdown
Owner

@agocke agocke commented Mar 16, 2026

FixVersionBumps.cs: New C# script that deterministically updates Bazel NuGet version-pinned labels when eng/Version.Details.props bumps package versions. Parses the git diff, cross-references changed packages against paket/paket.main.bzl, and performs text replacement across MODULE.bazel, paket/paket.main.bzl, and all BUILD files that use versioned labels. No Copilot/AI needed — runs in <1s.

sync-upstream.sh: Insert version bump fix as Step 5 (before Copilot). The deterministic script handles version bumps reliably; Copilot (Step 6) now only handles non-version changes like new/removed files.

CopilotFixSync.cs: Fix unhandled TimeoutException from await using disposal by moving client/session into the try-catch scope. Add catch-all Exception handler. Simplify prompt to skip version bumps (now handled by FixVersionBumps.cs).

Tested against PR #82 diff: correctly produces 32 replacements across 9 files matching all version-pinned NuGet label occurrences.

FixVersionBumps.cs: New C# script that deterministically updates Bazel
NuGet version-pinned labels when eng/Version.Details.props bumps
package versions. Parses the git diff, cross-references changed
packages against paket/paket.main.bzl, and performs text replacement
across MODULE.bazel, paket/paket.main.bzl, and all BUILD files that
use versioned labels. No Copilot/AI needed — runs in <1s.

sync-upstream.sh: Insert version bump fix as Step 5 (before Copilot).
The deterministic script handles version bumps reliably; Copilot
(Step 6) now only handles non-version changes like new/removed files.

CopilotFixSync.cs: Fix unhandled TimeoutException from await using
disposal by moving client/session into the try-catch scope. Add
catch-all Exception handler. Simplify prompt to skip version bumps
(now handled by FixVersionBumps.cs).

Tested against PR #82 diff: correctly produces 32 replacements across
9 files matching all version-pinned NuGet label occurrences.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@agocke agocke force-pushed the fix/deterministic-version-bumps branch from 06c48d9 to 1216b76 Compare March 16, 2026 05:51
@agocke agocke merged commit 692e764 into bazel Mar 16, 2026
5 checks passed
@agocke agocke deleted the fix/deterministic-version-bumps branch March 16, 2026 06:23
agocke added a commit that referenced this pull request May 19, 2026
> [!NOTE]
> This PR was prepared with assistance from GitHub Copilot CLI.

## Summary

Onboards every `coreclr_test` target from the `bazel-main` branch into
BXL `BUILD.dsc` files under `src/tests/`. After this change `./bxl.sh
"/f:output='*.test.stamp'"` runs ~3,500 standalone CoreCLR tests in ~6
minutes (cold) / ~10s (cached).

## Changes

- **Generated 4,167 `coreclr_test` targets** across 1,690 new
`BUILD.dsc` files from the `bazel-main` `src/tests/**/BUILD.bazel`
definitions. `il_coreclr_test`, `coreclr_merged_test`, and
`live_csharp_library` are out of scope and skipped.
- **Extended the `coreclr_test` BXL macro**
(`src/tests/coreclr_test/coreclr_test.dsc`) to accept the extra Bazel
attributes (`pri`, `size`, `debugType`, `tags`, `targetCompatibleWith`,
`compilerOptions`, `testDeps`, `async_`, `flaky`, `nullable`,
`visibility`) and to skip tests tagged `manual` or marked `run: false`.
- **Added a 60s `timeout` wrapper** around `corerun` invocations in the
test runner script so a single hung test no longer stalls the whole
build.
- **Disabled 81 tests that fail to compile** locally (missing `.cs`
files that exist only on `bazel-main`, missing framework refs such as
`JSExport`, Roslyn benchmarks, etc.) — these are removed entirely.
- **Disabled 572 tests that fail at runtime** with `run: false`
(segfaults, asserts, exit-code mismatches; many are likely missing
`live_csharp_library` helpers or test-asset data files that are out of
scope here).
- **Tooling:**
- `eng/bxl/port_bazel_tests.py` — Bazel→BXL generator. Parses
`BUILD.bazel` via Python `ast`, expands `glob()`, classifies deps,
deduplicates exports across the shared `Tests` module namespace, skips
Linux-incompatible targets and cross-package srcs, preserves
hand-curated `BUILD.dsc` files.
- `eng/bxl/disable_failed_tests.py` — Reads `Out/Logs/BuildXL.Dev.log`
and either removes failing-compile targets (`--mode=build`) or sets
`run: false` on failing-runtime targets (`--mode=test`).

## Validation

- `./bxl.sh "/f:output='*.build.stamp'" /stopOnFirstError-` — **Build
Succeeded** (8174 pips)
- `./bxl.sh "/f:output='*.test.stamp'" /stopOnFirstError-` — **Build
Succeeded** (6946 pips, 100% cache after disable pass)

## Out of scope / follow-ups

- The 572 disabled runtime failures should be triaged individually; many
likely just need `live_csharp_library` helpers or test asset files
ported.
- `il_coreclr_test` (2552 targets) and `coreclr_merged_test` (37
targets) are not yet supported in BXL.

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant