Skip to content

[wasm] Extract crossgen2 resolution test targets - #133856

Merged
radekdoulik merged 2 commits into
dotnet:mainfrom
radekdoulik:radekdoulik-crossgen2-test-target-cleanup
Sep 14, 2026
Merged

radekdoulik merged 2 commits into
dotnet:mainfrom
radekdoulik:radekdoulik-crossgen2-test-target-cleanup

Conversation

@radekdoulik

Copy link
Copy Markdown
Member

Follow-up to #133413 addressing the target-file extraction feedback.

Move the inline MSBuild assertions in NativeRelinkResolvesCrossgen2WithoutReadyToRun into NativeRelinkResolvesCrossgen2WithoutReadyToRun.Build.targets. The existing Wasm.Build.Tests.csproj data glob links and copies the asset to the test output; the test then copies it into the generated app and imports that app-local file.

A test-only property carries the build/publish expectation independently of the actual nested-publish state, with an explicit guard against missing or invalid values. All existing assertions and the final intentional stop marker remain intact, including the assertion before first restore. Both theory variants and the missing-pack diagnostic theory are preserved. Production crossgen2 acquisition and pack-version overrides are unchanged.

Validation

  • Compiled Wasm.Build.Tests in Release on macOS arm64: no warnings or errors.
  • Ran both build/publish variants of the SDK-resolution and missing-pack theories: 4 passed, 0 failed, 0 skipped, 0 errors.
  • Verified the output asset and both app-local copies match the source, and both successful scenarios generate all three helper tables.
  • A clean first-restore probe with RequiresCrossgen2Pack=false hit the restore assertion. Inverting the nested-publish assertion in a throwaway copied target failed before the final marker.
  • Reproduced the lost-expectation false-positive in a throwaway target without the new guard; with the guard, both missing and invalid expectation values fail before the final marker.

These runs used the supplied official SDK 12.0.100-alpha.1.26458.102 with the existing repo-produced WebAssembly/native SDK pack overlay and the existing 11.0.0-dev runtime/ref/crossgen2 baseline. The changed test assembly was rebuilt locally; no fresh product build, browser execution, or Linux/Windows run was performed for this follow-up.

Note

This change and description were prepared with GitHub Copilot.

radekdoulik and others added 2 commits September 14, 2026 10:44
Move native-relink crossgen2 assertions into a copied test data asset,
using the existing linked data glob and an app-local import. Pass the
publish expectation through a test-only property to preserve both test
variants and the early restore and helper-generation checks.

Follow up on the test-maintainability feedback in dotnet#133413.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f6d6e5a4-5b25-4198-b42d-d5b2dc781f47
Reject missing or invalid publish expectations in the extracted test
asset so a broken property handoff cannot silently bypass its nested
publish assertion.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f6d6e5a4-5b25-4198-b42d-d5b2dc781f47
Copilot AI lite review requested due to automatic review settings September 14, 2026 12:44
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@radekdoulik radekdoulik added this to the 12.0.0 milestone Sep 14, 2026
@radekdoulik radekdoulik added the arch-wasm WebAssembly architecture label Sep 14, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to 'arch-wasm': @lewing, @pavelsavara
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved issues were identified that would block approval.

Pull request overview

Extracts crossgen2 resolution assertions from the test method into a reusable MSBuild target asset while preserving build/publish coverage.

Changes:

  • Adds validation targets for pack requests, SDK crossgen2 resolution, helper tables, and nested-publish expectations.
  • Copies and imports the target asset into generated test projects.
  • Preserves both theory variants and missing-pack diagnostics.
File summaries
File Description
src/mono/wasm/Wasm.Build.Tests/data/NativeRelinkResolvesCrossgen2WithoutReadyToRun.Build.targets Updated as part of this pull request.
src/mono/wasm/Wasm.Build.Tests/CoreCLRWasmNativeDefaultsTests.cs Updated as part of this pull request.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

@radekdoulik
radekdoulik enabled auto-merge (squash) September 14, 2026 12:52
@radekdoulik
radekdoulik merged commit 04da13d into dotnet:main Sep 14, 2026
58 checks passed
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
Follow-up to dotnet#133413 addressing [the target-file extraction
feedback](dotnet#133413 (comment)).

Move the inline MSBuild assertions in
`NativeRelinkResolvesCrossgen2WithoutReadyToRun` into
`NativeRelinkResolvesCrossgen2WithoutReadyToRun.Build.targets`. The
existing `Wasm.Build.Tests.csproj` data glob links and copies the asset
to the test output; the test then copies it into the generated app and
imports that app-local file.

A test-only property carries the build/publish expectation independently
of the actual nested-publish state, with an explicit guard against
missing or invalid values. All existing assertions and the final
intentional stop marker remain intact, including the assertion before
first restore. Both theory variants and the missing-pack diagnostic
theory are preserved. Production crossgen2 acquisition and pack-version
overrides are unchanged.

## Validation

- Compiled `Wasm.Build.Tests` in Release on macOS arm64: no warnings or
errors.
- Ran both build/publish variants of the SDK-resolution and missing-pack
theories: **4 passed, 0 failed, 0 skipped, 0 errors**.
- Verified the output asset and both app-local copies match the source,
and both successful scenarios generate all three helper tables.
- A clean first-restore probe with `RequiresCrossgen2Pack=false` hit the
restore assertion. Inverting the nested-publish assertion in a throwaway
copied target failed before the final marker.
- Reproduced the lost-expectation false-positive in a throwaway target
without the new guard; with the guard, both missing and invalid
expectation values fail before the final marker.

These runs used the supplied official SDK `12.0.100-alpha.1.26458.102`
with the existing repo-produced WebAssembly/native SDK pack overlay and
the existing `11.0.0-dev` runtime/ref/crossgen2 baseline. The changed
test assembly was rebuilt locally; no fresh product build, browser
execution, or Linux/Windows run was performed for this follow-up.

> [!NOTE]
> This change and description were prepared with GitHub Copilot.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f6d6e5a4-5b25-4198-b42d-d5b2dc781f47
@radekdoulik

Copy link
Copy Markdown
Member Author

@jonpryor did this resolve the WASM0067 failures for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-wasm WebAssembly architecture area-Infrastructure

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants