Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
81b676b
Add BuildXL CoreCLR test build (#78)
agocke May 13, 2026
15ca18b
Add BasicTestWithMcj to the BuildXL TieredCompilation slice (#79)
agocke May 14, 2026
f310a81
Upgrade BXL to ci.7 in workflow (#82)
agocke May 15, 2026
2288cda
Use @pkg labels for external packages, upgrade BXL to ci.7 (#81)
agocke May 15, 2026
93318db
Port all coreclr_test targets from bazel-main to BXL (#83)
agocke May 16, 2026
41a4c25
Add il_coreclr_test macro and port IL tests (~90% src/tests coverage)…
agocke May 18, 2026
49e73f7
Remove .github modifications
agocke May 19, 2026
b99d563
Remove workflow changes
agocke May 19, 2026
3bfd689
Use BXL for linux-x64 CoreCLR test build+run in CI
agocke May 19, 2026
3c3a1d7
Replace Transformer.writeAllLines with write_file rule
agocke May 20, 2026
7187830
Generate runner scripts via ctx.actions for Helix staging
agocke May 20, 2026
62696bf
Fix helixpublishbxl.proj missing Test target
agocke May 20, 2026
0da24cc
Fix prepare-helix-payload to find DLLs via runner metadata
agocke May 20, 2026
0155faa
Fix helixpublishbxl.proj CoreRootDirectory double path
agocke May 20, 2026
9bcc1da
Enable shared compilation with DOTNET_ROOT fix
agocke May 20, 2026
6aea95f
Add Roslyn compiler server diagnostic logging for BXL builds
agocke May 20, 2026
fe96e8d
Add Roslyn compiler server diagnostics to CI pipeline
agocke May 20, 2026
f19db82
Update bxl_rules_dotnet shared compilation fix
agocke May 21, 2026
4d5c99f
Stage BXL test runtime dependencies for Helix
agocke May 21, 2026
6b1ab7f
Preserve BXL test env vars on Helix
agocke May 21, 2026
fa189d3
Run staged BXL test entrypoints on Helix
agocke May 21, 2026
4d48ef7
Run staged BXL test scripts with bash
agocke May 21, 2026
78f9c5d
Temporarily skip BXL Helix execution
agocke May 21, 2026
d6e3cc6
Re-enable BXL Helix test execution
agocke May 21, 2026
2ad2df0
Update BuildXL toolset to ci.9
agocke May 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"commands": [
"slngen"
]
},
"agtest.bxl.tool": {
"version": "0.2.0-ci.9.9e337b3",
"commands": [
"bxl"
]
}
}
}
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,8 @@ test:.cs
*.tempLog.xml
*.testResults.xml
*.testStats.csv
Out/

# Bazel convenience symlinks
/bazel-*
MODULE.bazel.lock
1 change: 1 addition & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
one as a template. The following line is a marker to insert the test restore sources.
-->
<!-- TEST_RESTORE_SOURCES_INSERTION_LINE -->
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
Expand Down
92 changes: 92 additions & 0 deletions bxl.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
#!/bin/bash
# BuildXL wrapper — mirrors `bazel build` / `bazel test` subcommands.
#
# Usage:
# ./bxl.sh build [extra-bxl-args...] — compile everything (no test execution)
# ./bxl.sh test [extra-bxl-args...] — compile and run tests
set -euo pipefail

script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd -P)"

if [[ $# -eq 0 ]]; then
echo "Usage: ./bxl.sh <command> [args...]" >&2
echo "Commands:" >&2
echo " build Compile all targets (excludes test/binary execution)" >&2
echo " test Compile and run tests" >&2
exit 1
fi

command="$1"
shift

case "$command" in
build)
filter_expression="~(tag='bxl-kind:binary')and~(tag='bxl-kind:test')"
;;
test)
filter_expression="tag='bxl-kind:test'"
;;
*)
echo "ERROR: unknown command '$command'. Use 'build' or 'test'." >&2
exit 1
;;
esac

if [[ -n "${BXL_FILTER_APPEND:-}" ]]; then
filter_expression="(${filter_expression})and(${BXL_FILTER_APPEND})"
fi

