Repository navigation
[build] Use dotnetup and standard solution build entrypoints - #13430
simonrozsival wants to merge 16 commits into
Conversation
90b278f to
31a6eba
Compare
Context: #13430 A source build with NUGET_PACKAGES pointing at a private cache reached workload installation, then failed with MSB3932 because the generated path joined the cache directory and package ID without a separator. NuGetPackageRoot can retain the environment-provided directory without a trailing slash. Use MSBuild EnsureTrailingSlash when generating dependency archive paths. Item evaluation with and without a trailing separator now produces identical paths, including the physically present archive from the failed build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #13430 Linux template tests in Azure build 1672175 fail with "No templates or subcommands found matching: android". The local workload installer preserves the uppercase Microsoft.Android.Templates archive filename when copying it into template-packs, but the SDK workload resolver requires a lowercase package ID and version. Case-insensitive hosts conceal the mismatch. Copy template and library archives to the existing canonical PackageFileName instead of preserving the source basename. A generated two-pack Install fixture verifies the exact directory entries and copied bytes for mixed-case package IDs and prerelease versions; both unchanged Install batches skip without copying again. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #13430 A source build with NUGET_PACKAGES pointing at a private cache reached workload installation, then failed with MSB3932 because the generated path joined the cache directory and package ID without a separator. NuGetPackageRoot can retain the environment-provided directory without a trailing slash. Use MSBuild EnsureTrailingSlash when generating dependency archive paths. Item evaluation with and without a trailing separator now produces identical paths, including the physically present archive from the failed build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
410cf2a to
274adf6
Compare
Context: #13430 Linux template tests in Azure build 1672175 fail with "No templates or subcommands found matching: android". The local workload installer preserves the uppercase Microsoft.Android.Templates archive filename when copying it into template-packs, but the SDK workload resolver requires a lowercase package ID and version. Case-insensitive hosts conceal the mismatch. Copy template and library archives to the existing canonical PackageFileName instead of preserving the source basename. A generated two-pack Install fixture verifies the exact directory entries and copied bytes for mixed-case package IDs and prerelease versions; both unchanged Install batches skip without copying again. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #13430 A source build with NUGET_PACKAGES pointing at a private cache reached workload installation, then failed with MSB3932 because the generated path joined the cache directory and package ID without a separator. NuGetPackageRoot can retain the environment-provided directory without a trailing slash. Use MSBuild EnsureTrailingSlash when generating dependency archive paths. Item evaluation with and without a trailing separator now produces identical paths, including the physically present archive from the failed build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #13430 Linux template tests in Azure build 1672175 fail with "No templates or subcommands found matching: android". The local workload installer preserves the uppercase Microsoft.Android.Templates archive filename when copying it into template-packs, but the SDK workload resolver requires a lowercase package ID and version. Case-insensitive hosts conceal the mismatch. Copy template and library archives to the existing canonical PackageFileName instead of preserving the source basename. A generated two-pack Install fixture verifies the exact directory entries and copied bytes for mixed-case package IDs and prerelease versions; both unchanged Install batches skip without copying again. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
274adf6 to
445169e
Compare
There was a problem hiding this comment.
🟡 Changes recommended
The skill-runner workflow still invokes the deleted eng/install-dotnet.sh, causing its prerequisite step to fail before the agent starts.
2 open issues
What changed in this PR
This PR moves .NET for Android development to a shared, pinned SDK managed by dotnetup, with solution-level build and packaging entrypoints. Android and MAUI workload files remain isolated within each worktree.
Changes:
- Moves preparation, additional API-level builds, workload setup, and packaging into solution targets; removes Make and legacy build/install scripts.
- Adds local workload dependency resolution and updates wrappers to select source or extracted packs, including the previous Android SDK needed for compatibility tests.
- Migrates CI, signing, automation, and contributor documentation to the new commands and SDK layout.
| File | Description |
|---|---|
src/Xamarin.Installer.Build.Tasks/README.md |
Updates installer testing commands and workload paths. |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Common/TestEnvironment.cs |
Resolves shared runtime and worktree-local pack locations. |
Makefile |
Removes Make entrypoints. |
global.json |
Pins the shared SDK and Arcade tool selection. |
eng/README.md |
Documents SDK selection, CI, and signing setup. |
eng/install-dotnet.sh |
Removes the per-worktree Unix SDK installer. |
eng/install-dotnet.ps1 |
Removes the per-worktree Windows SDK installer. |
dotnet-local.sh |
Selects local workload roots and forwards through dotnetup. |
dotnet-local.cmd |
Adds equivalent Windows workload selection and forwarding. |
Documentation/workflow/UnitTests.md |
Updates test commands and configuration guidance. |
Documentation/workflow/DevelopmentTips.md |
Updates local feeds and MAUI installation guidance. |
Documentation/project-docs/ExploringSources.md |
Updates build configuration and dependency-cache descriptions. |
Documentation/Java.Interop/BuildConfiguration.md |
Updates preparation and standalone testing commands. |
Documentation/building/windows/instructions.md |
Documents standard Windows build, pack, and test entrypoints. |
Documentation/building/unix/instructions.md |
Replaces Make instructions with solution-based commands. |
Documentation/building/unix/dependencies.md |
Updates SDK installation and prerequisite guidance. |
Documentation/building/configuration.md |
Updates the prerequisite command for integration tests. |
Directory.Build.props |
Derives dotnet paths from the running SDK. |
build.sh |
Removes the Unix build dispatcher. |
build.cmd |
Removes the Windows build dispatcher. |
build-tools/xa-prep-tasks/Xamarin.Android.BuildTools.PrepTasks/GitBranch.cs |
Uses current-branch detection with detached-HEAD fallback. |
build-tools/workload-tools/workload-tools.csproj |
Adds an SDK-resolver-backed workload utility. |
build-tools/workload-tools/Program.cs |
Generates pack installation plans and finalizes extracted files. |
build-tools/scripts/runtime-helpers.mk |
Removes obsolete runtime rebuild shortcuts. |
build-tools/scripts/Prepare.proj |
Removes private SDK installation from preparation. |
build-tools/scripts/Packaging.mk |
Removes Make packaging shortcuts. |
build-tools/scripts/msbuild.mk |
Removes Make’s MSBuild abstraction. |
build-tools/scripts/DotNet.targets |
Removes legacy orchestration and localizes MAUI installation. |
build-tools/scripts/BuildEverything.mk |
Removes Make’s full-build orchestration. |
build-tools/create-packs/Microsoft.Android.Ref.proj |
Includes binding XML documentation only when present. |
build-tools/create-packs/Directory.Build.targets |
Updates packaging flags, extraction paths, and cleanup. |
build-tools/create-packs/ConfigureLocalWorkload.targets |
Restores and installs dependencies into local workload roots. |
build-tools/automation/yaml-templates/variables.yaml |
Separates tooling runtime and target-framework versions. |
build-tools/automation/yaml-templates/use-dot-net.yaml |
Removes the previous SDK provisioning template. |
build-tools/automation/yaml-templates/stage-xamarin-android-tools-tests.yaml |
Migrates host-tool builds, tests, and result publication. |
build-tools/automation/yaml-templates/stage-package-tests.yaml |
Updates bootstrap commands and wrapper configuration. |
build-tools/automation/yaml-templates/stage-linux-tests.yaml |
Passes workload configuration to wrapper tests. |
build-tools/automation/yaml-templates/setup-test-environment.yaml |
Forwards the tooling runtime version. |
build-tools/automation/yaml-templates/setup-test-environment-steps.yaml |
Uses shared SDK setup and dotnetup prerequisite builds. |
build-tools/automation/yaml-templates/setup-test-environment-public.yaml |
Updates public test setup parameters. |
build-tools/automation/yaml-templates/run-sliced-nunit-tests.yaml |
Launches the test slicer through dotnetup. |
build-tools/automation/yaml-templates/run-nunit-tests.yaml |
Preserves NUnit arguments and explicitly publishes results. |
build-tools/automation/yaml-templates/run-maui-r2r-helix-matrix.yaml |
Updates workload selection and Helix submission commands. |
build-tools/automation/yaml-templates/run-dotnet-preview.yaml |
Supports shared SDK or local-workload execution. |
build-tools/automation/yaml-templates/install-repository-sdk.yaml |
Adds shared SDK and tooling runtime provisioning. |
build-tools/automation/yaml-templates/install-dotnet-tool.yaml |
Installs tools through dotnetup from the checkout. |
build-tools/automation/yaml-templates/commercial-build.yaml |
Uses solution build and pack commands. |
build-tools/automation/yaml-templates/build-windows-steps.yaml |
Migrates Windows preparation, builds, and packaging. |
build-tools/automation/yaml-templates/build-macos.yaml |
Updates the signing command to use dotnetup. |
build-tools/automation/yaml-templates/build-macos-steps.yaml |
Migrates macOS SDK setup, builds, and packaging. |
build-tools/automation/yaml-templates/build-linux-steps.yaml |
Migrates Linux SDK setup, builds, and packaging. |
build-tools/automation/yaml-templates/apk-instrumentation.yaml |
Selects the pinned SDK CLI and local workloads for device tests. |
build-tools/automation/dnceng/arcade/Workloads.proj |
Removes the separate Swix project restore. |
build-tools/automation/dnceng/arcade/vsman/Workload.vsmanproj |
Makes the manifest project SDK-free. |
build-tools/automation/dnceng/arcade/vsman/global.json |
Removes the obsolete SDK 8 pin. |
build-tools/automation/azure-pipelines.yaml |
Migrates MAUI validation and publishing commands. |
build-tools/automation/azure-pipelines-public.yaml |
Updates public pipeline SDK and workload usage. |
build-tools/automation/azure-pipelines-nightly.yaml |
Collects API-scan inputs from extracted workload packs. |
build-tools/automation/azure-pipelines-internal.yaml |
Updates signing runtimes, Arcade setup, and MAUI validation. |
build-tools/automation/azure-pipelines-apidocs.yaml |
Migrates documentation tooling and generation commands. |
before.Microsoft.Android.sln.targets |
Adds automatic preparation before solution builds. |
after.Microsoft.Android.sln.targets |
Adds solution Pack and post-build workload setup. |
.github/workflows/nightly-fix-finder.md |
Updates automated-fix validation instructions. |
.github/workflows/nightly-fix-finder.lock.yml |
Updates generated workflow body-hash metadata. |
.github/workflows/copilot-setup-steps.yml |
Bootstraps dotnetup and builds the solution. |
.github/skills/update-androidsdk-packages/SKILL.md |
Updates SDK-package validation commands. |
.github/skills/tests/SKILL.md |
Updates test entrypoints and workload prerequisites. |
.github/skills/tests/references/test-catalog.md |
Updates test commands and configuration examples. |
.github/skills/local-build/SKILL.md |
Replaces Make-based build and troubleshooting guidance. |
.github/copilot-instructions.md |
Aligns contributor guidance with the new build workflow. |
Review effort: Balanced
|
/review |
|
✅ Android PR Reviewer completed successfully!
|
There was a problem hiding this comment.
⚠️ Needs Changes
Findings: 1 ❌ error · 0
Reviewed d0aa1bfd5acddd0a12ce10ae6675c1bf752d8b6c against the PR base, including full-file context and the documentation/workflow updates. The shared-SDK/worktree-local-workload separation is well structured, reuses the SDK workload resolver, preserves the previous Android SDK dependency, and makes native/Java cleanup independent of installed build tools. One workflow regression remains: the SDK-package update skill still invokes required helpers through bare dotnet after bootstrap stopped exposing the pinned SDK on PATH. The inline comment identifies all affected invocations and the correction.
CI: Azure build 1698831 was still running when checked. The macOS build, both Android Tools test jobs, and CLA had passed; Windows/Linux builds and the remaining test matrix were not complete. No failing GitHub check was returned at that point, but this is not a green-CI verdict. Detailed Azure build/timeline retrieval was unavailable because the Azure CLI failed and required authentication.
Validation limits: Source/configuration review only; no local build or test result is claimed. The repository-pinned SDK and dotnetup were unavailable in this environment, and the attempted wrapper syntax check was denied.
Generated by Android PR Reviewer for #13430 · copilot · gpt61 · 152.3 AIC · ⌖ 7.97 AIC · ⊞ 20.3K
Comment /review to run again
Context: #13430 Context: #13780 A review found missing `external/android-api-docs` initialization in 22 local agent sessions. Fresh worktree builds fail late when `Mono.Android.xml` cannot be produced, even though the Unix and Windows build guides say preparation updates submodules. The `Prepare` target did not actually run that step. Run `git submodule update --init -- external/android-api-docs` from the repository root before the bootstrap builds. Both `make prepare` and solution preparation on Windows use this target. Git checks out the pinned submodule revision rather than following its upstream branch; when already at that revision, no checkout is needed. Initialization or checkout errors stop preparation instead of surfacing much later. Update the build guides to name the submodule explicitly. ### Relationship to other changes #13780 already merged agent-facing manual initialization guidance. This change addresses the build itself and contains no `.github/` edits, so it does not overlap the open `[copilot]` PRs (#13766, #13778, #13782, #13783, #13784, #13785). #13430 replaces preparation entry points but retains the `Prepare` target and does not initialize this submodule. Its `Prepare.proj` hunk was checked to apply on top of this change. It also rewrites both guide paragraphs edited here; if this merges first, keep #13430's replacement guide wording when resolving those documentation conflicts.
Replace Make and private SDK installers with an SDK pinned in global.json and selected by dotnetup. Run preparation and local workload configuration from solution build hooks, and expose product packaging through the standard solution Pack target. Keep SDK binaries shared while isolating Android and MAUI workloads inside each worktree. Reduce dotnet-local to workload selection and argument forwarding, and use it in CI only where local workloads are required. Update build and test documentation to match. Use the checked-out branch when GitBranch runs in a worktree so packages and workload manifests receive consistent versions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the SDK argument separator through dotnetup so NUnit run settings and tool arguments reach their intended parsers. Avoid quoting trailing Windows directory separators in workload dependency resolution. Configure source workloads for solution builds on CI as well as local builds. Disable the CLI MSBuild server in the minimal local-workload wrappers so a previously cached resolver cannot select manifests from another workload root. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
CI SDKs can already contain every workload dependency. The generated plan then has no _WorkloadPack items, but its Install target still invokes Unzip with an empty DestinationFolder and fails with MSB4044. Skip the target when the plan has no packs, preserving installation for nonempty plans. Reproduced the empty-plan failure locally before the fix, verified the guarded plan succeeds without Unzip execution, and verified a four-pack source dependency installation still runs successfully. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
CI installed the SDK pinned by global.json, but workload resolution used the dependency package version from the merged main branch. That SDK directory did not exist, so the resolver silently omitted host-specific Android and MonoTargets packs. Extraction appeared successful, then app and test builds failed with NETSDK1147 or missing SDK directories. Use NETCoreSdkVersion, as the workload feature-band calculation already does, and reject nonexistent SDK directories before resolving packs. A local mismatched-version reproduction confirmed the missing host packs; the corrected MSBuild target produced the complete plan, and a legitimate empty-plan Install still succeeds. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #13430 A source build with NUGET_PACKAGES pointing at a private cache reached workload installation, then failed with MSB3932 because the generated path joined the cache directory and package ID without a separator. NuGetPackageRoot can retain the environment-provided directory without a trailing slash. Use MSBuild EnsureTrailingSlash when generating dependency archive paths. Item evaluation with and without a trailing separator now produces identical paths, including the physically present archive from the failed build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1672175 The worktree-local installer uses MSBuild Unzip instead of the SDK workload installer. Unzip preserves zone-less ZIP entry timestamps, so files packed on another agent can be extracted into the future. CI consequently rebuilt unchanged SDK and reference inputs on every invocation: AutoImport.props invalidated Android targets, and Java.Interop.dll forced CoreCompile to run again. Finalize each unpacked workload pack by clamping only future file timestamps to the current UTC time before applying Unix permissions. Existing older timestamps, file contents and modes remain unchanged; packed template and library archives are unaffected. The generated-install fixture reproduces future inputs with the old tool, verifies the timestamp correction and permission preservation, and skips an unchanged installation. After real extraction under America/Los_Angeles, retained ordinary and unchanged CoreCLR app build logs show CoreCompile, Java stubs, Java compilation and Dalvik compilation correctly skipped on the second build. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Context: #13430 Linux template tests in Azure build 1672175 fail with "No templates or subcommands found matching: android". The local workload installer preserves the uppercase Microsoft.Android.Templates archive filename when copying it into template-packs, but the SDK workload resolver requires a lowercase package ID and version. Case-insensitive hosts conceal the mismatch. Copy template and library archives to the existing canonical PackageFileName instead of preserving the source basename. A generated two-pack Install fixture verifies the exact directory entries and copied bytes for mixed-case package IDs and prerelease versions; both unchanged Install batches skip without copying again. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Update the newly added local-build skill for the shared SDK and standard solution build entrypoints. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Host-side tools targeting earlier frameworks need their runtimes, not separate SDK installations. Keep the repository-pinned SDK as the single build SDK and install the .NET 11 runtime independently of the stable tooling target framework. Use the same SDK for the isolated Arcade signing adapter, preserve its global.json pin, and publish the resolved shared dotnet root to Arcade. Install the .NET 8 runtime for SwixBuild. Make the manifest project SDK-free and remove its obsolete SDK 8 pin and redundant restore, so desktop MSBuild does not need to import the newer SDK. Validation: git diff --check passed. Parsed 48 pipeline YAML files and both signing XML projects; checked 29 affected template calls, runtime pins, signing working directories and obsolete-variable removal. Compared all six PowerShell scripts and the property-query project with the previously accepted V5 inputs; they remain unchanged apart from checkout line endings. The earlier V5 check parsed representative parameter-rendered scripts and evaluated MSBuildToolsPath successfully. Actual provisioning and Windows Swix/signing were not run; no new managed validation phase was executed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep SDKs, runtimes, and dotnetup metadata shared across worktrees while making CI installation explicitly noninteractive. Log the selected tool's path and version so differences between cached agent tools are visible. Resolve the first application match once and invoke that executable for the entire setup step; Get-Command can otherwise return multiple paths. Apply the same noninteractive option to signing's .NET 8 runtime install. Validation: the installed dotnetup accepts all three install argument sets with --help. An extracted PowerShell step harness passed seven stubbed success/failure cases, including paths with spaces, multiple application matches, command order, and native exit propagation. All 48 pipeline YAML documents parse, and git diff --check passed. No SDK/runtime installation or Windows signing execution was performed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Darc already updates tools.dotnet and an existing sdk.version together when Arcade brings a newer bootstrap SDK. Setting tools.pinned disables both updates and leaves the shared SDK selection stuck. Remove that opt-out without changing the currently selected SDK. Document that automatic updates follow Arcade's bootstrap SDK, not the produced Microsoft.NET.Sdk dependency, and never downgrade to an older version. Validation: JSON parsing and a semantic comparison against the parent passed: tools.pinned is the only removed setting, both SDK version fields remain equal, and the resolver policy is unchanged. git diff --check passed. No SDK installation or build was needed because the selected SDK and build inputs are unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Normal solution Pack also builds, so mark its Build dependency before local workload configuration and preserve extracted workloads in that context. Keep ordinary Build/Rebuild cleanup unchanged. Condition preparation and finalization on build-enabled Mono.Android solution references so host-only filters skip both hooks and their dependencies. Replace the deleted skill-runner installer invocation with dotnetup and regenerate its workflow lock using the existing compiler. Validated the generator solution filter and BootstrapTasks builds, nine focused MSBuild regression cases, and six isolated bootstrap success/failure cases. Normal workflow compilation passed; diagnostic dry-run failed on existing token-pool shellcheck findings. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Solution Clean deleted shared Android SDK/NDK and JDK installations and cached downloads. Native cleanup also invoked Ninja in potentially missing CMake directories, while Java utility cleanup required Gradle. Preserve shared toolchains and cached archives. Initialize native flavor paths before removing generated intermediates and per-RID outputs, without deleting a custom output root. Remove local Java build directories directly and correct aapt2 cleanup to delete executables rather than directories. Document the selected-configuration Clean entrypoint. Validation on macOS: both commands passed, including repeated Debug cleanup and cleanup after the generator build: * dotnetup dotnet clean Microsoft.Android.slnx -c Debug -m:2 -nr:false -v:minimal * dotnetup dotnet clean Microsoft.Android.slnx -c Release -m:2 -nr:false -v:minimal DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 dotnetup dotnet build src/generator/generator.slnf -c Debug -m:2 -nr:false -v:minimal passed with 38 existing SourceLink/repository-information warnings and no errors. A temporary regression harness passed all 17 actual-project MSBuild invocations, including missing native/Java tools, repeated cleanup, flavor/configuration/output-root isolation, and preservation of 21 owned shared-tool sentinels. An additional aapt2 custom-output-path probe passed. XML parsing and git diff --check passed. Windows, full SDK rebuild, product packaging, and device tests were not run for this Clean-only correction. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Installing the pinned SDK through dotnetup does not make the runner preinstalled dotnet select that shared installation. The selected SDK-update skill still used bare dotnet run, so its file-based helpers could fail exact SDK selection after removal of the PATH override. Forward all eight helper invocations through dotnetup. Keep workflow guidance, the package-catalog reference, and helper usage comments/messages consistent. Preserve shared installation selection and existing helper logic; regenerate the workflow lock with the matching compiler, changing only its body hash. Validation: gh-aw v0.92.0 compile skill-runner --no-check-update passed with the existing missing concurrency.job-discriminator warning. Static checks passed for all eight commands, no remaining bare-dotnet helper guidance in the selected skill/workflow, and unchanged executable lock contents; git diff --check passed. Diagnostic compile skill-runner --dry-run --no-check-update emitted a diagnostic lock but failed on existing token-pool SC2206/SC2004. No workflow was dispatched. Helper execution and publication remain pending: the scoped security reviewer found no confirmed new vulnerability but returned incomplete coverage. Its synchronous invocation cannot accept the necessary follow-up, so no unreviewed harness execution or upload was performed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The SDK dependency's package version can differ from the SDK selected by global.json. Installing extracted Android or MAUI manifests under the dependency's feature band makes them invisible to the running SDK. MTP-only test global.json files also hide the root SDK pin when commands run from test directories. Reuse the running-SDK feature-band calculation for manifest installation, Android manifest lookup, and workload-plan inputs. Preserve the dependency band for selecting the MAUI NuGet package. Resolve the repository-pinned SDK in dotnet-local before forwarding SDK commands in the caller's directory; preserve test-runner settings and direct host execution. Update the related build/test guidance and forward the remaining sliced-test example through dotnetup. Validation: DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 dotnetup dotnet build src/generator/generator.slnf -c Debug --no-restore -m:2 -nr:false -v:minimal passed with no warnings or errors. All 19 isolated SDK/manifest/wrapper probes and nine solution-orchestration probes passed. bash -n dotnet-local.sh, shellcheck dotnet-local.sh, and git diff --check passed. Windows wrapper execution was unavailable on macOS; no full SDK rebuild, product packaging, or device testing is claimed. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
b16dc10 to
e6a51ab
Compare
Keep the shared dotnetup SDK entrypoints while adopting the MSTest/MTP templates and test guidance. Forward project selection with --project and run assembly discovery and slices through dotnetup. Validated the solution configuration, CI YAML and PowerShell syntax, the BaseTasks suite (167 passed, 4 Windows-only skips), and the MSTest CI template slice (84 passed, 2 skips). Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Building
Microsoft.Android.slnxalone previously omitted preparation, additional API levels, and development-workload configuration supplied by Make. Packaging had another custom entrypoint, and each worktree installed a private .NET SDK.Move this orchestration into the solution so the developer entrypoints become:
Remove Make, its helper files, the root build scripts, and
eng/install-dotnet.{sh,ps1}rather than retaining forwarding layers.Share the SDK, not the development workload
Pin SDK selection in
global.jsonand use dotnetup's shared installation. Keep dotnetup metadata and SDK/runtime files shared across worktrees; do not introduce a checkout-specific installation or metadata directory. Prepare before solution Build/Rebuild, then build additional API levels and configure the local workload afterward. Gate both entire hooks, including their dependencies, on build-enabledMono.Androidproject references so host-only solution filters and configurations that disable Android skip those phases.Android and MAUI manifests and packs remain worktree-local: resolve dependencies through the SDK workload resolver and restore/extract them into the worktree, not the shared SDK. Preserve the previous Android SDK installation required by #13406.
Keep
dotnet-local.shand.cmdfor selecting local manifests/packs and forwarding through dotnetup. Select the repository root's pinned SDK CLI explicitly while retaining the caller's working directory and test-runner settings: a nested MTP-onlyglobal.jsonotherwise hides the root SDK pin. Preserve host commands such as explicitexecand runtime/SDK listing. Prefer extracted distribution workloads when present, otherwise source output.CONFIGURATIONselects the workload configuration, defaulting to Debug; the application's-cremains independent. Disable MSBuild-server reuse in the wrappers to avoid reusing a workload resolver initialized against another manifest root.Use the actual running SDK's feature band for source/extracted Android manifests, resolver inputs, and local MAUI installation. The dependency package's band still selects the MAUI NuGet package; it must not select the installed manifest directory. Share this calculation with non-SDK preparation projects, which obtain the version from
MSBuildBinPathwhenNETCoreSdkVersionis unavailable.Let Maestro update the SDK selection
Leave
tools.pinnedunset. During Arcade dependency updates, darc/Maestro already advances bothtools.dotnetand an existingsdk.versiontogether when the incoming bootstrap SDK is newer. Settingtools.pinned: truewould disable both updates. Keep the two current version fields equal without changing the selected SDK in this correction.This policy follows Arcade's bootstrap SDK, not the produced
Microsoft.NET.Sdkdependency ineng/Version.Details.xml. Those versions may differ, and an older or equal incoming bootstrap SDK does not change the selection. Removingtools.pinneddoes not immediately bump the current SDK. No custom synchronization script or workflow is introduced. See the darc updater implementation and the review discussion.No dedicated prose documentation for
tools.pinnedwas found; the implementation above is the authoritative reference. It is separate from the per-dependencyPinned="true"attribute ineng/Version.Details.xml, documented in Darc: "Pinning" dependencies so they do not update. The former freezes automatic SDK-selection updates; the latter excludes an individual dependency from automatic updates and defaults to false. Removingtools.pinneddoes not unpin any XML dependency.Use one SDK and install older runtimes separately
CI installs the repository SDK from
global.jsonand the older .NET 11 runtime needed by host-side tests/tools, rather than installing another SDK. Keep runtime versions distinct from the stable tooling target-framework version.Internal signing uses the same installer plus a .NET 8 runtime for SwixBuild. Preserve the Arcade adapter's copied
global.json, derive the actual shared SDK root for Arcade, and set its working directories explicitly. Make the Swix manifest project SDK-free and remove its obsolete SDK 8 pin and redundant restore.Log the selected dotnetup executable path and version, choose the first application match when several installations are on
PATH, and invoke that same executable throughout setup. Pass--interactive falseexplicitly to SDK/runtime installation. Preserve shared installation selection and explicit native exit-code propagation.Keep existing packaging and CI contracts
Route solution Pack to the existing packaging projects. Build first unless
--no-buildis supplied, propagate that option to child packaging commands, and preserve extracted workloads while packing. Set a private packing-context flag before the Build dependency runs and forward it to local-workload configuration. Ordinary Build/Rebuild and explicit workload extraction retain their cleanup behavior.Preserve NUnit's inner separator through dotnetup with an explicit outer separator, terminate quoted Windows directories with
., and retain CI source-workload prerequisites. Adapt upstream'sRunSlicedTests.csinvocation without restoring the removed slicer installation.Update skill-runner's existing bootstrap to acquire dotnetup, install the pinned SDK noninteractively, and forward BootstrapTasks through dotnetup instead of the deleted installer/private
DOTNET_ROOT. All eight selected SDK-update skill examples, its package-catalog reference, three helpers' usage guidance, and the workflow example now usedotnetup dotnet run. Regenerate the existing lock with gh-aw v0.92.0 without changing permissions, guards, credentials, or network policy. The latest helper-guidance correction changes only lock metadata, not executable YAML; Patterns feedback is addressed and resolved.Guard genuinely empty dependency installation plans while preserving nonempty installation. Reject nonexistent SDK directories and normalize
NuGetPackageRootwithEnsureTrailingSlash. Usegit rev-parse --abbrev-ref HEADfor worktree branch detection, retaining detached-HEAD fallback and CI override. Clamp only future extracted-file timestamps before restoring Unix permissions; preserve older timestamps, bytes, and modes. Use canonical lowercase packed template/library archive filenames for case-sensitive hosts.Clean outputs without deleting shared tooling
Solution Clean previously removed shared Android SDK/NDK components, license state, the JDK, and cached downloads. Native Clean invoked Ninja in potentially missing CMake directories; Java cleanup required Gradle.
Preserve shared toolchain installations and download caches, including bundletool. Initialize native flavor paths before removing generated intermediates and per-RID outputs; preserve unrelated custom-output files and other flavors/configurations. Remove local Java build directories directly instead of invoking Gradle, and delete aapt2 executables rather than directories. Native cleanup no longer requires Ninja or a configured CMake tree. Document Unix/Windows Clean;
-c Releaseselects Release outputs, not a full checkout reset.Fresh-worktree validation and timings
Both complete Debug builds passed in separate, initially clean worktrees with no
bin/orobj/. Main:6716a791b0df0c03da026cddccbd8b977991579c; candidate:b16dc101226746bb7feaabc2d0d85111d47b9b19. The identical API-docs submodule (5c4a6502e1c5feb0fa6fdc594f3763d353f071a1) was initialized before timing.Main commands, both exit 0:
make install-dotnet CONFIGURATION=Debug make CONFIGURATION=Debug 'MSBUILD_ARGS=-m:4 -nr:false -v:minimal' prepare leeroyCandidate commands, both exit 0:
dotnetup sdk install --no-progress --interactive false dotnetup dotnet build Microsoft.Android.slnx -c Debug -m:4 -nr:false -v:minimal -bl:bin/BuildDebug/fresh-checkout.binlogMain downloaded a 188,406,361-byte SDK archive and created a 548 MiB private installation; its elapsed setup includes failed primary-download attempts before the successful fallback. Candidate reported the SDK already installed and created no private
dotnethost,sdk/, orshared/tree. It saved the observed SDK-acquisition work, but this pair was slower overall on the branch; no end-to-end speedup is established.Method: Apple M5 Max, 18 logical CPUs, 64 GiB RAM, macOS 26.7.3 arm64; Debug,
-m:4 -nr:false, main first, one fresh-output run each. Python monotonic wall time surrounds each command. Checkout/submodule setup is excluded; combined times sum the two command measurements, not gaps between commands. Main's preparation repeats the idempotent SDK-install check. Shared NuGet, Android toolchain, archive, and filesystem caches were retained, not cleared; main can warm caches for the candidate. Main selected SDK12.0.100-alpha.1.26556.115, candidate selected the already-installed bootstrap SDK12.0.100-alpha.1.26551.101; main also contains source changes after the branch merge base. Other sessions were active, including two reported overlapping builds late in the candidate run. These are contended observations, not a controlled attribution of total build-time differences to SDK sharing.Verified nonempty API 37/37.1/37.2 reference assemblies, SDK task assembly, host test assembly, and valid local workload manifests in both worktrees. Candidate source remained unchanged after validation. On the freshly built candidate workload:
Passed: 4, failed: 0, skipped: 0. Covers Debug CoreCLR app builds under three locale settings and building/moving an application. TRX and command logs were retained outside the checkout. These host-side APK-build tests are not on-device runtime tests.
Investigate the slower fresh build
Replaying the original binlogs found 73 five-second compiler-server connection timeouts on the candidate: 16 during bootstrap and 57 in the solution. Preparation alone took 89.600 s versus 11.496 s on main. Bootstrap's 16
<Csc/>tasks consumed 84.581 s in aggregate versus 0.326 s on main; a later forced rebuild of the same candidate bootstrap sources and shared SDK passed in 1.37 s with all 16 server requests succeeding. Outside bootstrap, the original task counts were 128 candidate<Csc/>calls versus 129 legacy calls after including additional API builds. No increased compilation count was found. Concurrent task durations are not additive wall time.A live process inspection and a session-owned reproducer identified compiler-server interference from
TMPDIRisolation. On Unix, Roslyn puts its pipe in/tmp, but the runtime's named-mutex files followTMPDIR. Two builds sharing one SDK with different temporary directories can therefore start servers with separate mutexes but the same pipe path. In the reproducer, shutting down the second server removed the socket while the first remained alive and held its mutex; the next first-namespace compilation waited exactly 5,000 ms and fell back to standalone compilation. Healthy and poisoned single-class builds both passed, taking 1.880 s and 6.438 s respectively. The fixture used a uniqueSharedCompilationIdand stopped only its two owned servers; it did not shut down the real shared server. This reproduces the observed failure mode, not the unavailable historical state of the first run. The pinned SDK's Unix pipe selection confirms whyTMPDIRalone does not isolate the server.Both full builds then passed again in two more initially clean worktrees, reversing the order to candidate first, main second. The other coordinated benchmark held its timed builds; host load was sampled every five seconds. The same main commands and SDK-check commands above passed again. The repeated candidate build command, exit 0, was:
The observed combined gap fell from 80.652 s to 7.302 s, but the repeat still had compiler-server interference and different host load. Both repeated worktrees retained nonempty reference/task/test assemblies, 15 manifest packs, and clean source trees; the candidate again created no private SDK host,
sdk/, orshared/tree. Main again downloaded the 188,406,361-byte SDK archive. No product-source workaround, SDK change, cache purge, or blanket server shutdown was used. Isolated benchmarks must keep the compiler namespace consistent or use a unique compilation ID, rather than changingTMPDIRalone. These results establish substantial compiler waiting, not an intrinsic end-to-end speedup or a proven redundant-work regression; the source/SDK-pin differences described above still apply.Other validation and limits
b16dc10122,DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER=1 dotnetup dotnet build src/generator/generator.slnf -c Debug --no-restore -m:2 -nr:false -v:minimal— passed, no warnings/errors. Nineteen SDK-selection/layout/wrapper probes and nine solution-orchestration probes passed. Actual multi-version workload-manifest resolver probing passed; no duplicate-manifest workaround was added.bash -n dotnet-local.sh,shellcheck dotnet-local.sh, andgit diff --checkpassed.d0aa1bfd5a..b16dc10122corrections found no confirmed vulnerabilities. This does not certify downloaded installer contents, Windows runtime behavior, or Docker-based scanners.compile skill-runner --no-check-update— passed with the existing missingconcurrency.job-discriminatorwarning.compile skill-runner --dry-run --no-check-updateemitted a diagnostic lock but its gate failed on existing token-pool ShellCheck SC2206/SC2004 findings. The normal regenerated lock is committed, not the diagnostic lock. No workflow was dispatched.d0aa1bfd5a:dotnetup dotnet clean Microsoft.Android.slnx -c Debug -m:2 -nr:false -v:minimaland the same command with-c Releasepassed. Seventeen isolated actual-project Clean probes and an extra custom aapt2-path probe passed, including repeated/unbuilt cleanup and owned shared-toolchain sentinels. These were not rerun as part of the fresh-build timing pair.410cf2ac6fc517b43be343c508684b6ee476fe4b(38 successful jobs; 10,852 passed test results). Earlier local full packaging and source/extracted workload checks were against earlier revisions. Current-head product Pack, Windows execution/signing, on-device tests, CI status, and shared-installation immutability are not certified by the fresh macOS Debug builds.