Skip to content

Commit da69fcc

Browse files
committed
Fix wasi/windows builds where WasmAssemblyFileName contains the path also
1 parent 7389ddd commit da69fcc

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

src/libraries/tests.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@
541541
<GrpcTestProject Include="$(RepoRoot)\src\tests\FunctionalTests\Android\Device_Emulator\gRPC\Android.Device_Emulator.gRPC.Test.csproj" />
542542
</ItemGroup>
543543

544+
<!-- wasi/interp smoke tests -->
544545
<ItemGroup Condition="'$(TargetOS)' == 'wasi' and '$(RunAOTCompilation)' != 'true'">
545546
<SmokeTestProject Include="$(MSBuildThisFileDirectory)Microsoft.XmlSerializer.Generator\tests\Microsoft.XmlSerializer.Generator.Tests.csproj" />
546547
<SmokeTestProject Include="$(MSBuildThisFileDirectory)System.Collections.Specialized\tests\System.Collections.Specialized.Tests.csproj" />

src/mono/wasi/build/WasiApp.targets

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,11 @@
280280

281281
<PropertyGroup>
282282
<WasmAppDir Condition="'$(WasmAppDir)' == ''">$([MSBuild]::NormalizeDirectory($(OutputPath), 'AppBundle'))</WasmAppDir>
283+
283284
<WasmMainAssemblyFileName Condition="'$(WasmMainAssemblyFileName)' == ''">$(TargetFileName)</WasmMainAssemblyFileName>
285+
<!-- Ensure this is only the filename -->
286+
<WasmMainAssemblyFileName Condition="'$(WasmMainAssemblyFileName)' != ''">$([System.IO.Path]::GetFileName($(WasmMainAssemblyFileName)))</WasmMainAssemblyFileName>
287+
284288
<_WasmOutputFileName Condition="'$(WasmSingleFileBundle)' == 'true'">$([System.IO.Path]::GetFileNameWithoutExtension('$(WasmMainAssemblyFileName)')).wasm</_WasmOutputFileName>
285289
<_WasmOutputFileName Condition="'$(WasmSingleFileBundle)' != 'true'">dotnet.wasm</_WasmOutputFileName>
286290
<_WasmOutputFileName>$([System.IO.Path]::Combine($(_WasmIntermediateOutputPath), $(_WasmOutputFileName)))</_WasmOutputFileName>

src/mono/wasm/build/WasmApp.targets

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
- $(WasmAllowUndefinedSymbols) - Controls whether undefined symbols are allowed or not,
8282
if true, appends 'allow-undefined' and sets 'ERROR_ON_UNDEFINED_SYMBOLS=0' as arguments for wasm-ld,
8383
if false (default), removes 'allow-undefined' and sets 'ERROR_ON_UNDEFINED_SYMBOLS=1'.
84-
- $(WasmRuntimeAssetsLocation) - Allows to override a location for build generated files.
84+
- $(WasmRuntimeAssetsLocation) - Allows to override a location for build generated files.
8585
Defaults to '_framework', if you want to put framework files in the same directory as user files, use './' value.
8686
Output structure
8787
- AppBundle directly contains user files
@@ -316,7 +316,10 @@
316316

317317
<PropertyGroup>
318318
<WasmAppDir Condition="'$(WasmAppDir)' == ''">$([MSBuild]::NormalizeDirectory($(OutputPath), 'AppBundle'))</WasmAppDir>
319+
319320
<WasmMainAssemblyFileName Condition="'$(WasmMainAssemblyFileName)' == ''">$(TargetFileName)</WasmMainAssemblyFileName>
321+
<!-- Ensure this is only the filename -->
322+
<WasmMainAssemblyFileName Condition="'$(WasmMainAssemblyFileName)' != ''">$([System.IO.Path]::GetFileName($(WasmMainAssemblyFileName)))</WasmMainAssemblyFileName>
320323

321324
<WasmAppDir>$([MSBuild]::NormalizeDirectory($(WasmAppDir)))</WasmAppDir>
322325

@@ -370,8 +373,8 @@
370373
<Target Name="_GetWasmGenerateAppBundleDependencies">
371374
<Warning Condition="'$(InvariantGlobalization)' == 'true' and '$(HybridGlobalization)' == 'true'" Text="%24(HybridGlobalization) has no effect when %24(InvariantGlobalization) is set to true." />
372375
<Warning Condition="'$(WasmIcuDataFileName)' != '' and '$(HybridGlobalization)' == 'true'" Text="%24(WasmIcuDataFileName) has no effect when %24(HybridGlobalization) is set to true." />
373-
<Warning Condition="'$(InvariantGlobalization)' != 'true' and '$(WasmIncludeFullIcuData)' == 'true' and '$(WasmIcuDataFileName)' != ''" Text="%24(WasmIcuDataFileName) has no effect when %24(WasmIncludeFullIcuData) is set to true." />
374-
376+
<Warning Condition="'$(InvariantGlobalization)' != 'true' and '$(WasmIncludeFullIcuData)' == 'true' and '$(WasmIcuDataFileName)' != ''" Text="%24(WasmIcuDataFileName) has no effect when %24(WasmIncludeFullIcuData) is set to true." />
377+
375378
<PropertyGroup>
376379
<_HasDotnetWasm Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.wasm'">true</_HasDotnetWasm>
377380
<_HasDotnetJsWorker Condition="'%(WasmNativeAsset.FileName)%(WasmNativeAsset.Extension)' == 'dotnet.native.worker.js'">true</_HasDotnetJsWorker>
@@ -418,7 +421,7 @@
418421
Outputs="$(WasmAppDir)\.stamp"
419422
Condition="'$(WasmGenerateAppBundle)' == 'true'"
420423
DependsOnTargets="_WasmGenerateRuntimeConfig;_GetWasmGenerateAppBundleDependencies">
421-
424+
422425
<PropertyGroup>
423426
<_WasmAppIncludeThreadsWorker Condition="'$(WasmEnableThreads)' == 'true' or '$(MonoWasmBuildVariant)' == 'multithread'">true</_WasmAppIncludeThreadsWorker>
424427
<!-- TODO: set this from some user-facing property? -1 means use the default baked into dotnet.native.js -->

src/mono/wasm/shared/data/aot-tests/ProxyProjectForAOTOnHelix.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
<PropertyGroup>
3131
<WasmAppDir>$(TestRootDir)AppBundle\</WasmAppDir>
32-
<WasmMainAssemblyFileName>$(OriginalPublishDir)WasmTestRunner.dll</WasmMainAssemblyFileName>
32+
<WasmMainAssemblyFileName>WasmTestRunner.dll</WasmMainAssemblyFileName>
3333
<WasmMainJSPath>$(OriginalPublishDir)test-main.js</WasmMainJSPath>
3434
<WasmGenerateRunV8Script Condition="'$(WasmGenerateRunV8Script)' == ''">true</WasmGenerateRunV8Script>
3535
</PropertyGroup>

0 commit comments

Comments
 (0)