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/8.0-staging] [browser] Remove experimental args from NodeJS WBT runner #113008

Open
wants to merge 4 commits into
base: release/8.0-staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 src/mono/wasm/Wasm.Build.Tests/ConfigSrcTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ConfigSrcTests(ITestOutputHelper output, SharedBuildPerTestClassFixture b

// NOTE: port number determinizes dynamically, so could not generate absolute URI
[Theory]
[BuildAndRun(host: RunHost.V8 | RunHost.NodeJS)]
[BuildAndRun(host: RunHost.V8)]
public void ConfigSrcAbsolutePath(BuildArgs buildArgs, RunHost host, string id)
{
buildArgs = buildArgs with { ProjectName = $"configsrcabsolute_{buildArgs.Config}_{buildArgs.AOT}" };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ namespace Wasm.Build.Tests;
public class NodeJSHostRunner : IHostRunner
{
public string GetTestCommand() => "wasm test";
public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh";
public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale} --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh";
public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace";
public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale}";
public bool UseWasmConsoleOutput() => true;
public bool CanRunWBT() => true;
}
2 changes: 0 additions & 2 deletions src/mono/wasm/Wasm.Build.Tests/WasmSIMDTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ public void Build_NoAOT_ShouldNotRelink(BuildArgs buildArgs, RunHost host, strin
Assert.DoesNotContain("Compiling native assets with emcc", output);

RunAndTestWasmApp(buildArgs,
extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh" : "",
expectedExitCode: 42,
test: output =>
{
Expand All @@ -66,7 +65,6 @@ public void PublishWithSIMD_AOT(BuildArgs buildArgs, RunHost host, string id)
DotnetWasmFromRuntimePack: false));

RunAndTestWasmApp(buildArgs,
extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh" : "",
expectedExitCode: 42,
test: output =>
{
Expand Down
27 changes: 0 additions & 27 deletions src/mono/wasm/Wasm.Build.Tests/WasmTemplateTestBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,38 +49,11 @@ public string CreateWasmTemplateProject(string id, string template = "wasmbrowse
if (runAnalyzers)
extraProperties += "<RunAnalyzers>true</RunAnalyzers>";

if (template == "wasmconsole")
{
UpdateRuntimeconfigTemplateForNode(_projectDir);
}

AddItemsPropertiesToProject(projectfile, extraProperties);

return projectfile;
}

private static void UpdateRuntimeconfigTemplateForNode(string projectDir)
{
// TODO: Can be removed once Node >= 20

string runtimeconfigTemplatePath = Path.Combine(projectDir, "runtimeconfig.template.json");
string runtimeconfigTemplateContent = File.ReadAllText(runtimeconfigTemplatePath);
var runtimeconfigTemplate = JsonObject.Parse(runtimeconfigTemplateContent);
if (runtimeconfigTemplate == null)
throw new Exception($"Unable to parse runtimeconfigtemplate at '{runtimeconfigTemplatePath}'");

var perHostConfigs = runtimeconfigTemplate?["wasmHostProperties"]?["perHostConfig"]?.AsArray();
if (perHostConfigs == null || perHostConfigs.Count == 0 || perHostConfigs[0] == null)
throw new Exception($"Unable to find perHostConfig in runtimeconfigtemplate at '{runtimeconfigTemplatePath}'");

perHostConfigs[0]!["host-args"] = new JsonArray(
"--experimental-wasm-simd",
"--experimental-wasm-eh"
);

File.WriteAllText(runtimeconfigTemplatePath, runtimeconfigTemplate!.ToString());
}

public (string projectDir, string buildOutput) BuildTemplateProject(BuildArgs buildArgs,
string id,
BuildProjectOptions buildProjectOptions)
Expand Down
Loading