default_bxl="$(command -v bxl || true)"
if [[ -z "$default_bxl" ]]; then
default_bxl="$HOME/code/BuildXL/Out/BootStrap/Microsoft.BuildXL.linux-x64.0.1.0-20260501.5/bxl"
fi

BXL="${BXL:-$default_bxl}"
CACHE_DIR="${BXL_CACHE_DIR:-${XDG_CACHE_HOME:-$HOME/.cache}/bxl}"

if [[ -z "${BUILDXL_BIN:-}" ]]; then
bxl_real="$(realpath "$BXL")"
bxl_dir="$(dirname "$bxl_real")"

if [[ -d "$bxl_dir/Sdk/Sdk.Transformers" ]]; then
BUILDXL_BIN="$bxl_dir"
else
case "$(uname -s)" in
Linux*) arch_dir="linux-x64" ;;
Darwin*) arch_dir="osx-x64" ;;
MINGW*|MSYS*|CYGWIN*) arch_dir="win-x64" ;;
*) echo "ERROR: unsupported host OS: $(uname -s)" >&2; exit 1 ;;
esac
rid_package="agtest.bxl.tool.$arch_dir"

for store_root in "$bxl_dir/.store" "$HOME/.dotnet/tools/.store"; do
[[ -d "$store_root" ]] || continue

while IFS= read -r candidate; do
if [[ -x "$candidate/bxl" && -d "$candidate/Sdk/Sdk.Transformers" ]]; then
BUILDXL_BIN="$candidate"
break 2
fi
done < <(find "$store_root" -type d -path "*/agtest.bxl.tool/*/$rid_package/*/tools/net*/$arch_dir" 2>/dev/null | sort -r)
done
fi
fi

if [[ -z "${BUILDXL_BIN:-}" ]]; then
echo "ERROR: could not locate BUILDXL_BIN for '$BXL'." >&2
exit 1
fi

export BUILDXL_BIN

cd "$script_dir"

exec "$BXL" \
"/c:${script_dir}/config.dsc" \
/server- \
/unsafe_DisableDetours+ \
/enableLinuxEBPFSandbox- \
/cacheDirectory:"$CACHE_DIR" \
/logOutput:FullOutputOnError \
"/f:${filter_expression}" \
"$@"
98 changes: 98 additions & 0 deletions config.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
// Root BuildXL configuration for the runtime repo test build.
//
// External rule SDKs are fetched via GitRepository/Download so the workspace
// can build against the latest pinned BuildXL rule snapshots without relying
// on sibling checkouts.
config({
resolvers: [
{
kind: "DScript",
modules: [
f`${Environment.getPathValue("BUILDXL_BIN")}/Sdk/Sdk.Prelude/package.config.dsc`,
f`${Environment.getPathValue("BUILDXL_BIN")}/Sdk/Sdk.Transformers/package.config.dsc`,
f`${Environment.getPathValue("BUILDXL_BIN")}/Sdk/Sdk.Deployment/module.config.dsc`,
f`${Environment.getPathValue("BUILDXL_BIN")}/Sdk/Sdk.Managed.Shared/module.config.dsc`,
]
},
{
kind: "GitRepository",
repositories: [
{
moduleName: "bxl_rules_repo",
owner: "agocke",
repository: "bxl_rules",
commit: "3ca4b303bfa7f761544dde16e0234761f457c9ce",
},
{
moduleName: "bxl_rules_dotnet_repo",
owner: "agocke",
repository: "bxl_rules_dotnet",
commit: "3145173d7a2a8cce1d25ede95e8608d90fdb8bb8",
},
],
},
{
kind: "DScript",
modules: [
// Repo-specific definitions
f`defs/module.config.dsc`,

// Common test support libraries
f`src/tests/Common/module.config.dsc`,

// Repo-specific test macro (like src/tests/live_test.bzl)
f`src/tests/coreclr_test/module.config.dsc`,

// Repo test root: owns all BUILD.dsc files under src/tests/
// (recursively, stopping at nested module boundaries like
// src/tests/Common/ and src/tests/coreclr_test/).
f`src/tests/module.config.dsc`
]
},
{
kind: "Download",
downloads: [{
moduleName: "DotNetSdk",
url: "https://ci.dot.net/public/Sdk/11.0.100-preview.5.26227.104/dotnet-sdk-11.0.100-preview.5.26227.104-linux-x64.tar.gz",
archiveType: "tgz",
}],
},
{
kind: "Nuget",
repositories: {
"nuget.org": "https://api.nuget.org/v3/index.json",
"dotnet-public": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json",
"dotnet-tools": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json",
"dotnet-eng": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json",
"dotnet11": "https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json"
},
packages: [
{ id: "Microsoft.NETCore.App.Ref", version: "11.0.0-preview.5.26264.105", tfm: ".NETCoreApp,Version=v11.0",
dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["*"] },
{ id: "Microsoft.DotNet.XUnitAssert", version: "3.2.2-beta.26211.102", tfm: ".NETCoreApp,Version=v10.0",
dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["*"] },
{ id: "xunit.extensibility.core", version: "2.9.3", tfm: ".NETStandard,Version=v1.1",
dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["*"] },
{ id: "Microsoft.DotNet.XUnitExtensions", version: "11.0.0-beta.26211.102", tfm: ".NETCoreApp,Version=v10.0",
dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["*"] },
{ id: "xunit.abstractions", version: "2.0.3", tfm: ".NETStandard,Version=v1.0",
dependentPackageIdsToSkip: ["*"], dependentPackageIdsToIgnore: ["*"] }
]
}
],

mounts: [
{
name: a`SourceRoot`,
path: p`.`,
trackSourceFileChanges: true,
isReadable: true
},
{
name: a`BuildXLSdk`,
path: p`${Environment.getPathValue("BUILDXL_BIN")}/Sdk`,
trackSourceFileChanges: true,
isReadable: true
}
]
});
128 changes: 128 additions & 0 deletions defs/defs.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

/**
* Repo-level definitions — pure label constants and external package map.
*
* Framework refs use labels that encode workspace-relative paths.
* External packages (NuGet, SDK) use @pkg//path:file labels resolved
* against the EXTERNAL_PACKAGES map.
*/

import * as Rules from "Sdk.Rules";

// ============================================================================
// EXTERNAL_PACKAGES — StaticDirectory map for @pkg label resolution
// ============================================================================

@@public
export const EXTERNAL_PACKAGES: Map<string, StaticDirectory> = Map.empty<string, StaticDirectory>()
.add("DotNetSdk", importFrom("DotNetSdk").extracted)
.add("Microsoft.NETCore.App.Ref", importFrom("Microsoft.NETCore.App.Ref").Contents.all)
.add("Microsoft.DotNet.XUnitAssert", importFrom("Microsoft.DotNet.XUnitAssert").Contents.all)
.add("xunit.extensibility.core", importFrom("xunit.extensibility.core").Contents.all)
.add("Microsoft.DotNet.XUnitExtensions", importFrom("Microsoft.DotNet.XUnitExtensions").Contents.all)
.add("xunit.abstractions", importFrom("xunit.abstractions").Contents.all);

// ============================================================================
// CORE_ROOT_REFPACK_DEPS — framework refs from Microsoft.NETCore.App.Ref
// Convention: @Microsoft.NETCore.App.Ref//ref/net11.0:<Name>.dll
// ============================================================================

function refLabel(name: string): Rules.Label {
return `@Microsoft.NETCore.App.Ref//ref/net11.0:${name}.dll`;
}

@@public
export const CORE_ROOT_REFPACK_DEPS: Rules.Label[] = [
refLabel("Microsoft.Win32.Primitives"),
refLabel("System.Collections"),
refLabel("System.Collections.Concurrent"),
refLabel("System.Collections.Immutable"),
refLabel("System.Collections.NonGeneric"),
refLabel("System.Collections.Specialized"),
refLabel("System.ComponentModel"),
refLabel("System.ComponentModel.Primitives"),
refLabel("System.Console"),
refLabel("System.Diagnostics.FileVersionInfo"),
refLabel("System.Diagnostics.Process"),
refLabel("System.Diagnostics.Tracing"),
refLabel("System.IO.MemoryMappedFiles"),
refLabel("System.Linq"),
refLabel("System.Memory"),
refLabel("System.Numerics.Vectors"),
refLabel("System.ObjectModel"),
refLabel("System.Reflection.Emit"),
refLabel("System.Reflection.Emit.ILGeneration"),
refLabel("System.Reflection.Emit.Lightweight"),
refLabel("System.Reflection.Metadata"),
refLabel("System.Reflection.Primitives"),
refLabel("System.Reflection.TypeExtensions"),
refLabel("System.Runtime"),
refLabel("System.Runtime.InteropServices"),
refLabel("System.Runtime.Intrinsics"),
refLabel("System.Runtime.Loader"),
refLabel("System.Runtime.Numerics"),
refLabel("System.Runtime.Serialization.Primitives"),
refLabel("System.Security.Cryptography"),
refLabel("System.Text.Encoding.Extensions"),
refLabel("System.Text.Encodings.Web"),
refLabel("System.Text.RegularExpressions"),
refLabel("System.Threading"),
refLabel("System.Threading.Overlapped"),
refLabel("System.Threading.Tasks.Parallel"),
refLabel("System.Threading.Thread"),
refLabel("System.Threading.ThreadPool")
];

// ============================================================================
// XUNIT_DEPS — xunit compile-time refs (label-based)
// ============================================================================

@@public
export const XUNIT_DEPS: Rules.Label[] = [
"@Microsoft.DotNet.XUnitAssert//lib/net10.0:xunit.assert.dll",
"@xunit.extensibility.core//lib/netstandard1.1:xunit.core.dll",
"@Microsoft.DotNet.XUnitExtensions//lib/net10.0:Microsoft.DotNet.XUnitExtensions.dll",
"@xunit.abstractions//lib/netstandard1.0:xunit.abstractions.dll"
];

// ============================================================================
// XUNIT_RUNTIME_DEPS — runtime files staged beside executable tests
// These are resolved File objects (not labels) because they are staged
// directly into the test output directory by the test runner.
// ============================================================================

@@public
export const XUNIT_RUNTIME_DEPS: File[] = [
EXTERNAL_PACKAGES.get("Microsoft.DotNet.XUnitAssert").assertExistence(r`lib/net10.0/xunit.assert.dll`),
EXTERNAL_PACKAGES.get("xunit.extensibility.core").assertExistence(r`lib/netstandard1.1/xunit.core.dll`),
EXTERNAL_PACKAGES.get("Microsoft.DotNet.XUnitExtensions").assertExistence(r`lib/net10.0/Microsoft.DotNet.XUnitExtensions.dll`),
EXTERNAL_PACKAGES.get("xunit.abstractions").assertExistence(r`lib/netstandard1.0/xunit.abstractions.dll`),
];

// CORE_ROOT paths used by BuildXL-backed CoreCLR test execution.
// Match the normal CoreCLR test flow: Checked runtime + Release libraries.
// ============================================================================

@@public
export const CORE_ROOT_DIR: Directory =
d`${Context.getMount("SourceRoot").path}/artifacts/tests/coreclr/linux.x64.Checked/Tests/Core_Root`;

@@public
export const CORE_ROOT_CORERUN: File =
f`${CORE_ROOT_DIR}/corerun`;

@@public
export const CORE_ROOT_ILASM: File =
f`${CORE_ROOT_DIR}/ilasm`;

// ============================================================================
// CORECLR_TEST_COMMON_DEPS — label-based deps baked into coreclr_test
// ============================================================================

@@public
export const CORECLR_TEST_COMMON_DEPS: Rules.Label[] = [
...CORE_ROOT_REFPACK_DEPS,
...XUNIT_DEPS
];
7 changes: 7 additions & 0 deletions defs/module.config.dsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

module({
name: "Defs",
nameResolutionSemantics: NameResolutionSemantics.implicitProjectReferences,
});
Loading