Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class BuildEnvironment
public static readonly string RelativeTestAssetsPath = @"..\testassets\";
public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets");
public static readonly string TestDataPath = Path.Combine(AppContext.BaseDirectory, "data");
public static readonly string TmpPath = Path.Combine(AppContext.BaseDirectory, "wbt");
public static readonly string TmpPath = Path.Combine(AppContext.BaseDirectory, "wbt artifacts");

public static readonly string DefaultRuntimeIdentifier =
#if TARGET_WASI
Expand Down
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 @@ -32,6 +32,6 @@ public void ConfigSrcAbsolutePath(BuildArgs buildArgs, RunHost host, string id)
string bundleDir = Path.Combine(binDir, "AppBundle");
string configSrc = Path.GetFullPath(Path.Combine(bundleDir, "_framework", "blazor.boot.json"));

RunAndTestWasmApp(buildArgs, expectedExitCode: 42, host: host, id: id, extraXHarnessMonoArgs: $"--config-src={configSrc}");
RunAndTestWasmApp(buildArgs, expectedExitCode: 42, host: host, id: id, extraXHarnessMonoArgs: $"--config-src=\"{configSrc}\"");
}
}
2 changes: 1 addition & 1 deletion src/mono/wasm/Wasm.Build.Tests/NativeBuildTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void IntermediateBitcodeToObjectFilesAreNotLLVMIR(BuildArgs buildArgs, st
{
string printFileTypeTarget = @"
<Target Name=""PrintIntermediateFileType"" AfterTargets=""WasmNestedPublishApp"">
<Exec Command=""wasm-dis $(_WasmIntermediateOutputPath)System.Private.CoreLib.dll.o -o $(_WasmIntermediateOutputPath)wasm-dis-out.txt""
<Exec Command=""wasm-dis &quot;$(_WasmIntermediateOutputPath)System.Private.CoreLib.dll.o&quot; -o &quot;$(_WasmIntermediateOutputPath)wasm-dis-out.txt&quot;""
EnvironmentVariables=""@(EmscriptenEnvVars)""
IgnoreExitCode=""true"">

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(string config, st
.WithWorkingDirectory(workingDir);

await using var runner = new BrowserRunner(_testOutput);
var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --project {projectFile} --forward-console");
var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --project \"{projectFile}\" --forward-console");
await runner.WaitForExitMessageAsync(TimeSpan.FromMinutes(2));
Assert.Contains("Hello, Browser!", string.Join(Environment.NewLine, runner.OutputLines));
}
Expand All @@ -287,7 +287,7 @@ private async Task BrowserRunTwiceWithAndThenWithoutBuildAsync(string config, st
.WithWorkingDirectory(workingDir);

await using var runner = new BrowserRunner(_testOutput);
var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --no-build --project {projectFile} --forward-console");
var page = await runner.RunAsync(runCommand, $"run --no-silent -c {config} --no-build --project \"{projectFile}\" --forward-console");
await runner.WaitForExitMessageAsync(TimeSpan.FromMinutes(2));
Assert.Contains("Hello, Browser!", string.Join(Environment.NewLine, runner.OutputLines));
}
Expand All @@ -307,7 +307,7 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP
string workingDir = runOutsideProjectDirectory ? BuildEnvironment.TmpPath : _projectDir!;

{
string runArgs = $"run --no-silent -c {config} --project {projectFile}";
string runArgs = $"run --no-silent -c {config} --project \"{projectFile}\"";
runArgs += " x y z";
using var cmd = new RunCommand(s_buildEnv, _testOutput, label: id)
.WithWorkingDirectory(workingDir)
Expand All @@ -323,7 +323,7 @@ private Task ConsoleRunWithAndThenWithoutBuildAsync(string config, string extraP

{
// Run with --no-build
string runArgs = $"run --no-silent -c {config} --project {projectFile} --no-build";
string runArgs = $"run --no-silent -c {config} --project \"{projectFile}\" --no-build";
runArgs += " x y z";
using var cmd = new RunCommand(s_buildEnv, _testOutput, label: id)
.WithWorkingDirectory(workingDir);
Expand Down
2 changes: 1 addition & 1 deletion src/mono/wasm/build/WasmApp.Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
</ItemGroup>

<!-- for AOT builds we use llvm-size tool to collect size of the DATA segment in each object file -->
<Exec Command="llvm-size$(_ExeExt) -d --format=sysv @(_AOTObjectFile, ' ')"
<Exec Command="llvm-size$(_ExeExt) -d --format=sysv @(_AOTObjectFile->'&quot;%(Identity)&quot;', ' ')"
Condition="'$(_WasmShouldAOT)' == 'true'"
IgnoreStandardErrorWarningFormat="true"
ConsoleToMsBuild="true"
Expand Down
12 changes: 6 additions & 6 deletions src/mono/wasm/build/WasmApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
- $(WasmAllowUndefinedSymbols) - Controls whether undefined symbols are allowed or not,
if true, appends 'allow-undefined' and sets 'ERROR_ON_UNDEFINED_SYMBOLS=0' as arguments for wasm-ld,
if false (default), removes 'allow-undefined' and sets 'ERROR_ON_UNDEFINED_SYMBOLS=1'.
- $(WasmRuntimeAssetsLocation) - Allows to override a location for build generated files.
- $(WasmRuntimeAssetsLocation) - Allows to override a location for build generated files.
Defaults to '_framework', if you want to put framework files in the same directory as user files, use './' value.
Output structure
- AppBundle directly contains user files
Expand Down Expand Up @@ -367,8 +367,8 @@
<Target Name="_GetWasmGenerateAppBundleDependencies">
<Warning Condition="'$(InvariantGlobalization)' == 'true' and '$(HybridGlobalization)' == 'true'" Text="%24(HybridGlobalization) has no effect when %24(InvariantGlobalization) is set to true." />
<Warning Condition="'$(WasmIcuDataFileName)' != '' and '$(HybridGlobalization)' == 'true'" Text="%24(WasmIcuDataFileName) has no effect when %24(HybridGlobalization) is set to true." />
<Warning Condition="'$(InvariantGlobalization)' != 'true' and '$(WasmIncludeFullIcuData)' == 'true' and '$(WasmIcuDataFileName)' != ''" Text="%24(WasmIcuDataFileName) has no effect when %24(WasmIncludeFullIcuData) is set to true." />
<Warning Condition="'$(InvariantGlobalization)' != 'true' and '$(WasmIncludeFullIcuData)' == 'true' and '$(WasmIcuDataFileName)' != ''" Text="%24(WasmIcuDataFileName) has no effect when %24(WasmIncludeFullIcuData) is set to true." />

<PropertyGroup>
<_HasDotnetWasm Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.wasm'">true</_HasDotnetWasm>
<_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.js'">true</_HasDotnetJsWorker>
Expand Down Expand Up @@ -415,7 +415,7 @@
Outputs="$(WasmAppDir)\.stamp"
Condition="'$(WasmGenerateAppBundle)' == 'true'"
DependsOnTargets="_WasmGenerateRuntimeConfig;_GetWasmGenerateAppBundleDependencies">

<PropertyGroup>
<_WasmAppIncludeThreadsWorker Condition="'$(WasmEnableThreads)' == 'true' or '$(MonoWasmBuildVariant)' == 'multithread'">true</_WasmAppIncludeThreadsWorker>
<!-- TODO: set this from some user-facing property? -1 means use the default baked into dotnet.native.js -->
Expand Down Expand Up @@ -473,7 +473,7 @@
</PropertyGroup>

<Error Condition="'$(WasmMainAssemblyFileName)' == ''" Text="%24(WasmMainAssemblyFileName) property needs to be set for generating $(WasmRunV8ScriptPath)." />

<WriteLinesToFile
File="$(WasmRunV8ScriptPath)"
Lines="$(V8ScriptShebang);v8 --expose_wasm --module $(_WasmMainJSFileName) -- ${RUNTIME_ARGS} --run $(WasmMainAssemblyFileName) $*"
Expand All @@ -484,7 +484,7 @@
<FileWrites Include="$(WasmRunV8ScriptPath)" />
</ItemGroup>

<Exec Condition="'$(OS)' != 'Windows_NT'" Command="chmod a+x $(WasmRunV8ScriptPath)" />
<Exec Condition="'$(OS)' != 'Windows_NT'" Command="chmod a+x &quot;$(WasmRunV8ScriptPath)&quot;" />
</Target>

<Target Name="_WasmResolveReferences" Condition="'$(WasmResolveAssembliesBeforeBuild)' == 'true'">
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/AotCompilerTask/MonoAOTCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -951,7 +951,7 @@ private PrecompileArguments GetPrecompileArgumentsFor(ITaskItem assemblyItem, st
if (isDedup)
{
foreach (var aItem in _assembliesToCompile!)
processArgs.Add(aItem.ItemSpec);
processArgs.Add($"\"{aItem.ItemSpec}\"");
}
else
{
Expand Down