[wasm] Build tasks for net472 also#51959
Merged
radical merged 4 commits intodotnet:mainfrom Apr 28, 2021
Merged
Conversation
- And update the tasks to be buildable with net472
- avoid newer APIs
- can't use `init`, and ranges
- `NotNull` attribute isn't available
- `Path.GetRelativePath` isn't available, but that is only used by
`Utils.GetDirectory`, which isn't needed for wasm
On lewing's suggestion:
- add a dummy `NotNullAttribute` for net472 case
- and disable nullable warnings for that
- any nullable issues should get checked in the net6.0 case anyway
lewing
reviewed
Apr 28, 2021
Member
lewing
left a comment
There was a problem hiding this comment.
Code changes look fine. How confident are you about the publish stuff?
Member
Author
|
Not 100%. I want to see if we break any tests. And we should try out the packages. |
lewing
pushed a commit
to lewing/runtime
that referenced
this pull request
Apr 29, 2021
mmitche
pushed a commit
that referenced
this pull request
May 3, 2021
…io (#52078) * [wasm] Build tasks for net472 also (#51959) * [wasm] Fix loading WebAssembly tasks in VS - In case of `WasmAppBuilder.dll`, we were packaging only the task assembly, and `System.Reflection.MetadataLoadContext` for net472, same as net6.0 . - But for net472, VS fails with errors like: ``` C:\Program Files\dotnet\packs\Microsoft.NET.Runtime.WebAssembly.Sdk\6.0.0-preview.4.21222.10\Sdk\WasmApp.targets(424,4): Error MSB4018: The "PInvokeTableGenerator" task failed unexpectedly. System.IO.FileNotFoundException: Could not load file or assembly 'System.Reflection.Metadata, Version=1.4.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Reflection.Metadata, Version=1.4.5.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' at System.Reflection.MetadataLoadContext.LoadFromStreamCore(Stream peStream) at System.Reflection.MetadataLoadContext.LoadFromAssemblyPath(String assemblyPath) at System.Reflection.PathAssemblyResolver.Resolve(MetadataLoadContext context, AssemblyName assemblyName) at System.Reflection.MetadataLoadContext.TryFindAssemblyByCallingResolveHandler(RoAssemblyName refName) at System.Reflection.MetadataLoadContext.ResolveToAssemblyOrExceptionAssembly(RoAssemblyName refName) at System.Reflection.MetadataLoadContext.TryResolveAssembly(RoAssemblyName refName, Exception& e) at System.Reflection.MetadataLoadContext.TryGetCoreAssembly(String coreAssemblyName, Exception& e) at System.Reflection.TypeLoading.CoreTypes..ctor(MetadataLoadContext loader, String coreAssemblyName) at System.Reflection.MetadataLoadContext..ctor(MetadataAssemblyResolver resolver, String coreAssemblyName) at PInvokeTableGenerator.GenPInvokeTable(String[] pinvokeModules, String[] assemblies) in /Users/radical/dev/r2/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs:line 42 at PInvokeTableGenerator.Execute() in /Users/radical/dev/r2/src/tasks/WasmAppBuilder/PInvokeTableGenerator.cs:line 28 at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ``` - So, bundle all the dependent assemblies from the publish folder * Address review feedback * Update src/tasks/AotCompilerTask/MonoAOTCompiler.csproj Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com> * Update src/tasks/AotCompilerTask/MonoAOTCompiler.csproj Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com> * Update src/tasks/WasmAppBuilder/WasmAppBuilder.csproj Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com> * Update src/tasks/WasmAppBuilder/WasmAppBuilder.csproj Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com> * Apply suggestions from code review Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com> * Use a property for net472 Co-authored-by: Ankit Jain <radical@gmail.com> Co-authored-by: Daniel Plaisted <dsplaisted@gmail.com>
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
init, and rangesNotNullattribute isn't availablePath.GetRelativePathisn't available, but that is only used byUtils.GetDirectory, which isn't needed for wasm