Skip to content

Commit

Permalink
[wasm] Do not set _WasmDevel=true for blazor projects
Browse files Browse the repository at this point in the history
to workaround wasm-ld getting oomkilled.

Fixes dotnet#66725, and dotnet#66591
  • Loading branch information
radical authored Mar 17, 2022
1 parent a1bc0f3 commit c5e19e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRel
AddItemsPropertiesToProject(projectFile, extraProperties: nativeRelink ? string.Empty : "<RunAOTCompilation>true</RunAOTCompilation>");

// build with -p:DeployOnBuild=true, and that will trigger a publish
(CommandResult res, _) = BuildInternal(id, config, publish: false, "-p:DeployOnBuild=true");
(CommandResult res, _) = BuildInternal(id, config, publish: false, setWasmDevel: false, "-p:DeployOnBuild=true");

var expectedFileType = nativeRelink ? NativeFilesType.Relinked : NativeFilesType.AOT;

Expand Down
8 changes: 4 additions & 4 deletions src/tests/BuildWasmApps/Wasm.Build.Tests/BuildTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ public string CreateBlazorWasmTemplateProject(string id)

protected (CommandResult, string) BlazorBuild(BlazorBuildOptions options, params string[] extraArgs)
{
var res = BuildInternal(options.Id, options.Config, publish: false, extraArgs);
var res = BuildInternal(options.Id, options.Config, publish: false, setWasmDevel: false, extraArgs);
AssertDotNetNativeFiles(options.ExpectedFileType, options.Config, forPublish: false, targetFramework: options.TargetFramework);
AssertBlazorBundle(options.Config, isPublish: false, dotnetWasmFromRuntimePack: options.ExpectedFileType == NativeFilesType.FromRuntimePack);

Expand All @@ -407,7 +407,7 @@ public string CreateBlazorWasmTemplateProject(string id)

protected (CommandResult, string) BlazorPublish(BlazorBuildOptions options, params string[] extraArgs)
{
var res = BuildInternal(options.Id, options.Config, publish: true, extraArgs);
var res = BuildInternal(options.Id, options.Config, publish: true, setWasmDevel: false, extraArgs);
AssertDotNetNativeFiles(options.ExpectedFileType, options.Config, forPublish: true, targetFramework: options.TargetFramework);
AssertBlazorBundle(options.Config, isPublish: true, dotnetWasmFromRuntimePack: options.ExpectedFileType == NativeFilesType.FromRuntimePack);

Expand All @@ -423,7 +423,7 @@ public string CreateBlazorWasmTemplateProject(string id)
return res;
}

protected (CommandResult, string) BuildInternal(string id, string config, bool publish=false, params string[] extraArgs)
protected (CommandResult, string) BuildInternal(string id, string config, bool publish=false, bool setWasmDevel=true, params string[] extraArgs)
{
string label = publish ? "publish" : "build";
Console.WriteLine($"{Environment.NewLine}** {label} **{Environment.NewLine}");
Expand All @@ -435,7 +435,7 @@ public string CreateBlazorWasmTemplateProject(string id)
$"-bl:{logPath}",
$"-p:Configuration={config}",
"-p:BlazorEnableCompression=false",
"-p:_WasmDevel=true"
setWasmDevel ? "-p:_WasmDevel=true" : string.Empty
}.Concat(extraArgs).ToArray();

CommandResult res = new DotNetCommand(s_buildEnv)
Expand Down

0 comments on commit c5e19e7

Please sign in to comment.