Merge pull request #452 from unoplatform/dev/jela/fix-profile-generation

fix: Adjust and validate profile generation build
This commit is contained in:
Jérôme Laban 2021-11-18 11:53:00 -05:00 коммит произвёл GitHub
Родитель 20b4c5e837 73d13a5046
Коммит d3403739ae
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 165 добавлений и 14 удалений

Просмотреть файл

@ -10,7 +10,6 @@
"Uno.Wasm.Bootstrap\\Uno.Wasm.Bootstrap.csproj",
"Uno.Wasm.MixedModeRoslynSample\\Uno.Wasm.MixedModeRoslynSample.csproj",
"Uno.Wasm.MixedModeSample\\Uno.Wasm.MixedModeSample.csproj",
"Uno.Wasm.Node.Sample.Runner\\Uno.Wasm.Node.Sample.Runner.njsproj",
"Uno.Wasm.Node.Sample\\Uno.Wasm.Node.Sample.csproj",
"Uno.Wasm.SampleNet5.Aot\\Uno.Wasm.SampleNet5.Aot.csproj",
"Uno.Wasm.SampleNet5\\Uno.Wasm.SampleNet5.csproj",
@ -23,10 +22,11 @@
"Uno.Wasm.Tests.Empty\\Uno.Wasm.Test.Empty.csproj",
"Uno.Wasm.Tests.Shared\\Uno.Wasm.Tests.Shared.shproj",
"Uno.Wasm.Tests.TypeScript\\Uno.Wasm.Tests.TypeScript.csproj",
"Uno.Wasm.Threads.Shared\\Uno.Wasm.Threads.Shared.shproj",
"Uno.Wasm.Threads\\Uno.Wasm.Threads.csproj",
"Uno.Wasm.TimezoneData\\Uno.Wasm.TimezoneData.csproj",
"Uno.WasmSample WithSpace Aot\\Uno.WasmSample.WithSpace.Aot.csproj",
"Uno.WasmSample WithSpace\\Uno.WasmSample.WithSpace.csproj"
]
}
}
}

Просмотреть файл

