Fix Windows bundle build: add Bundle.proj payload step to ADO pipeline#14650
Fix Windows bundle build: add Bundle.proj payload step to ADO pipeline#14650davidfowl merged 1 commit intorelease/13.2from
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 14650Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 14650" |
There was a problem hiding this comment.
Pull request overview
Ensures Windows native CLI builds produced by the ADO BuildAndTest.yml pipeline include the embedded Aspire-managed bundle payload (matching the existing Linux/macOS native build pipeline behavior).
Changes:
- Add a per-RID
Bundle.projpayload build step ahead of the main internal build inBuildAndTest.yml. - In CLI packaging, default
BundlePayloadPathto the convention-based artifacts location and fail fast with a clearer error when missing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| eng/pipelines/templates/BuildAndTest.yml | Builds the bundle payload for each target RID before the main internal build, so Windows packaging can embed it. |
| eng/clipack/Common.projitems | Adds a default BundlePayloadPath convention and validates the payload exists during _PublishProject. |
eng/clipack/Common.projitems
Outdated
| <BundlePayloadPath Condition="'$(BundlePayloadPath)' == ''">$(RepoRoot)artifacts\bundle\aspire-ci-bundlepayload-$(CliRuntime).tar.gz</BundlePayloadPath> | ||
| </PropertyGroup> | ||
| <Error Condition="!Exists('$(BundlePayloadPath)')" | ||
| Text="Bundle payload not found at '$(BundlePayloadPath)'. Run Bundle.proj with /p:TargetRid=$(CliRuntime) first." /> |
There was a problem hiding this comment.
The default BundlePayloadPath points to an archive named aspire-ci-bundlepayload-$(CliRuntime).tar.gz, but the error text suggests running Bundle.proj with only /p:TargetRid=.... Bundle.proj defaults BundleVersion to $(VersionPrefix)-dev, so that command won’t produce a file at the default path unless /p:BundleVersion=ci-bundlepayload (or an explicit BundlePayloadPath) is also provided. Please update the error guidance to mention the required BundleVersion value or instruct users to pass BundlePayloadPath to the produced archive.
| Text="Bundle payload not found at '$(BundlePayloadPath)'. Run Bundle.proj with /p:TargetRid=$(CliRuntime) first." /> | |
| Text="Bundle payload not found at '$(BundlePayloadPath)'. Run Bundle.proj with /p:TargetRid=$(CliRuntime) /p:BundleVersion=ci-bundlepayload, or set /p:BundlePayloadPath to the produced archive." /> |
dcbed82 to
27c0c4a
Compare
🎬 CLI E2E Test RecordingsThe following terminal recordings are available for commit
📹 Recordings uploaded automatically from CI run #22365390078 |
joperezr
left a comment
There was a problem hiding this comment.
NIT: I looked at the Bundle.proj, and it doesn't look like it has an Error task in case the payload is missing. Should we add that?
eng/clipack/Common.projitems
Outdated
|
|
||
| <Target Name="_PublishProject"> | ||
| <PropertyGroup> | ||
| <BundlePayloadPath Condition="'$(BundlePayloadPath)' == ''">$(RepoRoot)artifacts\bundle\aspire-ci-bundlepayload-$(CliRuntime).tar.gz</BundlePayloadPath> |
There was a problem hiding this comment.
NIT: We should consider using forward-slashes so this works well in Linux.
There was a problem hiding this comment.
Also NIT: might be good to add a comment above this property group to explain how the flow works, like:
1. Bundle.proj → runs CreateLayout which produces a tar.gz archive of the managed runtime, DCP, dashboard, etc.
2. Pipeline steps (BuildAndTest.yml, build_sign_native.yml, GitHub Actions) → pass BundlePayloadPath pointing to that archive
3. eng/clipack/Common.projitems → forwards BundlePayloadPath as an AdditionalProperties item to the CLI publish
4. Aspire.Cli.csproj → embeds it as an EmbeddedResource with LogicalName="bundle.tar.gz"
5. BundleService.cs → at runtime, reads the resource via Assembly.GetManifestResourceStream("bundle.tar.gz") and extracts it using .NET's TarReader
might be useful in the future when trying to understand how this works
joperezr
left a comment
There was a problem hiding this comment.
Minor comments but looks good otherwise
27c0c4a to
047ab6f
Compare
…t pipeline The Windows build in BuildAndTest.yml was missing the Bundle.proj step that Linux/macOS have in build_sign_native.yml, producing an unbundled CLI binary. - Add Bundle.proj payload build step per target RID before the main build - Default BundlePayloadPath to convention path in Common.projitems - Fail the build with clear error if bundle payload is missing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
047ab6f to
db906dd
Compare
…t pipeline (#14650) The Windows build in BuildAndTest.yml was missing the Bundle.proj step that Linux/macOS have in build_sign_native.yml, producing an unbundled CLI binary. - Add Bundle.proj payload build step per target RID before the main build - Default BundlePayloadPath to convention path in Common.projitems - Fail the build with clear error if bundle payload is missing Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Description
The Windows build in
BuildAndTest.ymlwas missing theBundle.projstep that Linux/macOS have inbuild_sign_native.yml. This meant the Windows native CLI was being produced without the embedded bundle payload (aspire-managed), resulting in an unbundled CLI binary.Changes
eng/pipelines/templates/BuildAndTest.yml— AddedBundle.projpayload build step per target RID before the main build (matching the pattern inbuild_sign_native.yml)eng/clipack/Common.projitems— DefaultBundlePayloadPathto the convention path when not explicitly set, and fail the build with a clear error if the payload is missingThe convention-based default is needed because
BuildAndTest.ymlbuilds multiple RIDs (win-x64:win-arm64) in a single job and cannot pass a per-RIDBundlePayloadPath. WhenBundlePayloadPathis passed explicitly (GitHub Actions,build_sign_native.yml), it takes priority.Checklist