Repository navigation
fix: build the example AppHosts without the Aspire CLI - #56
Merged
Merged
Conversation
Both example AppHosts opted into the Aspire CLI bundle, which makes *building* an AppHost require a resolvable bundle. With none present, Aspire.Hosting.AppHost.targets runs `dnx aspire.cli@13.6.4 setup` once per AppHost, so one solution build restores and extracts the same CLI concurrently: the losing process dies on the locked NuGet cache file with exit code 1, which MSBuild reports only as ASPIRE009, "Automatic Aspire CLI bundle setup failed with exit code 1". That is what failed the release pipeline on sources the PR pipeline had just built - being a race, it fails some runs and not others. Neither shared pipeline can install the Aspire CLI before its own `dotnet build`, so the build must not need one. The examples now default AspireUseCliBundle to false, the Aspire-documented fallback: the AppHost SDK adds Aspire.Dashboard.Sdk.<rid> and Aspire.Hosting.Orchestration.<rid> references for the build machine's RID instead, and running the AppHost (`dotnet run`, `aspire run`, TUnit.Aspire) is unchanged. The ASPIRE010 that reports the choice is suppressed while the bundle stays off, and the opt-in remains available per build as -p:AspireUseCliBundle=true. ExampleAppHostTests keeps the opt-in out of the project files; AGENTS.md, the contributing page and the changelog record why.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The
Release packagesjob failed on:The PR run ten minutes earlier had passed that same Release build on the same sources.
Root cause
Both example AppHosts set
AspireUseCliBundle=true, which makes a build require a resolvableDCP/dashboard bundle. With none present,
Aspire.Hosting.AppHost.targetsrunsdnx aspire.cli@13.6.4 setuponce per AppHost, so a single solution build restores and extracts thesame CLI concurrently. Reproduced on Linux with a fresh
$HOME/.aspire:Exit code 1, which MSBuild reports only as ASPIRE009. It is a race, which is why it passed some runs and
failed others. Neither shared pipeline can install the CLI before its own
dotnet build(
purview-build.ymlhas no pre-build hook, and the release action is a composite action), so the buildmust not need one.
Change
Example.AppHost/Example.ManualAppHostnow defaultAspireUseCliBundletofalse(stilloverridable), the Aspire-documented fallback: the AppHost SDK adds
Aspire.Dashboard.Sdk.<rid>andAspire.Hosting.Orchestration.<rid>for the build machine's RID.Running the AppHosts is unchanged: the built assembly still carries
dcpclipath/aspiredashboardpathmetadata for 13.6.4.dotnet build -p:AspireUseCliBundle=true.ExampleAppHostTests(Repository.UnitTests) fails if either project opts back in.AGENTS.md,docs/wiki/Contributing.mdandCHANGELOG.mdrecord the decision.Verification (no
aspireon PATH, empty Aspire home, the CI condition)dotnet build src/ResourceKit.slnx -c Release: succeeded, 0 warnings, 0 errors/*/*/*/*[Category=Unit]: 100 tests, 0 failed, 5 skippeddotnet csharpier check .: clean (107 files)Closes the
ASPIRE009failure in https://github.com/purview-dev/aspire-resourcekit/actions/runs/42512003194