@ -90,17 +90,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.SampleNet6", "Uno.
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Embedded", "Embedded", "{DF5C402A-5CB7-4692-BDB3-93F734E214FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uno.Wasm.Embedded.Host", "Uno.Wasm.Embedded.Host\Uno.Wasm.Embedded.Host.csproj", "{EF3A95B2-32EE-4CAA-8235-B2AD6C540389}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.Embedded.Host", "Uno.Wasm.Embedded.Host\Uno.Wasm.Embedded.Host.csproj", "{EF3A95B2-32EE-4CAA-8235-B2AD6C540389}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Uno.Wasm.Embedded.App", "Uno.Wasm.Embedded.App\Uno.Wasm.Embedded.App.csproj", "{B401928C-600E-4450-ADFF-20EADC7CE3EC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.Embedded.App", "Uno.Wasm.Embedded.App\Uno.Wasm.Embedded.App.csproj", "{B401928C-600E-4450-ADFF-20EADC7CE3EC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.MetadataUpdater", "Uno.Wasm.MetadataUpdater\Uno.Wasm.MetadataUpdater.csproj", "{0E0EF69E-4FE1-463E-9939-8147D122D50E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Uno.Wasm.StaticLinking.PgAot.ProfileGen.Net5", "Uno.Wasm.StaticLinking.PgAot.ProfileGen.Net5\Uno.Wasm.StaticLinking.PgAot.ProfileGen.Net5.csproj", "{2DF55561-12DD-4325-BDBF-F42AC72FC284}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
Uno.Wasm.Tests.Shared\Uno.Wasm.Tests.Shared.projitems*{237820d2-9ebd-4e55-b5c3-9b50e628b8d3}*SharedItemsImports = 13
Uno.Wasm.Sample\Uno.Wasm.Sample.projitems*{2477f160-939b-4b9f-b9cd-9100fcd24e34}*SharedItemsImports = 5
Uno.Wasm.AotTests.Shared\Uno.Wasm.AotTests.Shared.projitems*{286b5778-da8b-4965-9fc6-bc6f4258e155}*SharedItemsImports = 13
Uno.Wasm.StaticLinking.Shared\Uno.Wasm.StaticLinking.Shared.projitems*{2df55561-12dd-4325-bdbf-f42ac72fc284}*SharedItemsImports = 5
Uno.Wasm.Tests.Shared\Uno.Wasm.Tests.Shared.projitems*{2df55561-12dd-4325-bdbf-f42ac72fc284}*SharedItemsImports = 5
Uno.Wasm.AotTests.Shared\Uno.Wasm.AotTests.Shared.projitems*{7ee991bb-c93d-4720-854c-1e708b652ef1}*SharedItemsImports = 5
Uno.Wasm.Tests.Shared\Uno.Wasm.Tests.Shared.projitems*{7ee991bb-c93d-4720-854c-1e708b652ef1}*SharedItemsImports = 5
Uno.Wasm.StaticLinking.Shared\Uno.Wasm.StaticLinking.Shared.projitems*{97e9b56a-be43-4590-a009-9ac135b371be}*SharedItemsImports = 5
@ -256,6 +260,10 @@ Global
{0E0EF69E-4FE1-463E-9939-8147D122D50E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0E0EF69E-4FE1-463E-9939-8147D122D50E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0E0EF69E-4FE1-463E-9939-8147D122D50E}.Release|Any CPU.Build.0 = Release|Any CPU
{2DF55561-12DD-4325-BDBF-F42AC72FC284}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2DF55561-12DD-4325-BDBF-F42AC72FC284}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2DF55561-12DD-4325-BDBF-F42AC72FC284}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2DF55561-12DD-4325-BDBF-F42AC72FC284}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -295,6 +303,7 @@ Global
{DF5C402A-5CB7-4692-BDB3-93F734E214FA} = {35E84E5F-1C9B-4168-8333-216B456C12DF}
{EF3A95B2-32EE-4CAA-8235-B2AD6C540389} = {DF5C402A-5CB7-4692-BDB3-93F734E214FA}
{B401928C-600E-4450-ADFF-20EADC7CE3EC} = {DF5C402A-5CB7-4692-BDB3-93F734E214FA}
{2DF55561-12DD-4325-BDBF-F42AC72FC284} = {5F914B7D-AFA2-4145-9548-B1B3A16D77AE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FA350FE9-9316-4846-8145-356F9A0ACBC7}

Просмотреть файл

@ -796,16 +796,6 @@ namespace Uno.Wasm.Bootstrap
{
var profilerSupport = Path.Combine(BuildTaskBasePath, "..", "tools", "support", "Uno.Wasm.Profiler.dll");
referencePathsParameter += $" \"{AlignPath(profilerSupport)}\"";
var profilerInitialize = new[] {
"#include <emscripten.h>",
"void mono_profiler_init_aot (const char *desc);",
"EMSCRIPTEN_KEEPALIVE void mono_wasm_load_profiler_aot (const char *desc) { mono_profiler_init_aot (desc); }"
};
var profilerBootstrap = Path.Combine(IntermediateOutputPath, "profiler-bootstrap.c");
File.WriteAllLines(profilerBootstrap, profilerInitialize);
packagerParams.Add($"\"--native-compile={AlignPath(profilerBootstrap)}\"");
}
var extraEmccFlagsPararm = string.Join(" ", extraEmccFlags).Replace("\\", "\\\\");

Просмотреть файл

@ -0,0 +1,3 @@
<linker>
<assembly fullname="Uno.Wasm.StaticLinking.PgAot.ProfileGen.Net5"/>
</linker>

Просмотреть файл

@ -0,0 +1,71 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<OutputType>Exe</OutputType>
<IsPackable>false</IsPackable>
<StartupObject>Uno.Wasm.Sample.Program</StartupObject>
<MonoRuntimeDebuggerEnabled Condition="'$(Configuration)'=='Debug'">true</MonoRuntimeDebuggerEnabled>
<WasmShellMonoRuntimeExecutionMode Condition="'$(UseAOT)'=='true'">InterpreterAndAOT</WasmShellMonoRuntimeExecutionMode>
<WasmShellEnableEmccProfiling>true</WasmShellEnableEmccProfiling>
<WasmShellGenerateAOTProfile>true</WasmShellGenerateAOTProfile>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Content\**" />
<Content Remove="Content\**" />
<EmbeddedResource Remove="Content\**" />
<None Remove="Content\**" />
</ItemGroup>
<ItemGroup Condition="'$(UseAOT)'=='true'">
<WasmShellEnableAotProfile Include="aot.profile" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="12.0.1" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
</ItemGroup>
<Import Project="..\Uno.Wasm.Tests.Shared\Uno.Wasm.Tests.Shared.projitems" Label="Shared" />
<Import Project="..\Uno.Wasm.StaticLinking.Shared\Uno.Wasm.StaticLinking.Shared.projitems" Label="Shared" />
<Import Project="..\Uno.Wasm.Bootstrap\build\Uno.Wasm.Bootstrap.targets" />
<Import Project="..\Uno.Wasm.Bootstrap.DevServer\build\Uno.Wasm.Bootstrap.DevServer.targets" />
<ItemGroup>
<WasmShellMonoEnvironment Include="MONO_GC_PARAMS" Value="soft-heap-limit=512m,nursery-size=64m,evacuation-threshold=66,major=marksweep" />
<WasmShellMonoEnvironment Include="MONO_LOG_LEVEL" Value="debug" />
<WasmShellMonoEnvironment Include="MONO_LOG_MASK" Value="all" />
</ItemGroup>
<ItemGroup>
<WasmShellExtraEmccFlags Include="-s USE_LIBPNG=1" />
</ItemGroup>
<ItemGroup Condition="'$(UseAOT)'=='true'">
<WasmShellAdditionalPInvokeLibrary Include="libc" />
</ItemGroup>
<ItemGroup>
<LinkerDescriptor Include="LinkerConfig.xml" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Uno.Wasm.Bootstrap.Cli\Uno.Wasm.Bootstrap.Cli.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
<ProjectReference Include="..\Uno.Wasm.Bootstrap\Uno.Wasm.Bootstrap.csproj">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
</ItemGroup>
<Target Name="_validateProfileGenerationFlags" BeforeTargets="BeforeBuild">
<Error Condition="'$(WasmShellGenerateAOTProfile)'!=''" Text="WasmShellGenerateAOTProfile must be set to true for this sample" />
</Target>
</Project>

Просмотреть файл

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<customErrors mode="Off"/>
</system.web>
<system.webServer>
<!-- Disable compression as we're doing it throuh pre-compressed files -->
<urlCompression doStaticCompression="false" doDynamicCompression="false" dynamicCompressionBeforeCache="false" />
<staticContent>
<remove fileExtension=".dll" />
<remove fileExtension=".wasm" />
<remove fileExtension=".woff" />
<remove fileExtension=".woff2" />
<mimeMap fileExtension=".wasm" mimeType="application/wasm" />
<mimeMap fileExtension=".clr" mimeType="application/octet-stream" />
<mimeMap fileExtension=".pdb" mimeType="application/octet-stream" />
<mimeMap fileExtension=".woff" mimeType="application/font-woff" />
<mimeMap fileExtension=".woff2" mimeType="application/font-woff" />
<!-- Required for PWAs -->
<mimeMap fileExtension=".json" mimeType="application/octet-stream" />
</staticContent>
<rewrite>
<rules>
<rule name="Lookup for pre-compressed brotli file" stopProcessing="true">
<match url="(.*)$"/>
<conditions>
<!-- Match brotli requests -->
<add input="{HTTP_ACCEPT_ENCODING}" pattern="br" />
<!-- Match all but pre-compressed files -->
<add input="{REQUEST_URI}" pattern="^(?!/_compressed_br/)(.*)$" />
<!-- Check if the pre-compressed file exists on the disk -->
<add input="{DOCUMENT_ROOT}/_compressed_br/{C:0}" matchType="IsFile" negate="false" />
</conditions>
<action type="Rewrite" url="/_compressed_br{C:0}" />
</rule>
<rule name="Lookup for pre-compressed gzip file" stopProcessing="true">
<match url="(.*)$"/>
<conditions>
<!-- Match gzip requests -->
<add input="{HTTP_ACCEPT_ENCODING}" pattern="gzip" />
<!-- Match all but pre-compressed files -->
<add input="{REQUEST_URI}" pattern="^(?!/_compressed_gz/)(.*)$" />
<!-- Check if the pre-compressed file exists on the disk -->
<add input="{DOCUMENT_ROOT}/_compressed_gz/{C:0}" matchType="IsFile" negate="false" />
</conditions>
<action type="Rewrite" url="/_compressed_gz{C:0}" />
</rule>
</rules>
<outboundRules>
<rule name="Adjust content encoding for gzip pre-compressed files" enabled="true" stopProcessing="true">
<match serverVariable="RESPONSE_CONTENT_ENCODING" pattern="" />
<conditions>
<add input="{REQUEST_URI}" pattern="/_compressed_gz/.*$" />
</conditions>
<action type="Rewrite" value="gzip"/>
</rule>
<rule name="Adjust content encoding for brotli pre-compressed files" enabled="true" stopProcessing="true">
<match serverVariable="RESPONSE_CONTENT_ENCODING" pattern="" />
<conditions>
<add input="{REQUEST_URI}" pattern="/_compressed_br/.*$" />
</conditions>
<action type="Rewrite" value="br"/>
</rule>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>