Skip to content
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

[release/6.0][wasm] Add support for native relinking after Build, and AOT after publish #58913

Merged
merged 48 commits into from
Sep 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d3ad227
rebased
radical Aug 27, 2021
cfb584d
Fix helix work item name
radical Aug 25, 2021
80fe082
fix test
radical Aug 25, 2021
b4d7659
get all the assemblies from the publishdir
radical Aug 25, 2021
c39313b
AOTCompiler: Expand the paths used with MONO_PATH
radical Aug 26, 2021
f9948e5
Implement support for skipping assemblies for AOT
radical Aug 26, 2021
7a82a3f
Update blazorwasm targets file with a locally patched copy
radical Aug 26, 2021
cd9ec8e
Cleanup
radical Aug 26, 2021
8944a98
fix path for copying blazorwasm targets file
radical Aug 27, 2021
56c5dc3
Fix tests on emsdk
radical Aug 27, 2021
5c707f0
Don't fixup runtime pack paths when not using workloads
radical Aug 27, 2021
2dbc899
[wasm] Fix building blazor projects with no workload installed
radical Sep 7, 2021
0cfd401
Update wasm README.md
radical Sep 7, 2021
8165407
Add missing files
radical Sep 7, 2021
b499586
WasmApp.targets: remove hack for blazor, which is not needed now
radical Sep 7, 2021
0ec1188
add comments for the new properties
radical Sep 8, 2021
567144c
blazor-sdk: cleanup assemblies list before adding to it
radical Sep 8, 2021
c906da8
Fix "Clean" for blazorwasm projects, for *Build*
radical Sep 8, 2021
1ecf92d
[wasm] Rename tmp folder 'relink' to 'for-build'
radical Sep 9, 2021
40d6713
[wasm] Fix support for AOT with trimming disabled
radical Sep 10, 2021
73efb99
WasmAppBuilder - cleanup
radical Sep 10, 2021
5457420
Bump sdk for workload testing to 6.0.100-rc.2.21459.15
radical Sep 10, 2021
a93db63
disable non-wasm builds
radical Sep 10, 2021
b5744b4
run blazor tests only with the workloads installed
radical Sep 9, 2021
5a5d8ed
Update BlazorOverride.targets to 6.0
radical Sep 9, 2021
40aef7d
[wasm] Fix Publish with VS
radical Sep 10, 2021
fda6f18
Revert "disable non-wasm builds"
radical Sep 10, 2021
8e2ba88
Fix up blazorOverride.targets
radical Sep 10, 2021
d011f44
Fix local aot builds for samples
radical Sep 10, 2021
6a37e25
Fix aot with no trimming for blazor projects
radical Sep 10, 2021
6fc4bbc
Wasm.Build.Test: find differently cased publish dir
radical Sep 10, 2021
5d53a50
Rename WasmBuildingForPublish->WasmBuildingForNestedPublish to be cle…
radical Sep 10, 2021
d2037c7
Update BlazorOverwrite.targets
radical Sep 10, 2021
ad96269
sample/iOS: Add new required IntermediateOutputPath parameter for Mon…
radical Sep 10, 2021
1e67f3e
disable non-wasm builds
radical Sep 10, 2021
7cfc9cf
Fix more wasm.build.tests to work around blazor's Publish dir issue
radical Sep 11, 2021
c1ab08f
Surface @(FileWrites) from nested publish to the main build
radical Sep 11, 2021
a8f1eae
[wasm] Don't relink after build, when `$(DeployOnBuild)=true`
radical Sep 11, 2021
c6cbe0b
Revert "disable non-wasm builds"
radical Sep 11, 2021
c1a77cf
Merge remote-tracking branch 'origin/release/6.0' into build-publish-6.0
radical Sep 13, 2021
48085f2
Update BlazorOverwrite.targets to work with rc2
radical Sep 14, 2021
3bba097
[wasm] Disable a blazorwasm publish test
radical Sep 14, 2021
617415f
Bump sdk for workload testing to 6.0.100-rc.2.21463.12
radical Sep 14, 2021
eb4ef84
Merge remote-tracking branch 'origin/release/6.0' into build-publish-6.0
radical Sep 14, 2021
ee62901
Revert "Update BlazorOverwrite.targets to work with rc2"
radical Sep 14, 2021
3da2650
disable non-wasm builds
radical Sep 10, 2021
4f52961
Address review feedback from @jonathanpeppers
radical Sep 14, 2021
981ba33
Revert "disable non-wasm builds"
radical Sep 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
<SQLitePCLRawbundle_greenVersion>2.0.4</SQLitePCLRawbundle_greenVersion>
<MoqVersion>4.12.0</MoqVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
<SdkVersionForWorkloadTesting>6.0.100-rc.2.21425.12</SdkVersionForWorkloadTesting>
<SdkVersionForWorkloadTesting>6.0.100-rc.2.21463.12</SdkVersionForWorkloadTesting>
<!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>5.0.0-preview-20201009.2</MicrosoftPrivateIntellisenseVersion>
<!-- ILLink -->
Expand Down
32 changes: 18 additions & 14 deletions eng/testing/scenarios/BuildWasmAppsJobsList.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
BlazorWasmTests
FlagsChangeRebuildTest
InvariantGlobalizationTests
LocalEMSDKTests
MainWithArgsTests
NativeBuildTests
NativeLibraryTests
NoopNativeRebuildTest
RebuildTests
ReferenceNewAssemblyRebuildTest
SatelliteAssembliesTests
SimpleSourceChangeRebuildTest
WasmBuildAppTest
WorkloadTests
Wasm.Build.NativeRebuild.Tests.FlagsChangeRebuildTest
Wasm.Build.NativeRebuild.Tests.NoopNativeRebuildTest
Wasm.Build.NativeRebuild.Tests.ReferenceNewAssemblyRebuildTest
Wasm.Build.NativeRebuild.Tests.SimpleSourceChangeRebuildTest
Wasm.Build.Tests.BlazorWasmBuildPublishTests
Wasm.Build.Tests.BlazorWasmTests
Wasm.Build.Tests.BuildPublishTests
Wasm.Build.Tests.CleanTests
Wasm.Build.Tests.InvariantGlobalizationTests
Wasm.Build.Tests.LocalEMSDKTests
Wasm.Build.Tests.MainWithArgsTests
Wasm.Build.Tests.NativeBuildTests
Wasm.Build.Tests.NativeLibraryTests
Wasm.Build.Tests.RebuildTests
Wasm.Build.Tests.SatelliteAssembliesTests
Wasm.Build.Tests.WasmBuildAppTest
Wasm.Build.Tests.WasmNativeDefaultsTests
Wasm.Build.Tests.WorkloadTests
5 changes: 4 additions & 1 deletion eng/testing/tests.mobile.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

<PublishingTestsRun>true</PublishingTestsRun>
<BundleTestAppTargets>BundleTestAppleApp;BundleTestAndroidApp</BundleTestAppTargets>
<PublishTestAsSelfContainedDependsOn>Publish</PublishTestAsSelfContainedDependsOn>
</PropertyGroup>

<PropertyGroup Condition="'$(EnableAggressiveTrimming)' == 'true'">
Expand Down Expand Up @@ -104,6 +105,7 @@
OutputType="AsmOnly"
Assemblies="@(AotInputAssemblies)"
AotModulesTablePath="$(BundleDir)\modules.c"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseLLVM="$(MonoEnableLLVM)"
LLVMPath="$(MonoAotCrossDir)">
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
Expand Down Expand Up @@ -189,6 +191,7 @@
Assemblies="@(AotInputAssemblies)"
AotModulesTablePath="$(BundleDir)\modules.m"
AotModulesTableLanguage="ObjC"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseLLVM="$(MonoEnableLLVM)"
LLVMPath="$(MonoAotCrossDir)">
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
Expand Down Expand Up @@ -291,7 +294,7 @@
<Target Name="PublishTestAsSelfContained"
Condition="'$(IsCrossTargetingBuild)' != 'true'"
AfterTargets="Build"
DependsOnTargets="Publish;$(BundleTestAppTargets);ArchiveTests" />
DependsOnTargets="$(PublishTestAsSelfContainedDependsOn);$(BundleTestAppTargets);ArchiveTests" />

