-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Revert "[browser] Use Runtime=NET for build tasks in WebAssembly SDK" #123973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…otnet#123304)" This reverts commit 46c884e.
|
/backport to release/11.0-preview1 |
|
Started backporting to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR reverts the previous “[browser] Use Runtime=NET for build tasks in WebAssembly SDK” change to restore the earlier multi-targeted tooling and NuGet layout for Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.
Changes:
- Restore multi-targeting of
Microsoft.NET.Sdk.WebAssembly.Pack.Tasks(to$(NetCoreAppToolCurrent)and$(NetFrameworkToolCurrent)) and revertGetFilesToPackageto emit framework-specific assets undertools\<tfm>\. - Reintroduce
_WebAssemblySdkTasksTFMandTaskHostFactory-based<UsingTask>declarations so the appropriatenet11.0vsnet472task assembly is selected based onMSBuildRuntimeType. - Adjust in-tree build/test infrastructure (
WasmApp.InTree.props,trimmingTests.targets) so the Artifacts directory layout and generated project templates again match the restored multi-TFM tools directory structure.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj |
Restores multi-targeting and TFM-specific packing of the WebAssembly pack tasks assembly into tools\<tfm>\ in the NuGet package. |
src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets |
Reverts to _WebAssemblySdkTasksTFM-driven task assembly selection and TaskHostFactory-based <UsingTask> declarations, pointing to tools\<tfm>\Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.dll. |
src/mono/browser/build/WasmApp.InTree.props |
Updates the in-tree tools directory to the configuration-level folder so Browser targets can locate per-TFM task assemblies under that root. |
eng/testing/linker/trimmingTests.targets |
Updates the WasmSdkPackTasksPath placeholder used in generated trimming test projects to the configuration-level tools directory consistent with the reverted layout. |
|
@lewing backporting to git am output$ git am --3way --empty=keep --ignore-whitespace --keep-non-patch changes.patch
Applying: Revert "[browser] Use Runtime=NET for build tasks in WebAssembly SDK (#123304)"
Using index info to reconstruct a base tree...
M src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
M src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj
Falling back to patching base and 3-way merge...
Auto-merging src/mono/nuget/Microsoft.NET.Sdk.WebAssembly.Pack/build/Microsoft.NET.Sdk.WebAssembly.Browser.targets
Auto-merging src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj
CONFLICT (content): Merge conflict in src/tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks/Microsoft.NET.Sdk.WebAssembly.Pack.Tasks.csproj
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
hint: When you have resolved this problem, run "git am --continue".
hint: If you prefer to skip this patch, run "git am --skip" instead.
hint: To restore the original branch and stop patching, run "git am --abort".
hint: Disable this message with "git config set advice.mergeConflict false"
Patch failed at 0001 Revert "[browser] Use Runtime=NET for build tasks in WebAssembly SDK (#123304)"
Error: The process '/usr/bin/git' failed with exit code 128 |
|
/ba-g failures are unrelated infrastructure issues |
…dotnet#123973) This reverts PR dotnet#123304 (commit 46c884e). ## Reverted Changes - Restores multi-targeting for Microsoft.NET.Sdk.WebAssembly.Pack.Tasks (net11.0 + net472) - Restores \_WebAssemblySdkTasksTFM\ property and MSBuildRuntimeType-based TFM selection - Restores \TaskFactory=\"TaskHostFactory\"\ instead of \Runtime=\"NET\"\ for UsingTask declarations - Restores TFM-specific paths in NuGet package layout ## Reason for Revert Per discussion in dotnet/sdk#52727 (comment): The \Runtime=\"NET\"\ feature for UsingTask is currently **only supported with SDK-style projects** (see dotnet/msbuild#12895). Using it in the WebAssembly SDK tasks causes failures when these tasks are invoked from non-SDK-style projects. Additionally, the .NET Runtime Task Host infrastructure is still maturing, and using it in the SDK at this time is premature. This was causing Blazor test failures in the SDK repo where tasks would crash with \ArgumentNullException\ when the .NET Runtime Task Host couldn't be found. This revert restores the previous behavior using \TaskFactory=\"TaskHostFactory\"\ with TFM-based task assembly selection, which works reliably across both SDK-style and non-SDK-style projects. The \Runtime=\"NET\"\ approach can be revisited once MSBuild has broader support for this feature. Related: - dotnet/msbuild#12895 - Runtime=\"NET\" only works with SDK-style projects - dotnet/msbuild#13150 - MSBuild crash when wrapping exceptions (fixed but not yet in preview1)
They got reverted in #123973
They got reverted in #123973
They got reverted in #123973
This reverts PR #123304 (commit 46c884e).
Reverted Changes
Reason for Revert
Per discussion in dotnet/sdk#52727 (comment):
The \Runtime="NET"\ feature for UsingTask is currently only supported with SDK-style projects (see dotnet/msbuild#12895). Using it in the WebAssembly SDK tasks causes failures when these tasks are invoked from non-SDK-style projects.
Additionally, the .NET Runtime Task Host infrastructure is still maturing, and using it in the SDK at this time is premature. This was causing Blazor test failures in the SDK repo where tasks would crash with \ArgumentNullException\ when the .NET Runtime Task Host couldn't be found.
This revert restores the previous behavior using \TaskFactory="TaskHostFactory"\ with TFM-based task assembly selection, which works reliably across both SDK-style and non-SDK-style projects.
The \Runtime="NET"\ approach can be revisited once MSBuild has broader support for this feature.
Related: