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

[wasi] Fix support for paths with spaces #85022

Merged
merged 4 commits into from
Apr 27, 2023
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
2 changes: 1 addition & 1 deletion src/mono/wasi/Wasi.Build.Tests/Wasi.Build.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<InstallWorkloadForTesting>true</InstallWorkloadForTesting>

<!-- don't run any wasm build steps -->
<IsBrowserWasmProject>false</IsBrowserWasmProject>
<IsWasiProject>false</IsWasiProject>
lewing marked this conversation as resolved.
Show resolved Hide resolved
<UseDefaultTestHost>true</UseDefaultTestHost>

<EnableRunSettingsSupport>false</EnableRunSettingsSupport>
Expand Down
10 changes: 5 additions & 5 deletions src/mono/wasi/build/WasiApp.Native.targets
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
</PropertyGroup>
</Target>

<Target Name="_WasiBuildNativeCore" DependsOnTargets="$(_WasiBuildNativeCoreDependsOn)" Condition="'$(WasmBuildNative)' == 'true'" />
<Target Name="_WasiBuildNativeCore" BeforeTargets="_WasiGenerateAppBundle" DependsOnTargets="$(_WasiBuildNativeCoreDependsOn)" Condition="'$(WasmBuildNative)' == 'true'" />

<Target Name="_PrepareForWasiBuildNative">
<Error Condition="'$(_IsToolchainMissing)' == 'true'"
Expand Down Expand Up @@ -446,8 +446,8 @@
<_WasiFilePathForFixup Include="@(_WasmNativeFileForLinking)" />
<_WasiFilePathForFixup Include="@(_WasmRuntimePackSrcFile)" />

<_WasiSdkClangArgs Condition="'$(OS)' == 'Windows_NT'" Include="$([System.String]::new(%(_WasiFilePathForFixup.Identity)).Replace('\', '/'))" />
<_WasiSdkClangArgs Condition="'$(OS)' != 'Windows_NT'" Include="@(_WasiFilePathForFixup)" />
<_WasiSdkClangArgs Condition="'$(OS)' == 'Windows_NT'" Include="&quot;$([System.String]::new(%(_WasiFilePathForFixup.Identity)).Replace('\', '/'))&quot;" />
<_WasiSdkClangArgs Condition="'$(OS)' != 'Windows_NT'" Include="@(_WasiFilePathForFixup -> '&quot;%(Identity)&quot;')" />

<_WasiSdkClangArgs Include="@(_WasmCommonCFlags)" />

Expand All @@ -470,9 +470,9 @@

<WriteLinesToFile Lines="@(_WasiSdkClangArgs)" File="$(_WasmIntermediateOutputPath)clang-compile.rsp" Overwrite="true" />
<!--<Message Importance="High" Text="Performing WASI SDK build: &quot;$(WasiClang)&quot; @(_WasiSdkClangArgs, ' ')" />-->
<Message Importance="High" Text="Performing WASI SDK build: &quot;$(WasiClang)&quot; @$(_WasmIntermediateOutputPath)clang-compile.rsp" />
<Message Importance="High" Text="Performing WASI SDK build: &quot;$(WasiClang)&quot; &quot;@$(_WasmIntermediateOutputPath)clang-compile.rsp&quot;" />
<!--<Exec Command="&quot;$(WasiClang)&quot; @(_WasiSdkClangArgs, ' ')" />-->
<Exec Command="&quot;$(WasiClang)&quot; @$(_WasmIntermediateOutputPath)clang-compile.rsp" />
<Exec Command="&quot;$(WasiClang)&quot; &quot;@$(_WasmIntermediateOutputPath)clang-compile.rsp&quot;" />

<!-- FIXME: this will be done by the bundler -->
<Copy SourceFiles="$(_WasmOutputFileName)" DestinationFolder="$(WasmAppDir)" />
Expand Down
2 changes: 0 additions & 2 deletions src/mono/wasi/build/WasiApp.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
<RuntimeIdentifier>wasi-wasm</RuntimeIdentifier>
<UseMonoRuntime>true</UseMonoRuntime>
<TrimMode Condition="'$(TrimMode)' == ''">partial</TrimMode>
<WasmBuildNativeTarget>_WasiBuildNativeCore</WasmBuildNativeTarget>

<_WasmBuildCoreDependsOn>
_InitializeCommonProperties;
_PrepareForAfterBuild;
_BeforeWasmBuildApp;
$(WasmBuildNativeTarget);
_WasiGenerateAppBundle;
</_WasmBuildCoreDependsOn>
<WasmBuildAppDependsOn>
Expand Down
6 changes: 3 additions & 3 deletions src/mono/wasi/build/WasiApp.targets
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@

<Target Name="WasmTriggerPublishApp"
AfterTargets="$(WasmTriggerPublishAppAfterThisTarget)"
Condition="'$(IsWasmProject)' == 'true' and '$(WasmBuildingForNestedPublish)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">
Condition="'$(IsWasiProject)' == 'true' and '$(WasmBuildingForNestedPublish)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'">

<!-- Use a unique property, so the already run wasm targets can also run -->
<MSBuild Projects="$(MSBuildProjectFile)"
Expand Down Expand Up @@ -221,7 +221,7 @@
<Target Name="WasmBuildApp"
AfterTargets="$(WasmBuildAppAfterThisTarget)"
DependsOnTargets="$(WasmBuildAppDependsOn)"
Condition="'$(IsWasmProject)' == 'true' and '$(WasmBuildingForNestedPublish)' == '' and '$(WasmBuildOnlyAfterPublish)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'" />
Condition="'$(IsWasiProject)' == 'true' and '$(WasmBuildingForNestedPublish)' == '' and '$(WasmBuildOnlyAfterPublish)' != 'true' and '$(IsCrossTargetingBuild)' != 'true'" />

<Target Name="_InitializeCommonProperties">
<Error Condition="'$(MicrosoftNetCoreAppRuntimePackDir)' == '' and ('%(ResolvedRuntimePack.PackageDirectory)' == '' or !Exists(%(ResolvedRuntimePack.PackageDirectory)))"
Expand Down Expand Up @@ -385,7 +385,7 @@
<FileWrites Include="$(WasmRunWasmtimeScriptPath)" />
</ItemGroup>

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

<Target Name="_WasmResolveReferences" Condition="'$(WasmResolveAssembliesBeforeBuild)' == 'true'">
Expand Down