<Target Name="PrepareForTestUsingWorkloads"
BeforeTargets="Test"
Expand Down
22 changes: 18 additions & 4 deletions eng/testing/tests.wasm.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<Project>
<!-- We need to set this in order to get extensibility on xunit category traits and other arguments we pass down to xunit via MSBuild properties -->
<PropertyGroup>
<IsWasmProject Condition="'$(IsWasmProject)' == ''">true</IsWasmProject>
<WasmGenerateAppBundle Condition="'$(WasmGenerateAppBundle)' == ''">true</WasmGenerateAppBundle>
<BundleTestAppTargets>$(BundleTestAppTargets);BundleTestWasmApp</BundleTestAppTargets>
<DebuggerSupport Condition="'$(DebuggerSupport)' == '' and '$(Configuration)' == 'Debug'">true</DebuggerSupport>
<!-- Some tests expect to load satellite assemblies by path, eg. System.Runtime.Loader.Tests,
Expand Down Expand Up @@ -55,10 +57,20 @@
Condition="'$(BuildAOTTestsOn)' == 'local'" />

<PropertyGroup>
<WasmBuildAppDependsOn>PrepareForWasmBuildApp;$(WasmBuildAppDependsOn)</WasmBuildAppDependsOn>
<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOn)' == 'local'">WasmTriggerPublishApp</BundleTestWasmAppDependsOn>
<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">$(BundleTestWasmAppDependsOn);_BundleAOTTestWasmAppForHelix</BundleTestWasmAppDependsOn>
</PropertyGroup>

<PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' == 'true'">
<!-- wasm targets are not imported at all, in this case, because we run the wasm build on helix -->
</PropertyGroup>

<PropertyGroup Condition="'$(BuildAOTTestsOnHelix)' != 'true'">
<WasmBuildOnlyAfterPublish>true</WasmBuildOnlyAfterPublish>

<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOn)' == 'local'">WasmBuildApp</BundleTestWasmAppDependsOn>
<BundleTestWasmAppDependsOn Condition="'$(BuildAOTTestsOnHelix)' == 'true'">$(BundleTestWasmAppDependsOn);_BundleAOTTestWasmAppForHelix</BundleTestWasmAppDependsOn>
<!-- wasm's publish targets will trigger publish, so we shouldn't do that -->
<PublishTestAsSelfContainedDependsOn />
<WasmNestedPublishAppDependsOn>PrepareForWasmBuildApp;$(WasmNestedPublishAppDependsOn)</WasmNestedPublishAppDependsOn>
</PropertyGroup>

<ItemGroup>
Expand All @@ -80,6 +92,8 @@
<RuntimeConfigFilePath>$([System.IO.Path]::ChangeExtension($(_MainAssemblyPath), '.runtimeconfig.json'))</RuntimeConfigFilePath>
</PropertyGroup>

<Error Text="Item WasmAssembliesToBundle is empty. This is likely an authoring error." Condition="@(WasmAssembliesToBundle->Count()) == 0" />

<ItemGroup>
<BundleFiles Include="$(WasmMainJSPath)" TargetDir="publish" />
<BundleFiles Include="@(WasmAssembliesToBundle)" TargetDir="publish\%(WasmAssembliesToBundle.RecursiveDir)" />
Expand Down Expand Up @@ -154,7 +168,7 @@
</ItemGroup>

<ItemGroup>
<WasmAssembliesToBundle Include="$(PublishDir)\**\*.dll"/>
<WasmAssembliesToBundle Include="$(PublishDir)\**\*.dll" Condition="'$(BuildAOTTestsOnHelix)' == 'true'" />
<WasmFilesToIncludeInFileSystem Include="@(ContentWithTargetPath)" />

