-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
<WasiAfterRuntimeLoaded> is broken in wasi-wasm workflow #92551
Comments
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsDescriptionProcessing of Reproduction Stepscsproj:
attach_internal_calls.c: #include <stdlib.h>
void attach_internal_calls()
{
} Run
Expected behaviorBuilds correctly. Actual behavior
The problem is this list concat within a list. <ItemGroup>
<WasiAfterRuntimeLoadedDeclarations Include="@(WasiAfterRuntimeLoaded->'void %(Identity)();')" />
<WasiAfterRuntimeLoadedCalls Include="@(WasiAfterRuntimeLoaded->'%(Identity)();')" />
</ItemGroup>
<ItemGroup>
<_WasiSdkClangArgs Condition="'@(WasiAfterRuntimeLoadedDeclarations)' != ''"
Include="-D WASI_AFTER_RUNTIME_LOADED_DECLARATIONS="@(WasiAfterRuntimeLoadedDeclarations, ' ')"" />
<_WasiSdkClangArgs Condition="'@(WasiAfterRuntimeLoadedCalls)' != ''"
Include="-D WASI_AFTER_RUNTIME_LOADED_CALLS="@(WasiAfterRuntimeLoadedCalls, ' ')"" />
</ItemGroup> Regression?Technically yes. This used to work in the old Known WorkaroundsI am not an MsBuild expert, but this works (though I assume there is a more elegant workaround): <ItemGroup>
<WasiAfterRuntimeLoadedDeclarations Include="@(WasiAfterRuntimeLoaded->'void %(Identity)();')" />
<WasiAfterRuntimeLoadedCalls Include="@(WasiAfterRuntimeLoaded->'%(Identity)();')" />
</ItemGroup>
<PropertyGroup>
<_WasiAfterRuntimeLoadedDeclarationsString>@(WasiAfterRuntimeLoadedDeclarations, ' ')</_WasiAfterRuntimeLoadedDeclarationsString>
<_WasiAfterRuntimeLoadedCallsString>@(WasiAfterRuntimeLoadedCalls, ' ')</_WasiAfterRuntimeLoadedCallsString>
<_WasiAfterRuntimeLoadedDeclarationsString>$(_WasiAfterRuntimeLoadedDeclarationsString.Replace('%0d%0a', '').Replace('%0a', '').Replace('%0d', ''))</_WasiAfterRuntimeLoadedDeclarationsString>
<_WasiAfterRuntimeLoadedCallsString>$(_WasiAfterRuntimeLoadedCallsString.Replace('%0d%0a', '').Replace('%0a', '').Replace('%0d', ''))</_WasiAfterRuntimeLoadedCallsString>
</PropertyGroup>
<ItemGroup>
<_WasiSdkClangArgs Condition="'$(_WasiAfterRuntimeLoadedDeclarationsString)' != ''" Include="-D WASI_AFTER_RUNTIME_LOADED_DECLARATIONS="$(_WasiAfterRuntimeLoadedDeclarationsString)"" />
<_WasiSdkClangArgs Condition="'$(_WasiAfterRuntimeLoadedCallsString)' != ''" Include="-D WASI_AFTER_RUNTIME_LOADED_CALLS="$(_WasiAfterRuntimeLoadedCallsString)"" />
</ItemGroup> Basically instead of concatenating inside an item, it now happens outside as a property. ConfigurationTested with Other information
|
Description
Processing of
WasiAfterRuntimeLoaded
entries inWasiApp.Native.targets
is invalid and does not compile.Reproduction Steps
csproj:
attach_internal_calls.c:
Run
Expected behavior
Builds correctly.
Actual behavior
The problem is this list concat within a list.
Regression?
Technically yes. This used to work in the old
dotnet-wasi-sdk
because it did not use item list to create Clang argsKnown Workarounds
I am not an MsBuild expert, but this works (though I assume there is a more elegant workaround):
Basically instead of concatenating inside an item, it now happens outside as a property.
But the first projection creates a trailing new line, which needs to be replaced (or, again, perhaps there is a better method - that is why I decided to not PR this "fix").
Configuration
Tested with
Microsoft.NET.Runtime.WebAssembly.Wasi.Sdk
, version8.0.0-rc.1.23419.4
.Other information
The text was updated successfully, but these errors were encountered: