You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some .c and .h files are being published for non-blazorwasm apps #48016
This seems to be intentional: #43785 (review). I think if we don't need the intermediate files, one cleaner option is that we separate out the "runtime pack with intermediates" from "standard runtime pack" (as the former is not for the common use-case for end-users, and requires WebAssembly compiler toolchain to be installed; to be able to relink with different arguments).
e.g. ./build.sh -os browser -c Release will not put these intermediate artifacts in artifacts//bin/native/net6.0-Browser-Release-wasm/src/, but, say a new OS, ./build.sh -os browser-extras -c Release will. This way, we will not need to modify src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props, as that is a flat whitelist of 'all possible files' and sfx targets (in arcade) validate the other way around; all files in destination directory (in this case artifacts//bin/native/net6.0-Browser-Release-wasm/src/) are present in the whitelist. So if a subset (like clr or mono) doesn't produce all those files, it is fine.
We need those files to compile the final dotnet executable, at least driver.c needs to stay a source file since its compiled with -D defines during the build. Maybe we can get them from the runtime pack instead of the publish dir. Not sure how they end up in the final app, we create the final app ourself in the bin/Release/AppBundle directory which doesn't contain these files.
Also, (unless it was intentional) the missing System.Runtime.InteropServices.RuntimeInformation.dll from .NET6 publish directory could be problematic.
It isn't problematic. This assembly is no longer necessary. In net5.0, AspNetCore.Components was using the RuntimeInformation.IsOSPlatform method from this assembly. In net6.0, that code has been changed to use the new OperatingSystem.IsXXX() methods. See dotnet/aspnetcore#28233.
By the way, we could change the SDK to have be more deliberate about what files are included (.dat, .blat, and the dotnet.wasm file). The SDK's globbing is very permissive today and there's no reason we couldn't flip it around
The SDK's globbing is very permissive today and there's no reason we couldn't flip it around
I believe this is intentional with the reasoning being that the runtime gets to pick what is and what isn't included in the output of the application. If the file is in the right directory of the runtimepack, the intention is it is needed at runtime.
We had similar conversations about .a files and removed them in #41966.
changed the title [-]Some .c and .h files are being published for Blazor WASM apps[/-][+]Some .c and .h files are being published for non-blazorwasm apps[/+]on Sep 9, 2021
Activity
am11 commentedon Feb 9, 2021
This seems to be intentional: #43785 (review). I think if we don't need the intermediate files, one cleaner option is that we separate out the "runtime pack with intermediates" from "standard runtime pack" (as the former is not for the common use-case for end-users, and requires WebAssembly compiler toolchain to be installed; to be able to relink with different arguments).
e.g.
./build.sh -os browser -c Releasewill not put these intermediate artifacts inartifacts//bin/native/net6.0-Browser-Release-wasm/src/, but, say a new OS,./build.sh -os browser-extras -c Releasewill. This way, we will not need to modifysrc/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props, as that is a flat whitelist of 'all possible files' and sfx targets (in arcade) validate the other way around; all files in destination directory (in this caseartifacts//bin/native/net6.0-Browser-Release-wasm/src/) are present in the whitelist. So if a subset (likeclrormono) doesn't produce all those files, it is fine.cc @vargaz
BTW, here is the complete diff between net5 and net6 (6.0.0-preview.2.21105.12; 0429344)
wwwroot/_frameworkdirectories:vargaz commentedon Feb 9, 2021
We need those files to compile the final dotnet executable, at least driver.c needs to stay a source file since its compiled with -D defines during the build. Maybe we can get them from the runtime pack instead of the publish dir. Not sure how they end up in the final app, we create the final app ourself in the bin/Release/AppBundle directory which doesn't contain these files.
am11 commentedon Feb 11, 2021
Looks like in https://github.com/dotnet/sdk/blob/9ccce1ee9788b8267e0242f73b74bf9766bb20d0/src/BlazorWasmSdk/Targets/Microsoft.NET.Sdk.BlazorWebAssembly.Current.targets, due to line 95 and line 211, everything under
~/.nuget/packages/microsoft.netcore.app.runtime.browser-wasm/6.0.0-preview.2.21105.12/runtimes/browser-wasm/nativegets copied to publish dir'swwwroot/_framework/. We can copy these additional *.c and *.h files somewhere else, sayruntimes/browser-wasm/sourcesinstead ofruntimes/browser-wasm/nativein this package without changing the SDK. Would that work?Also, (unless it was intentional) the missing
System.Runtime.InteropServices.RuntimeInformation.dllfrom .NET6 publish directory could be problematic.eerhardt commentedon Feb 11, 2021
It isn't problematic. This assembly is no longer necessary. In
net5.0, AspNetCore.Components was using theRuntimeInformation.IsOSPlatformmethod from this assembly. Innet6.0, that code has been changed to use the newOperatingSystem.IsXXX()methods. See dotnet/aspnetcore#28233.pranavkm commentedon Feb 13, 2021
By the way, we could change the SDK to have be more deliberate about what files are included (.dat, .blat, and the dotnet.wasm file). The SDK's globbing is very permissive today and there's no reason we couldn't flip it around
eerhardt commentedon Feb 13, 2021
I believe this is intentional with the reasoning being that the runtime gets to pick what is and what isn't included in the output of the application. If the file is in the right directory of the runtimepack, the intention is it is needed at runtime.
We had similar conversations about
.afiles and removed them in #41966.9 remaining items
eerhardt commentedon May 17, 2021
FYI - this was also logged in ASP.NET - dotnet/aspnetcore#32744.
radical commentedon Sep 9, 2021
This is not an issue for blazorwasm projects anymore, as it is skipping those files. So, moving this to 7.0.0, to fix for non-blazorwasm projects.
[-]Some .c and .h files are being published for Blazor WASM apps[/-][+]Some .c and .h files are being published for non-blazorwasm apps[/+]lewing commentedon May 12, 2022
We need to decide on a resolution to this so that the various bundlers can share it.
radical commentedon Aug 10, 2022
This is being handled currently, but in a hacky manner. And we have an approach in mind, but that will get implemented in .net8 .
maraf commentedon Jul 24, 2023
This is resolved in Wasm SDK