<_CopyLocalPaths
Expand Down
6 changes: 3 additions & 3 deletions src/libraries/sendtohelixhelp.proj
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@
</PropertyGroup>

<ItemGroup Condition="'$(Scenario)' == 'BuildWasmApps'">
<HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(FileName)')">
<HelixWorkItem Include="@(BuildWasmApps_PerJobList->'$(WorkItemPrefix)%(Extension)')">
<PayloadArchive>$(_BuildWasmAppsPayloadArchive)</PayloadArchive>
<PreCommands Condition="'$(OS)' == 'Windows_NT'">set &quot;HELIX_XUNIT_ARGS=-class Wasm.Build.Tests.%(Identity)&quot;</PreCommands>
<PreCommands Condition="'$(OS)' != 'Windows_NT'">export &quot;HELIX_XUNIT_ARGS=-class Wasm.Build.Tests.%(Identity)&quot;</PreCommands>
<PreCommands Condition="'$(OS)' == 'Windows_NT'">set &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
<PreCommands Condition="'$(OS)' != 'Windows_NT'">export &quot;HELIX_XUNIT_ARGS=-class %(Identity)&quot;</PreCommands>
<Command>$(HelixCommand)</Command>
<Timeout>$(_workItemTimeout)</Timeout>
</HelixWorkItem>
Expand Down
7 changes: 5 additions & 2 deletions src/libraries/workloads-testing.targets
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Error Text="%24(SdkWithWorkloadForTestingPath) is not set" Condition="'$(SdkWithWorkloadForTestingPath)' == ''" />
<Error Text="%24(SdkVersionForWorkloadTesting) is not set" Condition="'$(SdkVersionForWorkloadTesting)' == ''" />

<Message Text="** Installing sdk $(SdkWithWorkloadForTestingPath) for workload based tests into $(SdkWithWorkloadForTestingPath)" Importance="High" />
<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests into $(SdkWithWorkloadForTestingPath)" Importance="High" />

<RemoveDir Directories="$(SdkWithWorkloadForTestingPath)" />
<MakeDir Directories="$(SdkWithWorkloadForTestingPath)" />
Expand All @@ -16,14 +16,16 @@
</ItemGroup>

<Copy SourceFiles="@(_SourceFiles)" DestinationFolder="$(SdkWithWorkloadForTestingPath)\%(_SourceFiles.RecursiveDir)" />
<Copy SourceFiles="$(MonoProjectRoot)\wasm\BlazorOverwrite.targets" DestinationFiles="$(SdkWithWorkloadForTestingPath)\sdk\$(SdkVersionForWorkloadTesting)\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets" />

<WriteLinesToFile File="$(SdkWithWorkloadStampPath)" Lines="" Overwrite="true" />
</Target>

<Target Name="_ProvisionSdkWithNoWorkload" Condition="!Exists($(SdkWithNoWorkloadStampPath))">
<Error Text="%24(SdkWithNoWorkloadForTestingPath) is not set" Condition="'$(SdkWithNoWorkloadForTestingPath)' == ''" />
<Error Text="%24(SdkVersionForWorkloadTesting) is not set" Condition="'$(SdkVersionForWorkloadTesting)' == ''" />

<Message Text="** Installing sdk $(SdkWithNoWorkloadForTestingPath) for workload based tests into $(SdkWithNoWorkloadForTestingPath)" Importance="High" />
<Message Text="** Installing sdk $(SdkVersionForWorkloadTesting) for workload based tests into $(SdkWithNoWorkloadForTestingPath)" Importance="High" />

<RemoveDir Directories="$(SdkWithNoWorkloadForTestingPath)" />
<MakeDir Directories="$(SdkWithNoWorkloadForTestingPath)" />
Expand All @@ -39,6 +41,7 @@
<Exec Condition="$([MSBuild]::IsOSPlatform('windows'))"
Command='powershell -ExecutionPolicy ByPass -NoProfile -command "&amp; $(_DotNetInstallScriptPath) -InstallDir $(SdkWithNoWorkloadForTestingPath) -Version $(SdkVersionForWorkloadTesting)"' />

<Copy SourceFiles="$(MonoProjectRoot)\wasm\BlazorOverwrite.targets" DestinationFiles="$(SdkWithNoWorkloadForTestingPath)\sdk\$(SdkVersionForWorkloadTesting)\Sdks\Microsoft.NET.Sdk.BlazorWebAssembly\targets\Microsoft.NET.Sdk.BlazorWebAssembly.6_0.targets" />
<WriteLinesToFile File="$(SdkWithNoWorkloadStampPath)" Lines="" Overwrite="true" />
</Target>

Expand Down
1 change: 1 addition & 0 deletions src/mono/sample/Android/AndroidSampleApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
AotModulesTablePath="$(_AotModulesTablePath)"
ToolPrefix="$(_AotToolPrefix)"
LibraryFormat="$(_AotLibraryFormat)"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseLLVM="$(UseLLVM)"
LLVMPath="$(MonoAotCrossDir)">
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
Expand Down
1 change: 1 addition & 0 deletions src/mono/sample/iOS/Program.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
AotModulesTablePath="$(AppDir)\modules.m"
AotModulesTableLanguage="ObjC"
OutputDir="$(PublishDir)"
IntermediateOutputPath="$(IntermediateOutputPath)"
UseLLVM="$(UseLLVM)"
LLVMPath="$(MonoAotCrossDir)">
<Output TaskParameter="CompiledAssemblies" ItemName="BundleAssemblies" />
Expand Down
1 change: 0 additions & 1 deletion src/mono/sample/mbr/browser/WasmDelta.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@

<Target Name="PrepareDeltasForWasmApp" DependsOnTargets="Build;CompileDiff;ComputeDeltaFileOutputNames">
<ItemGroup>
<WasmAssembliesToBundle Include="$(TargetDir)publish\*.dll" />
<WasmFilesToIncludeInFileSystem Include="@(_DeltaFileForPublish)">
<TargetPath>\%(_DeltaFileForPublish.Filename)%(_DeltaFileForPublish.Extension)</TargetPath>
</WasmFilesToIncludeInFileSystem>
Expand Down
5 changes: 0 additions & 5 deletions src/mono/sample/wasm/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
<Project>
<Import Project="../Directory.Build.targets" />
<Target Name="PrepareForWasmBuild" BeforeTargets="WasmBuildApp">
<ItemGroup>
<WasmAssembliesToBundle Include="$(TargetDir)publish\*.dll" />
</ItemGroup>
</Target>
<Import Project="$(MonoProjectRoot)\wasm\build\WasmApp.InTree.targets" />

<Target Name="BuildSampleInTree"
Expand Down
2 changes: 1 addition & 1 deletion src/mono/sample/wasm/console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ public static async Task<int> Main(string[] args)
}
return args.Length;
}
}
}
5 changes: 4 additions & 1 deletion src/mono/sample/wasm/wasm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ CONFIG?=Release

WASM_DEFAULT_BUILD_ARGS?=/p:TargetArchitecture=wasm /p:TargetOS=Browser /p:Configuration=$(CONFIG)

all: build
all: publish

build:
EMSDK_PATH=$(realpath $(TOP)/src/mono/wasm/emsdk) $(DOTNET) build $(DOTNET_Q_ARGS) $(WASM_DEFAULT_BUILD_ARGS) $(MSBUILD_ARGS) $(PROJECT_NAME)

publish:
EMSDK_PATH=$(realpath $(TOP)/src/mono/wasm/emsdk) $(DOTNET) publish $(DOTNET_Q_ARGS) $(WASM_DEFAULT_BUILD_ARGS) $(MSBUILD_ARGS) $(PROJECT_NAME)

clean:
Expand Down
Loading